difference between pem (lsqnonlin) and lsqcurvefit

Can somebody explain me the difference in the error function between using pem with the lsqnonlin estimator and lsqcurvefit ?

Answers (1)

Matt J
Matt J on 12 Oct 2014
Edited: Matt J on 12 Oct 2014
Don't know what "pem" refers to, but lsqcurvefit applies to a special case of lsqnonlin when the residual vector has the form
r(x)= F(x,xdata)-ydata
Conversely, lsqnonlin can be applied to any (differentiable) residual function r(x).

1 Comment

with 'pem' I was referring to the prediction error estimate function: http://www.mathworks.it/it/help/ident/ref/pem.html I'm using it for fitting time series data to a nonlinear grey box model. Both pem and lsqcurvefit can be run with the lsqnonlin estimator (and for both i'm using the trust-region-reflective algorithm which gives me the best results). Actually being that my process doesn'depend directly on time (but essentially output is feedbacked into input at each iteration, I can treat it both as a curve fitting or prediction error problem.
By the way, apparently pem and lsqcurvefit return different solutions, and from the documentation, pem seems to optimize a different equation, but I wasn't able to understand exactly which is the difference among the two.
From the documentation (pem, section Algorithm) i read the following:
PEM uses numerical optimization to minimize the cost function, a weighted norm of the prediction error, defined as follows for scalar outputs:
V N (G,H)= N  t=1 e 2 (t) where e(t) is the difference between the measured output and the predicted output of the model. For a linear model, this error is defined by the following equation:
e(t)=H −1 (q)[y(t)−G(q)u(t)] e(t) is a vector and the cost function V N (G,H) is a scalar value. The subscript N indicates that the cost function is a function of the number of data samples and becomes more accurate for larger values of N. For multiple-output models, the previous equation is more complex.

Sign in to comment.

Products

Asked:

on 12 Oct 2014

Commented:

on 12 Oct 2014

Community Treasure Hunt

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

Start Hunting!