From: Raul on
Hi all,

I am trying to minimize a function of the form:

y*W*y'

where y is a 1xn vector of the form y=myfun(pars)-c, where myfun is a vector-valued non-linear user-defined function of parameters pars and c is a given fixed vector of constants. W is a symmetric, positive definite matrix (a quadratic form). Of course, if W is the identity matrix, I could use the built-in function lsqnonlin directly to minimize my objective function over the parameter of myfun. However, is there a similar command for the more general weight matrix W?

Thanks in advance,

--Raul
From: Bruno Luong on
"Raul " <ragonzal(a)alum.mit.edu> wrote in message <hsdt3g$sha$1(a)fred.mathworks.com>...
> Hi all,
>
> I am trying to minimize a function of the form:
>
> y*W*y'
>

I assume y'*W*y.

Take the cholesky decomposition of W

W = R'*R;

The cost function becomes:

y*W*y' = z'*z = norm(z)^2

with z = R*y

Just call lsqnonlin with R*y

Bruno
From: Raul on
Thanks! Silly of me not to have seen that!
--Raul
"Bruno Luong" <b.luong(a)fogale.findmycountry> wrote in message <hsdu58$4ku$1(a)fred.mathworks.com>...
> "Raul " <ragonzal(a)alum.mit.edu> wrote in message <hsdt3g$sha$1(a)fred.mathworks.com>...
> > Hi all,
> >
> > I am trying to minimize a function of the form:
> >
> > y*W*y'
> >
>
> I assume y'*W*y.
>
> Take the cholesky decomposition of W
>
> W = R'*R;
>
> The cost function becomes:
>
> y*W*y' = z'*z = norm(z)^2
>
> with z = R*y
>
> Just call lsqnonlin with R*y
>
> Bruno