constrained parameter fitting using fmincon

Hi,
I want to do a parameter optimization. So far I was using lsqcurvefit to fit observed data with a function of the following form:
function [F] = datamatch(p,xdata,non0Indices,v1,v2,D,p0,q,g,lnc)
x2=p(1);
x3=p(2);
x1=p(3:lnc+2);
X1=zeros(size(xdata(:,1)));
X1(non0Indices) = x1;
p = x2 - x3 * log(xdata/q)
F = (x1*v1) + (D * (1-(1-p/p0)^g) / (v2(1-p/p0)^g) )
whereby v1, v2, D, p0, g, q are scalar factors, x1, x2, x3 are the fitting parameters, x2 and x3 are scalars while x1 can have different values at a part of the dataset and is 0 everywhere else.
Unfortunately lsqcurvefit does not allow to set constraints, so my x1, x2, x3 become complex (which I do not want). I think I have to reformulate my problem to a least squares minimization using fmincon.
my constraints should be: x2>0 x2 - x3 * log(r/q) < 2p0
in order to avoid complex fitting parameters as an output.
My question is - how do I have to rewrite my function so that fmincon would work and deliver the optimal parameters x1, x2, x3 so that the term d - F(m)^2 will be at its minimum? The help for fmincon is abit cryptic to me. Where can I put in my observables, model function(F see above), initial optimization parameters?

Réponses (0)

Catégories

En savoir plus sur Get Started with Curve Fitting Toolbox dans Centre d'aide et File Exchange

Produits

Question posée :

le 11 Déc 2012

Community Treasure Hunt

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

Start Hunting!

Translated by