how to fit a curve in the form of A = (L^x)(D^y)
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Roule
el 22 de Feb. de 2016
Comentada: Jos (10584)
el 23 de Feb. de 2016
hi, i have some response data as vector A where the variables are L and D.
I just want to find the coefficients for L and D which will fit my data in the form mentioned in the title.
I want to fit a curved line, and not a surface.
I feel it should be fairly simple, but reading a few old answers also didn't help my case.
Is there some easy way to do this?
In case u want to see the data, here it is:
A = [0 0.06 0.12 0.44 0.56 0.94 1 1 0 0.04 0.58 0.74 0.86 1 1]
L = [100 100 100 100 100 100 100 100 43.7 49.7 56 61.5 65 77 93.8]
D = [11.3 10.1 8.9 8.5 8.1 7.7 6.5 5.3 5 5 5 5 5 5 5]
Thanks a lot.
More info:
I wrote the above equation as logA = xlogL + ylogD, and tried to use
X = [ones(size(logL)) logL logD];
b = regress(logA,X);
but Matlab didn't return any coefficients, it just gave b = NaN NaN NaN
4 comentarios
Respuesta aceptada
Jos (10584)
el 22 de Feb. de 2016
nlm = fitnlm([L(:) D(:)], A, 'y~(x1^b1)*(x2^b2)',[0 0])
2 comentarios
Jos (10584)
el 23 de Feb. de 2016
I had the same outcome, so that's good. If you think you can come up with a better model you can fit that as well, of course. By the way, always plot your data, your fit and your residuals (fittedY - Y) to see how your model is doing.
Más respuestas (0)
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!