Optimize a stochastic process using nlinfit

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.

Risposte (1)

Torsten
Torsten il 3 Mar 2017
f=@(beta,x)model(beta,x,kexp,nbr,n)
Best wishes
Torsten.

Categorie

Scopri di più su Programming in Centro assistenza e File Exchange

Richiesto:

il 2 Mar 2017

Risposto:

il 3 Mar 2017

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by