BookmarkSubscribeRSS Feed
FeiGu
Calcite | Level 5

Hi,

Can someone help me verify that the following code generate a bivariate vector "z" that follows a VAR(2) structure? The first AR matrix is

0.6  0.0

0.0  0.6

and the second AR matrix is

0.18  0.00

0.00  0.18

This vector series also has a linear time trend with coefficient vector, g =

0.3

0.5

Thanks!

Fei

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

PROC IML;

mean_eta  = J(1,2,0);

sigma_eta = {1.0 0.5,

                    0.5 1.0};

eta       = randnormal(300,Mean_eta,Sigma_eta);

f    ={

0.6  0.0,

0.0  0.6};

g    = {0.3, 0.5};

t    = T(do(1,300,1));

z = J(300,2,0);

do i = 3 to 300;

  z[i,] = T( f*T(z[i-1,]) + 0.3#f*T(z[i-2,]) + g*t ) + eta[i,];

end;

Quit;

1 REPLY 1
udo_sas
SAS Employee

Hello -

This might give you some ideas:

Taken from http://support.sas.com/documentation/cdl/en/etsug/60372/HTML/default/viewer.htm#etsug_varmax_sect003...:

The following IML procedure statements simulate a bivariate vector time series from this model to provide test data for the VARMAX procedure:

   proc iml;
      sig = {1.0  0.5, 0.5 1.25};
      phi = {1.2 -0.5, 0.6 0.3};
      /* simulate the vector time series */
      call varmasim(y,phi) sigma = sig n = 100 seed = 34657;
      cn = {'y1' 'y2'};
      create simul1 from y[colname=cn];
      append from y;
   quit;

Thanks,

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

Multiple Linear Regression in SAS

Learn how to run multiple linear regression models with and without interactions, presented by SAS user Alex Chaplin.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 783 views
  • 0 likes
  • 2 in conversation