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

WIP: Expose solve's keyword arguments in datafit #173

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/datafit.jl
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ it can be a subset of parameters. Other parameters necessary to solve `prob`
default to the parameter values found in `prob.p`.
Similarly, not all states must be measured.
"""
function datafit(prob, p::Vector{Pair{Num, Float64}}, t, data; loss = l2loss)
function datafit(prob, p::Vector{Pair{Num, Float64}}, t, data; loss = l2loss, solvekw = (;))
pvals = getfield.(p, :second)
pkeys = getfield.(p, :first)
oprob = OptimizationProblem(loss, pvals,
lb = fill(-Inf, length(p)),
ub = fill(Inf, length(p)), (prob, pkeys, t, data))
res = solve(oprob, NLopt.LN_SBPLX())
res = solve(oprob, NLopt.LN_SBPLX(); solvekw...)
Pair.(pkeys, res.u)
end

Expand Down