<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Simulate a bivariate vector follow VAR(2) structure in SAS Forecasting and Econometrics</title>
    <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Simulate-a-bivariate-vector-follow-VAR-2-structure/m-p/117091#M641</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-family: arial, sans-serif; color: #222222; background-color: #ffffff;"&gt;Hi,&lt;/P&gt;&lt;P style="font-family: arial, sans-serif; color: #222222; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-family: arial, sans-serif; color: #222222; background-color: #ffffff;"&gt;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&lt;/P&gt;&lt;P style="font-family: arial, sans-serif; color: #222222; background-color: #ffffff;"&gt;0.6&amp;nbsp; 0.0&lt;/P&gt;&lt;P style="font-family: arial, sans-serif; color: #222222; background-color: #ffffff;"&gt;0.0&amp;nbsp; 0.6&lt;/P&gt;&lt;P style="font-family: arial, sans-serif; color: #222222; background-color: #ffffff;"&gt;and the second AR matrix is&lt;/P&gt;&lt;P style="font-family: arial, sans-serif; color: #222222; background-color: #ffffff;"&gt;0.18&amp;nbsp; 0.00&lt;/P&gt;&lt;P style="font-family: arial, sans-serif; color: #222222; background-color: #ffffff;"&gt;0.00&amp;nbsp; 0.18&lt;/P&gt;&lt;P style="font-family: arial, sans-serif; color: #222222; background-color: #ffffff;"&gt;This vector series also has a linear time trend with coefficient vector, g =&lt;/P&gt;&lt;P style="font-family: arial, sans-serif; color: #222222; background-color: #ffffff;"&gt;0.3&lt;/P&gt;&lt;P style="font-family: arial, sans-serif; color: #222222; background-color: #ffffff;"&gt;0.5&lt;/P&gt;&lt;P style="font-family: arial, sans-serif; color: #222222; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-family: arial, sans-serif; color: #222222; background-color: #ffffff;"&gt;Thanks!&lt;/P&gt;&lt;P style="font-family: arial, sans-serif; color: #222222; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-family: arial, sans-serif; color: #222222; background-color: #ffffff;"&gt;Fei&lt;/P&gt;&lt;P style="font-family: arial, sans-serif; color: #222222; background-color: #ffffff;"&gt;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;/P&gt;&lt;P style="font-family: arial, sans-serif; color: #222222; background-color: #ffffff;"&gt;PROC IML;&lt;/P&gt;&lt;P style="font-family: arial, sans-serif; color: #222222; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-family: arial, sans-serif; color: #222222; background-color: #ffffff;"&gt;mean_eta&amp;nbsp; = J(1,2,0);&lt;/P&gt;&lt;P style="font-family: arial, sans-serif; color: #222222; background-color: #ffffff;"&gt;sigma_eta = {1.0 0.5,&lt;/P&gt;&lt;P style="font-family: arial, sans-serif; color: #222222; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.5 1.0};&lt;/P&gt;&lt;P style="font-family: arial, sans-serif; color: #222222; background-color: #ffffff;"&gt;eta&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = randnormal(300,Mean_eta,Sigma_eta);&lt;/P&gt;&lt;P style="font-family: arial, sans-serif; color: #222222; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;f&amp;nbsp;&amp;nbsp;&amp;nbsp; ={&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit;"&gt;0.6&amp;nbsp; 0.0,&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit;"&gt;0.0&amp;nbsp; 0.6};&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;g&amp;nbsp;&amp;nbsp;&amp;nbsp; = {0.3, 0.5};&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit;"&gt;t&amp;nbsp;&amp;nbsp;&amp;nbsp; = T(do(1,300,1));&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit;"&gt;z = J(300,2,0);&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit;"&gt;do i = 3 to 300;&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit;"&gt;&amp;nbsp; z[i,] = T( f*T(z[i-1,]) + 0.3#f*T(z[i-2,]) + g*t&lt;I&gt; ) + eta[i,];&lt;/I&gt;&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit;"&gt;end;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: arial, sans-serif; color: #222222; background-color: #ffffff;"&gt;Quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 10 Sep 2012 17:45:44 GMT</pubDate>
    <dc:creator>FeiGu</dc:creator>
    <dc:date>2012-09-10T17:45:44Z</dc:date>
    <item>
      <title>Simulate a bivariate vector follow VAR(2) structure</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Simulate-a-bivariate-vector-follow-VAR-2-structure/m-p/117091#M641</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-family: arial, sans-serif; color: #222222; background-color: #ffffff;"&gt;Hi,&lt;/P&gt;&lt;P style="font-family: arial, sans-serif; color: #222222; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-family: arial, sans-serif; color: #222222; background-color: #ffffff;"&gt;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&lt;/P&gt;&lt;P style="font-family: arial, sans-serif; color: #222222; background-color: #ffffff;"&gt;0.6&amp;nbsp; 0.0&lt;/P&gt;&lt;P style="font-family: arial, sans-serif; color: #222222; background-color: #ffffff;"&gt;0.0&amp;nbsp; 0.6&lt;/P&gt;&lt;P style="font-family: arial, sans-serif; color: #222222; background-color: #ffffff;"&gt;and the second AR matrix is&lt;/P&gt;&lt;P style="font-family: arial, sans-serif; color: #222222; background-color: #ffffff;"&gt;0.18&amp;nbsp; 0.00&lt;/P&gt;&lt;P style="font-family: arial, sans-serif; color: #222222; background-color: #ffffff;"&gt;0.00&amp;nbsp; 0.18&lt;/P&gt;&lt;P style="font-family: arial, sans-serif; color: #222222; background-color: #ffffff;"&gt;This vector series also has a linear time trend with coefficient vector, g =&lt;/P&gt;&lt;P style="font-family: arial, sans-serif; color: #222222; background-color: #ffffff;"&gt;0.3&lt;/P&gt;&lt;P style="font-family: arial, sans-serif; color: #222222; background-color: #ffffff;"&gt;0.5&lt;/P&gt;&lt;P style="font-family: arial, sans-serif; color: #222222; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-family: arial, sans-serif; color: #222222; background-color: #ffffff;"&gt;Thanks!&lt;/P&gt;&lt;P style="font-family: arial, sans-serif; color: #222222; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-family: arial, sans-serif; color: #222222; background-color: #ffffff;"&gt;Fei&lt;/P&gt;&lt;P style="font-family: arial, sans-serif; color: #222222; background-color: #ffffff;"&gt;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;/P&gt;&lt;P style="font-family: arial, sans-serif; color: #222222; background-color: #ffffff;"&gt;PROC IML;&lt;/P&gt;&lt;P style="font-family: arial, sans-serif; color: #222222; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-family: arial, sans-serif; color: #222222; background-color: #ffffff;"&gt;mean_eta&amp;nbsp; = J(1,2,0);&lt;/P&gt;&lt;P style="font-family: arial, sans-serif; color: #222222; background-color: #ffffff;"&gt;sigma_eta = {1.0 0.5,&lt;/P&gt;&lt;P style="font-family: arial, sans-serif; color: #222222; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.5 1.0};&lt;/P&gt;&lt;P style="font-family: arial, sans-serif; color: #222222; background-color: #ffffff;"&gt;eta&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = randnormal(300,Mean_eta,Sigma_eta);&lt;/P&gt;&lt;P style="font-family: arial, sans-serif; color: #222222; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;f&amp;nbsp;&amp;nbsp;&amp;nbsp; ={&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit;"&gt;0.6&amp;nbsp; 0.0,&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit;"&gt;0.0&amp;nbsp; 0.6};&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;g&amp;nbsp;&amp;nbsp;&amp;nbsp; = {0.3, 0.5};&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit;"&gt;t&amp;nbsp;&amp;nbsp;&amp;nbsp; = T(do(1,300,1));&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit;"&gt;z = J(300,2,0);&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit;"&gt;do i = 3 to 300;&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit;"&gt;&amp;nbsp; z[i,] = T( f*T(z[i-1,]) + 0.3#f*T(z[i-2,]) + g*t&lt;I&gt; ) + eta[i,];&lt;/I&gt;&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit;"&gt;end;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: arial, sans-serif; color: #222222; background-color: #ffffff;"&gt;Quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Sep 2012 17:45:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Simulate-a-bivariate-vector-follow-VAR-2-structure/m-p/117091#M641</guid>
      <dc:creator>FeiGu</dc:creator>
      <dc:date>2012-09-10T17:45:44Z</dc:date>
    </item>
    <item>
      <title>Re: Simulate a bivariate vector follow VAR(2) structure</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Simulate-a-bivariate-vector-follow-VAR-2-structure/m-p/117092#M642</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello -&lt;/P&gt;&lt;P&gt;This might give you some ideas:&lt;/P&gt;&lt;P&gt;Taken from &lt;A href="http://support.sas.com/documentation/cdl/en/etsug/60372/HTML/default/viewer.htm#etsug_varmax_sect003.htm" title="http://support.sas.com/documentation/cdl/en/etsug/60372/HTML/default/viewer.htm#etsug_varmax_sect003.htm"&gt;http://support.sas.com/documentation/cdl/en/etsug/60372/HTML/default/viewer.htm#etsug_varmax_sect003.htm&lt;/A&gt;:&lt;/P&gt;&lt;P&gt; The following IML procedure statements simulate a bivariate vector time series from this model to provide test data for the VARMAX procedure: &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; proc iml;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sig = {1.0&amp;nbsp; 0.5, 0.5 1.25};&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; phi = {1.2 -0.5, 0.6 0.3};&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* simulate the vector time series */&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call varmasim(y,phi) sigma = sig n = 100 seed = 34657;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cn = {'y1' 'y2'};&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; create simul1 from y[colname=cn];&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; append from y;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Sep 2012 18:52:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Simulate-a-bivariate-vector-follow-VAR-2-structure/m-p/117092#M642</guid>
      <dc:creator>udo_sas</dc:creator>
      <dc:date>2012-09-20T18:52:14Z</dc:date>
    </item>
  </channel>
</rss>

