- Combine the code from both fitting steps into a single script. That way you will have direct access to the output of the first fit.
- Put each fit into its own mfunction. Write the functions to takes an initial guess as input (along with other arguments, perhaps) and returns the fit parameters as output. Then in a main file do,
Passing parameter values found in lsqcurvefit to be initial values for parameter estimation in another function
1 view (last 30 days)
Show older comments
Rachel Kirkland
on 15 Feb 2020
Commented: Rachel Kirkland
on 17 Feb 2020
Hi,
Can anyone help please? I have estimated the parameters for an ODE model, theta(1) to theta(12), using lsqcurvefit. I want to use the results as initial 'guesses' for the parameters in another slightly different ODE model where I also need to estimate the parameters. It is slightly complicated that this second ODE model has 15 parameters. I want to start the last three at 1.
At the moment I am copying and pasting the found parameter values into the initial values theta0 in the second script. Is there any way to call the parameters found by running the first script to use in the second?
I hope that makes sense. I haven't included any code since it is just the one line of code I need help with, and I don't know where to start. Please let me know if there is any code you need to see.
Thanks
0 Comments
Accepted Answer
Matt J
on 15 Feb 2020
Some possibilities,
parameters1=dofit1(initialguess1);
initialguess2=parameters1;
Parameters2 = dofit2(initialGuess2)
More Answers (0)
See Also
Categories
Find more on Ordinary Differential Equations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!