Optimize a stochastic process using nlinfit
Mostrar comentarios más antiguos
Hello,
I have an issue using nlinfit in order to optimize the parameters of my model. My goal is to find the right parameters (in the vector beta) so my stochastic model fits my experimental data.
Here is my code :
function x = optim(n,Xdist,Ydist,kexp)
nbr = 100;
f=@(beta)model(beta,kexp,nbr,n)
beta0=[20,0.1,0.1]
nlinfit(Ydist,Xdist,f,beta0)
"model" returns the cumulative distribution function of my model and Xdist and Ydist stand for my experimental cumulative distribution function.
When I run it I get the error : "Error using nlinfit (line 205) Error evaluating model function '@(beta)model(beta,kexp,nbr,n)'.
Error in optim (line 10) nlinfit(Ydist,Xdist,f,beta0)
Caused by: Error using optim>@(beta)model(beta,kexp,nbr,n) Too many input arguments."
Do you know what I should change ?
Thanks for your help.
Respuestas (1)
Torsten
el 3 de Mzo. de 2017
0 votos
f=@(beta,x)model(beta,x,kexp,nbr,n)
Best wishes
Torsten.
Categorías
Más información sobre Programming en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!