- 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 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Rachel Kirkland
el 15 de Feb. de 2020
Comentada: Rachel Kirkland
el 17 de Feb. de 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 comentarios
Respuesta aceptada
Matt J
el 15 de Feb. de 2020
Some possibilities,
parameters1=dofit1(initialguess1);
initialguess2=parameters1;
Parameters2 = dofit2(initialGuess2)
Más respuestas (0)
Ver también
Categorías
Más información sobre Ordinary Differential Equations en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!