## minimization problem

Solved
Occasional Contributor
Posts: 7

# minimization problem

Hi,

How can I solve in IML a minimization problem as following?

Having a known matrix e.g. M= {0.8 0.2, 0.4 0.6} and a known generator matrix G, I want to solve a and b (a diagonal matrix A) such that the distance between M[,2] and exp(A*G) [,2] is minimized – basically the minimization is addressed to the last column in matrices only ...

Many thanks,

Dan

Accepted Solutions
Solution
‎02-19-2016 01:09 PM
SAS Super FREQ
Posts: 4,237

## Re: minimization problem

Posted in reply to dannegrila

Your objective function is

SSQ( (exp(A*G)  - M)[,2] )

Write the function to be minimized as a function of the diagonal parameters a and b. You can use any NLP routine to minimize the function.

There are many examples on my blog (search for 'NLPNRA') . Start with the article that maximizes the likelihood function, which includes links to the NLP documentation. Set opt[1]=0 to specify minimization.

All Replies
Solution
‎02-19-2016 01:09 PM
SAS Super FREQ
Posts: 4,237

## Re: minimization problem

Posted in reply to dannegrila

Your objective function is

SSQ( (exp(A*G)  - M)[,2] )

Write the function to be minimized as a function of the diagonal parameters a and b. You can use any NLP routine to minimize the function.

There are many examples on my blog (search for 'NLPNRA') . Start with the article that maximizes the likelihood function, which includes links to the NLP documentation. Set opt[1]=0 to specify minimization.

Occasional Contributor
Posts: 7

## Re: minimization problem

Many thanks Rick.

P.S. exp(.) stands for matrix exponential (expmatrix)

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
• 2 replies
• 385 views
• 0 likes
• 2 in conversation