Optimize transition rate matrix

Hi all,
I have created a log-likelihood function which uses a 4x4 transition rate matrix of a Markov process as input, i.e. Q-matrix. I want to optimize the Q-matrix to maximize the log-likelihood. I have seen that one can use fmincon and similar optimization function but haven't found one that suit my problem. The struggle is to optimize the matrix, while still having the matrix follow the constraints of a markov process, that is:
  • The sum of all elements of a row should be equal to 0
  • The diagonal elements should be equal to the sum of the other elements in the row
Since it is a matrix, I am having a hard time to use the linear constraints of fmincon and similar. Is it possible to create constraints that would help me with following the constraints of the transition rate matrix?
Best,

 Accepted Answer

Torsten
Torsten on 16 Jun 2022
Instead of a 4x4 matrix use a (16x1) vector. Then it is easy to implement your constraints in Aeq and beq.
If somewhere in your code it is more comfortable to switch back to a matrix, use "reshape" on the vector supplied by fmincon.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!