Covariance of 3x3 matrix, CHOLSOL

Hi
I'm doing the State Space Form with 3 independent variables. Obviously there are 1 measurement equation and 3 transition equations, it's hard to find example of using CHOLSOL over the internet.

Measurement equation:
Rs(t) = b0 + Beta(t)*X(t)+ Alpha(t)*Y(t) +Gamma(t)*Z(t) + e(t)

Transition equation:
1. Apha(t)= Alpha(t-1)+u(t)
2. Beta(t)= Beta(t-1)+w(t)
3. Gamma(t)= Gamma(t-1)+v(t)

For 2 variables I used covariance matrix or Q as sqrt(sma2*sma3); sma2, sma3 are sigma of u(t) and w(t) respectively.

Can anyone please help to figure out how can I use Cholesky Decomposition CHOLSOL command to find the covariance of 3 independent variables.

Thanks!

1 Answer



0



I am not sure specifically about your State Space problem. Below is an example of using cholsol that should be helpful if your questions are about how to use cholsol correctly.

y = { -2.24, 
      13.57, 
      17.81, 
       8.26,
       7.50 };

//Symmetric Postive-Definite matrix
X = {   7   6 -12   1   3,
        6  36   7  23   0, 
      -12   7  34   9   0,
        1  23   9  17  -5,  
        3   0   0  -5  15 };

//Compute Cholesky decomposition
C = chol(X);

//Solve system of linear equations with 'cholsol'
b_hat_1 = cholsol(y, C);

//Solve system of linear equations using
//the 'normal equation'
b_hat_2 = invpd(X'X)*X'y;

//Print both parameter estimates
format /rd 10,4;
print "   b_hat_1  :  b_hat_2";
print b_hat_1~b_hat_2;

Your Answer

1 Answer

0

I am not sure specifically about your State Space problem. Below is an example of using cholsol that should be helpful if your questions are about how to use cholsol correctly.

y = { -2.24, 
      13.57, 
      17.81, 
       8.26,
       7.50 };

//Symmetric Postive-Definite matrix
X = {   7   6 -12   1   3,
        6  36   7  23   0, 
      -12   7  34   9   0,
        1  23   9  17  -5,  
        3   0   0  -5  15 };

//Compute Cholesky decomposition
C = chol(X);

//Solve system of linear equations with 'cholsol'
b_hat_1 = cholsol(y, C);

//Solve system of linear equations using
//the 'normal equation'
b_hat_2 = invpd(X'X)*X'y;

//Print both parameter estimates
format /rd 10,4;
print "   b_hat_1  :  b_hat_2";
print b_hat_1~b_hat_2;

You must login to post answers.

Have a Specific Question?

Get a real answer from a real person

Need Support?

Get help from our friendly experts.

Try GAUSS for 14 days for FREE

See what GAUSS can do for your data

© Aptech Systems, Inc. All rights reserved.

Privacy Policy