SV: How to Calculate Eigenvalues within Equations Section?

Hi Zahra



I assume you have something like



Set I basis set for variance covariance matrix / … /;

Alias (I,ip,ipp);

Variable cov(I,ip) variance-covariance matrix;



Then you can add the following variables and constraints that define the relationship between the covariance and the eigensystem:



Variable E(I) eigenvalues

Variable EV(I,ip) Normalized eigenvectors;

  • Comment: first index correspond to the number of the eigenvalue and second is the dimension

Equation CovDef(I,Ip) Definition of Covariance in terms of eigenvalues and eigenvectors

Equation Norm(I) Normalization of eigenvectors;



CovDef(I,Ip) … cov(I,ip) =E= sum(ipp, EV(I,ipp)*E(Ipp)*EV(Ip,Ipp) );

NormI(I) … sum(Ip, sqr(EV(I,ip) ) =E= 1;



You can now add bounds on the eigenvalues, e.g.



E.lo(I) = 0.001;



And you can use them to define the log of the determinant:



Ldet =E= sum(I, log(E(I)) );



The extra constraints are very nonlinear and it can be extremely difficult for a nonlinear solver to find a feasible solution to them from default initial values. You should therefore work on proper initial values. I assume that you have initial values for the Covariance matrix and you should use these initial values to compute a consistent set of initial values for the eigenvectors and eigenvalues. (Copy the initial value of the variable Cov to a parameter and use the Eigenvector utility to get parameters with the initial values of the eigenvectors and eigenvalues – look for eigenvector in the McCarl guide). If you provide these initial values then the new constraints will be feasible from the start (you shoulc of course check it using limrow = xxx;) and the nonlinear solver will work on gradual improvements from a good initial point.



Because of symmetry you could of course remove some of the CovDef constraints for example using $(ord(I) le ord(Ip)) on the equation definition.



Good luck



Arne


\

Arne Stolbjerg Drud

ARKI Consulting & Development A/S

Bagsvaerdvej 246A, DK-2880 Bagsvaerd, Denmark

Phone: (+45) 44 49 03 23, Fax: (+45) 44 49 03 33, email: adrud@arki.dk



Fra: gamsworld@googlegroups.com [mailto:gamsworld@googlegroups.com] PÃ¥ vegne af zahra adel
Sendt: 27. april 2011 08:17
Til: gamsworld@googlegroups.com
Emne: Re: How to Calculate Eigenvalues within Equations Section?



Dear Mortaza,

Thanks fo your concern.

Well, actually the project is about statistical regression. Error vectors are calculated as a function of real and estimated values. Then, based on these vectors, matrix of variance-covariance is produced (of course, all within function section). As Maximum Likelihood procedure suggests, the determinant of this matrix should be minimized. But this minimization is due to some restrictions.

Meanwhile, another matrix is generated in function section, which elements are functions of error vectors and some other variables. This matrix should be negitive semidefinite. In order to apply this constraint, I decided to put restriction on its values of eigenvalues (which should be all negative). But since all these should be done within function section, I have no idea how to accomplish it.



Bests,

Zahra.



From: mortaza baky-haskuee
To: gamsworld@googlegroups.com
Sent: Tue, April 26, 2011 2:51:57 PM
Subject: Re: How to Calculate Eigenvalues within Equations Section?


Hi,

WOuld you write me more on your project?

yours

baky

On Tue, Apr 26, 2011 at 8:58 AM, zahra adel wrote:

Dears;



I have an optimization problem, in which I need to put a constraint on eigenvalues of a matrix. The elements of this matrix are variables. So the eigenvalues must be calculated within the structure of equations.

Does anybody know how I can do that?



Thanks!


To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.


\

To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.


To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.


To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.

Dear Arne
Thank you so much!
Bests,
Zahra.

From: Arne Stolbjerg Drud
To: gamsworld@googlegroups.com
Sent: Thu, April 28, 2011 12:44:28 PM
Subject: SV: How to Calculate Eigenvalues within Equations Section?

Hi Zahra



I assume you have something like



Set I basis set for variance covariance matrix / … /;

Alias (I,ip,ipp);

Variable cov(I,ip) variance-covariance matrix;



Then you can add the following variables and constraints that define the relationship between the covariance and the eigensystem:



Variable E(I) eigenvalues

Variable EV(I,ip) Normalized eigenvectors;

  • Comment: first index correspond to the number of the eigenvalue and second is the dimension

Equation CovDef(I,Ip) Definition of Covariance in terms of eigenvalues and eigenvectors

Equation Norm(I) Normalization of eigenvectors;



CovDef(I,Ip) … cov(I,ip) =E= sum(ipp, EV(I,ipp)*E(Ipp)*EV(Ip,Ipp) );

NormI(I) … sum(Ip, sqr(EV(I,ip) ) =E= 1;



You can now add bounds on the eigenvalues, e.g.



E.lo(I) = 0.001;



And you can use them to define the log of the determinant:



Ldet =E= sum(I, log(E(I)) );



The extra constraints are very nonlinear and it can be extremely difficult for a nonlinear solver to find a feasible solution to them from default initial values. You should therefore work on proper initial values. I assume that you have initial values for the Covariance matrix and you should use these initial values to compute a consistent set of initial values for the eigenvectors and eigenvalues. (Copy the initial value of the variable Cov to a parameter and use the Eigenvector utility to get parameters with the initial values of the eigenvectors and eigenvalues – look for eigenvector in the McCarl guide). If you provide these initial values then the new constraints will be feasible from the start (you shoulc of course check it using limrow = xxx;) and the nonlinear solver will work on gradual improvements from a good initial point.



Because of symmetry you could of course remove some of the CovDef constraints for example using $(ord(I) le ord(Ip)) on the equation definition.



Good luck



Arne


\

Arne Stolbjerg Drud

ARKI Consulting & Development A/S

Bagsvaerdvej 246A, DK-2880 Bagsvaerd, Denmark

Phone: (+45) 44 49 03 23, Fax: (+45) 44 49 03 33, email: adrud@arki.dk



Fra: gamsworld@googlegroups.com [mailto:gamsworld@googlegroups.com] PÃ¥ vegne af zahra adel
Sendt: 27. april 2011 08:17
Til: gamsworld@googlegroups.com
Emne: Re: How to Calculate Eigenvalues within Equations Section?



Dear Mortaza,

Thanks fo your concern.

Well, actually the project is about statistical regression. Error vectors are calculated as a function of real and estimated values. Then, based on these vectors, matrix of variance-covariance is produced (of course, all within function section). As Maximum Likelihood procedure suggests, the determinant of this matrix should be minimized. But this minimization is due to some restrictions.

Meanwhile, another matrix is generated in function section, which elements are functions of error vectors and some other variables. This matrix should be negitive semidefinite. In order to apply this constraint, I decided to put restriction on its values of eigenvalues (which should be all negative). But since all these should be done within function section, I have no idea how to accomplish it.



Bests,

Zahra.



From: mortaza baky-haskuee
To: gamsworld@googlegroups.com
Sent: Tue, April 26, 2011 2:51:57 PM
Subject: Re: How to Calculate Eigenvalues within Equations Section?


Hi,

WOuld you write me more on your project?

yours

baky

On Tue, Apr 26, 2011 at 8:58 AM, zahra adel wrote:

Dears;



I have an optimization problem, in which I need to put a constraint on eigenvalues of a matrix. The elements of this matrix are variables. So the eigenvalues must be calculated within the structure of equations.

Does anybody know how I can do that?



Thanks!


To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.


\

To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.


To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.


To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.


To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.