how to select proper parameters for "opt.StartPoint" ?
13 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I want to fit some data as below code witch generate from curve fitting tool:
[xData, yData] = prepareCurveData( x, y );
ft = fittype( 'c*x^(a*sin(x*b)^2)', 'independent', 'x', 'dependent', 'y' );
opts = fitoptions( 'Method', 'NonlinearLeastSquares' );
opts.Display = 'Off';
opts.StartPoint = [0.452987881098739 0.698037618662922 0.104515161828401];
[fitresult, gof] = fit( xData, yData, ft, opts );
How can I know the best start points?
0 comentarios
Respuestas (1)
Matt J
el 22 de Abr. de 2021
Editada: Matt J
el 22 de Abr. de 2021
Assuming b is known, the log-model
log(yData)=log(c) + a*(log(x)*sin(x*b)^2)
is a linear model in a and log( c ). Therefore, if you know a decent guess for b, you can use a linear fit (which doesn't require an initial guess) to develop initial guesses for the other parameters.
2 comentarios
Matt J
el 23 de Abr. de 2021
For example,
p=polyfit( (log(x)*sin(x*b)^2) , log(yData), 1 );
a=p(1);
c=exp(p(2))
Ver también
Categorías
Más información sobre Linear and Nonlinear Regression 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!