You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This hinted at a dimension mismatch in the mul! method. After some debugging, I found that in levenberg_marquardt.jl , there’s line 80 creating a buffer:
n_buffer = Vector{T}(undef, n)
Checking size(n_buffer) = (3,)
Line 123, where my code fails with the aforementioned error, is:
mul!(n_buffer, transpose(J), value(df))
with size(transpose(J))=(3,19) and size(value(df)) = (19,1). Multiplying these should result in a size (3,1) and not (3,).
Thus, it’s also not possible to save the product to n_buffer.
I believe that this would be fixed by changing:
n_buffer = Matrix{T}(undef, n, 1)
The text was updated successfully, but these errors were encountered:
Without a minimal working example it is hard to tell, but my guess is that your model function returns a 3x1 matrix instead of a vector. Can you check if that is the case? An easy fix would in that case be to change
Without a minimal working example it is hard to tell, but my guess is that your model function returns a 3x1 matrix instead of a vector. Can you check if that is the case? An easy fix would in that case be to change
I agree, it appears that you return a matrix, not a vector.
When I ran a fit of a ODE model with 2 equations and 3 parameters against data with 19 data points, I encountered the following error:
This hinted at a dimension mismatch in the
mul!
method. After some debugging, I found that inlevenberg_marquardt.jl
, there’s line 80 creating a buffer:Checking
size(n_buffer) = (3,)
Line 123, where my code fails with the aforementioned error, is:
with
size(transpose(J))=(3,19)
andsize(value(df)) = (19,1)
. Multiplying these should result in a size(3,1)
and not(3,)
.Thus, it’s also not possible to save the product to
n_buffer
.I believe that this would be fixed by changing:
The text was updated successfully, but these errors were encountered: