curve_fit now returns a single object of type LsqFitResult. According to the
README:
# fit is a composite type (LsqFitResult), with some interesting values:
# fit.dof: degrees of freedom
# fit.param: best fit parameters
# fit.resid: residuals = vector of residuals
# fit.jacobian: estimated Jacobian at solution
So if `fit` is the returned value your get the model parameters in `fit.param`.
Best,
Alex.
On Tuesday, 3 March 2015 23:15:36 UTC+1, Andrei Berceanu wrote:
> im using the code in the blog post
>
> model(xdata,p) = p[1]*cos(p[2]*xdata)+p[2]*sin(p[1]*xdata)
>
> xdata = [-2,-1.64,-1.33,-0.7,0,0.45,1.2,1.64,2.32,2.9]
> ydata =
> [0.699369,0.700462,0.695354,1.03905,1.97389,2.41143,1.91091,0.919576,-0.730975,-1.42001]
>
> beta, r, J = curve_fit(model, xdata, ydata, [1.0, 0.2])
> # beta = best fit parameters
> # r = vector of residuals
> # J = estimated Jacobian at solution
>
> @printf("Best fit parameters are: %f and %f",beta[1],beta[2])
> @printf("The sum of squares of residuals is %f",sum(r.^2.0))
> and my julia is 0.3.7-pre
>
> On Tuesday, March 3, 2015 at 11:11:26 PM UTC+1, René Donner wrote:Can you
> post the code you are trying to run? Which Julia version are you on?
>
>
>
> The example given on https://github.com/JuliaOpt/LsqFit.jl works fine here on
> 0.3.6.
>
>
>
>
>
>
>
> Am 03.03.2015 um 22:55 schrieb Andrei Berceanu <[email protected]>:
>
>
>
> > i now get
>
> > `start` has no method matching start(::LsqFitResult{Float64})
>
> >
>
> > On Tuesday, March 3, 2015 at 10:41:11 PM UTC+1, René Donner wrote:
>
> > Looks like curve_fit has been moved to
> > https://github.com/JuliaOpt/LsqFit.jl
>
> >
>
> >
>
> > Am 03.03.2015 um 22:30 schrieb Andrei Berceanu <[email protected]>:
>
> >
>
> > > i found this post concerning nonlinear curve fitting in Julia,
>
> > > http://www.walkingrandomly.com/?p=5181
>
> > > but it appears the curve_fit method no longer exists
>
> > >
>
> > > does anyone have an updated version?
>
> >