Inf Computed by model function

1 visualización (últimos 30 días)
CP
CP el 21 de Jun. de 2011
I'm trying to fit some data to the following model using fit and fittype:
model1=fittype('h*exp((-w*x)^2)*(sin(w*x))','independent,{'x'},'coefficients',{'h','w'});
When I try to do the fit I get the error message: Inf computed by model function, fitting cannot continue. Try using or tightening upper and lower bounds on coefficients.
I tried tightening them pretty tightly but I still get this error.
The data I'm trying to fit is this:
x: [-169.3662 -149.8015 -130.3560 -110.7559 -90.4435 -70.1957 -50.5075 -35.9124 -15.4939 10.7868 30.6151 50.4345 69.3836 89.8258 109.6690 130.0456 149.6947 169.9521]
y: [0.4029 -0.6778 -0.3065 -0.8638 -2.7271 -3.0545 -6.0058 -4.7192 0.2971 1.2499 2.0040 3.9745 3.0164 1.4674 2.5399 0.9531 0.3945 -0.1607]
Is there some option i can use to get this to work? Thanks!

Respuesta aceptada

CP
CP el 21 de Jun. de 2011
Oops never mind, I had a typo in my model with the parentheses. Negative sign was supposed to be outside the ()^2, otherwise the values become infinite real fast.

Más respuestas (0)

Categorías

Más información sobre Linear and Nonlinear Regression en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by