Asked by ameen
on 23 May 2013

Hi all i have 17 observation (x and y) the relation between them as follows

y = 0.392 * (1 - (x / J)) ^ i

i want to use nonlinear least square regression to know J and i

Thanks in advance

*No products are associated with this question.*

Answer by Eli Duenisch
on 23 May 2013

Edited by Eli Duenisch
on 23 May 2013

Accepted answer

Do you have the statistics toolbox installed? It supports nonlinear regression - look for NonLinearModel.fit() in the docs.

Show 2 older comments

Tom Lane
on 24 May 2013

For modelfun: either write a function or use 'y ~ .392*(1-x/b1)^b2'. The function will be happier if you use names b1/b2 in place of J/I.

For beta0: give a two-element vector with your best guess at b1 and b2. This depends on your data. A good guess gives the function a better shot at solving the problem. If you have real data, you might consider something like b1=2*max(x) to avoid problems with complex numbers.

Opportunities for recent engineering grads.

## 0 Comments