Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parameter estimation with one data point #149

Closed
moesphere opened this issue Nov 18, 2020 · 3 comments
Closed

Parameter estimation with one data point #149

moesphere opened this issue Nov 18, 2020 · 3 comments

Comments

@moesphere
Copy link

It seems that parameter estimation with one data point does not work as the corresponding loop through the solution starts at index = 2: here

Partially related to this issue

using DiffEqParamEstim, DifferentialEquations
function f(du, u, p, t)
    du[1] = dx = p[1] * u[1] - u[1] * u[2]
    du[2] = dy = -3 * u[2] + u[1] * u[2]
end
  
u0 = [1.0; 1.0]
tspan = (0.0, 10.0)
p = [1.5]
prob = ODEProblem(f, u0, tspan, p)
loss_objective = build_loss_objective(prob, Tsit5(), L2Loss([1.], ones(2)))
loss_objective(p) # returns zero
sum((solve(prob)(1.0)-ones(2)).^2) # should return this instead
@CedricLhoussaine
Copy link

I confirm this issue: the parameter estimation always skip the first data point.

@ChrisRackauckas
Copy link
Member

oh interesting, it would be good to just change that to one. If the initial condition matches, then it's just zero so it won't change that case.

@ChrisRackauckas
Copy link
Member

Fixed by #157

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants