<?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 Re: multivariate GARCH model using SAS IML in SAS/IML Software and Matrix Computations</title>
    <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/multivariate-GARCH-model-using-SAS-IML/m-p/191303#M1966</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do you mean "evaluate the Hessian at the optimal solution and print it out"? If so, then just pass the optimal solution to a function that evaluates the Hessian. If the Hessian is too complex to program (or there is not analytical expression for it), then you can use the NLPFDD subroutine to compute finite difference derivatives (FDDs).&amp;nbsp; For example, in the MLE blog post that you reference, I could evaluate the objective function, gradient, and Hessian matrix at the optimal solution by using the followiong statement:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;call nlpfdd(f,gradient,hessian,"LogLik",result);&lt;/P&gt;&lt;P&gt;print f,gradient, hessian;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 22 Jan 2015 15:18:29 GMT</pubDate>
    <dc:creator>Rick_SAS</dc:creator>
    <dc:date>2015-01-22T15:18:29Z</dc:date>
    <item>
      <title>multivariate GARCH model using SAS IML</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/multivariate-GARCH-model-using-SAS-IML/m-p/191300#M1963</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to estimate a multivariate garch model and I want to use sas iml becuase the proc varmax only provide one simple BEKK model. . I have read the article &lt;A href="http://blogs.sas.com/content/iml/2011/10/12/maximum-likelihood-estimation-in-sasiml/" title="http://blogs.sas.com/content/iml/2011/10/12/maximum-likelihood-estimation-in-sasiml/"&gt;Maximum likelihood estimation in SAS/IML - The DO Loop &lt;/A&gt;&amp;nbsp; But the likelihood function of a multivariate garch model contain lag of matrix. Could any one give me a hint? Thank you in advance. The specification of&amp;nbsp; a multivariate GARCH could be found in sas ets manual.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Jan 2015 20:36:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/multivariate-GARCH-model-using-SAS-IML/m-p/191300#M1963</guid>
      <dc:creator>Hanyu</dc:creator>
      <dc:date>2015-01-20T20:36:06Z</dc:date>
    </item>
    <item>
      <title>Re: multivariate GARCH model using SAS IML</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/multivariate-GARCH-model-using-SAS-IML/m-p/191301#M1964</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The SAS/IML language supports the LAG and DIF function, which you might find useful.&lt;/P&gt;&lt;P&gt;Here's an article that demonstrates the LAG function: &lt;A href="http://blogs.sas.com/content/iml/2012/04/30/the-lag-function/" title="http://blogs.sas.com/content/iml/2012/04/30/the-lag-function/"&gt;http://blogs.sas.com/content/iml/2012/04/30/the-lag-function/&lt;/A&gt; &lt;/P&gt;&lt;P&gt;You might also want to read this article about vectorizing time series computations: &lt;A href="http://blogs.sas.com/content/iml/2014/01/13/how-to-vectorize-time-series-computations/" title="http://blogs.sas.com/content/iml/2014/01/13/how-to-vectorize-time-series-computations/"&gt;http://blogs.sas.com/content/iml/2014/01/13/how-to-vectorize-time-series-computations/&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want help with your code, supply statements that compute the likelihood function in PROC IML. Even if you aren't sure of every step, having a template to work from will be useful for those who want to help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Jan 2015 11:38:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/multivariate-GARCH-model-using-SAS-IML/m-p/191301#M1964</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2015-01-21T11:38:51Z</dc:date>
    </item>
    <item>
      <title>Re: multivariate GARCH model using SAS IML</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/multivariate-GARCH-model-using-SAS-IML/m-p/191302#M1965</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Dr Wicklin. Can you tell me how to output the Hessian matrix from the subroutine NLPRNA?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Jan 2015 10:43:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/multivariate-GARCH-model-using-SAS-IML/m-p/191302#M1965</guid>
      <dc:creator>Hanyu</dc:creator>
      <dc:date>2015-01-22T10:43:33Z</dc:date>
    </item>
    <item>
      <title>Re: multivariate GARCH model using SAS IML</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/multivariate-GARCH-model-using-SAS-IML/m-p/191303#M1966</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do you mean "evaluate the Hessian at the optimal solution and print it out"? If so, then just pass the optimal solution to a function that evaluates the Hessian. If the Hessian is too complex to program (or there is not analytical expression for it), then you can use the NLPFDD subroutine to compute finite difference derivatives (FDDs).&amp;nbsp; For example, in the MLE blog post that you reference, I could evaluate the objective function, gradient, and Hessian matrix at the optimal solution by using the followiong statement:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;call nlpfdd(f,gradient,hessian,"LogLik",result);&lt;/P&gt;&lt;P&gt;print f,gradient, hessian;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Jan 2015 15:18:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/multivariate-GARCH-model-using-SAS-IML/m-p/191303#M1966</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2015-01-22T15:18:29Z</dc:date>
    </item>
    <item>
      <title>Re: multivariate GARCH model using SAS IML</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/multivariate-GARCH-model-using-SAS-IML/m-p/191304#M1967</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you provide a driver program that calls LogLik and that defines eps as a small matrix, maybe 4 rows and 3 columns? (T and N small)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Jan 2015 16:32:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/multivariate-GARCH-model-using-SAS-IML/m-p/191304#M1967</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2015-01-22T16:32:40Z</dc:date>
    </item>
    <item>
      <title>Re: multivariate GARCH model using SAS IML</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/multivariate-GARCH-model-using-SAS-IML/m-p/191305#M1968</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;2764&lt;/P&gt;&lt;P&gt;2765&amp;nbsp; proc iml;&lt;/P&gt;&lt;P&gt;NOTE: IML Ready&lt;/P&gt;&lt;P&gt;2766&amp;nbsp; use intra_garch_norm;&lt;/P&gt;&lt;P&gt;2767&amp;nbsp; read all var{at be fr de it nl es}&amp;nbsp; into eps [colname=country];&lt;/P&gt;&lt;P&gt;2768&amp;nbsp; close intra_garch_norm;&lt;/P&gt;&lt;P&gt;2769&lt;/P&gt;&lt;P&gt;2770&amp;nbsp; con={0 0,&lt;/P&gt;&lt;P&gt;2771&amp;nbsp; 1 1};&lt;/P&gt;&lt;P&gt;2772&amp;nbsp; opt={1 4};&lt;/P&gt;&lt;P&gt;2773&amp;nbsp; p={0.4 0.4};&lt;/P&gt;&lt;P&gt;2774&amp;nbsp; tc=1000;&lt;/P&gt;&lt;P&gt;2775&amp;nbsp; load module=Loglik_org;&lt;/P&gt;&lt;P&gt;NOTE: Opening storage library WORK.IMLSTOR&lt;/P&gt;&lt;P&gt;2776&amp;nbsp; call nlpnra(rc,result,"Loglik_org",p,opt,con);&lt;/P&gt;&lt;P&gt;ERROR: (execution) Matrix should be positive definite.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; operation : ROOT at offset&amp;nbsp; 30 column&amp;nbsp;&amp;nbsp; 7&lt;/P&gt;&lt;P&gt; operands&amp;nbsp; : _TEM1002&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;_TEM1002&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 7 rows&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 7 cols&amp;nbsp;&amp;nbsp;&amp;nbsp; (numeric)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1 0.0429409 0.0924234 -0.516006 0.3325295 -0.254749 0.2209257&lt;/P&gt;&lt;P&gt; 0.0429409&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1 0.0785693 -0.595686 0.3531359 -0.271494 0.3314657&lt;/P&gt;&lt;P&gt; 0.0924234 0.0785693&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp; -0.71971 0.5530654 -0.340426 0.4299508&lt;/P&gt;&lt;P&gt; -0.516006 -0.595686&amp;nbsp; -0.71971&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1 -0.670053 0.4233309 -0.556491&lt;/P&gt;&lt;P&gt; 0.3325295 0.3531359 0.5530654 -0.670053&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp; -0.24287 0.6664104&lt;/P&gt;&lt;P&gt; -0.254749 -0.271494 -0.340426 0.4233309&amp;nbsp; -0.24287&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1 -0.126188&lt;/P&gt;&lt;P&gt; 0.2209257 0.3314657 0.4299508 -0.556491 0.6664104 -0.126188&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; statement : ASSIGN at offset&amp;nbsp; 30 column&amp;nbsp;&amp;nbsp; 1&lt;/P&gt;&lt;P&gt; traceback : module LOGLIK_ORG at offset&amp;nbsp; 30 column&amp;nbsp;&amp;nbsp; 1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NOTE: PROCEDURE IML used (Total process time):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; real time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 6:34.24&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cpu time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 6:30.61&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hi Dr. Ricklin, I got this error from sas. Does this mean that the second parameter is the reason that the matrix is not positive definite.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Jan 2015 15:47:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/multivariate-GARCH-model-using-SAS-IML/m-p/191305#M1968</guid>
      <dc:creator>Hanyu</dc:creator>
      <dc:date>2015-01-29T15:47:27Z</dc:date>
    </item>
    <item>
      <title>Re: multivariate GARCH model using SAS IML</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/multivariate-GARCH-model-using-SAS-IML/m-p/191306#M1969</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The error message says that in your module called LOGLIK_ORG you are calling the ROOT function.&amp;nbsp; At some point in the optimization, the matrix that you are attempting to decompose is not positive definite. Therefore the ROOT function is gving an error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you copy/paste that matrix into a matrix called X, then you can see that the matrix is not positive definite:&lt;/P&gt;&lt;P&gt;v = eigval(X);&lt;/P&gt;&lt;P&gt;print v;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* one eigenvalue is negative */&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Jan 2015 16:01:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/multivariate-GARCH-model-using-SAS-IML/m-p/191306#M1969</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2015-01-29T16:01:53Z</dc:date>
    </item>
    <item>
      <title>Re: multivariate GARCH model using SAS IML</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/multivariate-GARCH-model-using-SAS-IML/m-p/191307#M1970</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;proc iml;&lt;/P&gt;&lt;P&gt;start Loglik_org(parm) global(eps,R_bar,T,N,Q,R,D,h,y,s);&lt;/P&gt;&lt;P&gt;a=parm[1];b=parm[2];&lt;/P&gt;&lt;P&gt;T=nrow(eps);&lt;/P&gt;&lt;P&gt;N=ncol(eps);&lt;/P&gt;&lt;P&gt;R_bar=1/T#eps`*eps;&lt;/P&gt;&lt;P&gt;Q=J(N*T,N);&lt;/P&gt;&lt;P&gt;R=J(N*T,N);&lt;/P&gt;&lt;P&gt;D=J(N*T,N);&lt;/P&gt;&lt;P&gt;h=J(T,1);&lt;/P&gt;&lt;P&gt;y=J(T,1);&lt;/P&gt;&lt;P&gt;s=J(T,1);&lt;/P&gt;&lt;P&gt;Q[1:N,]=R_bar;&lt;/P&gt;&lt;P&gt;D[1:N,]=sqrt(inv(diag(Q[1:N,])));&lt;/P&gt;&lt;P&gt;R[1:N,]=D[1:N,]*Q[1:N,]*D[1:N,];&lt;/P&gt;&lt;P&gt;G=root(R[1:N,]);&lt;/P&gt;&lt;P&gt;det=2*sum(log(vecdiag(G)));&lt;/P&gt;&lt;P&gt;square=eps[1,]*eps[1,]`;&lt;/P&gt;&lt;P&gt;h[1]=det;&lt;/P&gt;&lt;P&gt;y[1]=eps[1,]*inv(R[1:N,])*eps[1,]`;&lt;/P&gt;&lt;P&gt;s[1]=square;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;do i=2 to T;&lt;/P&gt;&lt;P&gt;w=N*(i-1)+1;&lt;/P&gt;&lt;P&gt;u=N*(i-2)+1;&lt;/P&gt;&lt;P&gt;m=N*i;&lt;/P&gt;&lt;P&gt;v=N*(i-1);&lt;/P&gt;&lt;P&gt;Q[w:m,]=R_bar*(1-a-b)+a*eps[i-1,]`*eps[i-1,]+b*Q[u:v,];&lt;/P&gt;&lt;P&gt;D[w:m,]=sqrt(inv(diag(Q[w:m,])));&lt;/P&gt;&lt;P&gt;R[w:m,]=D[w:m,]*Q[w:m,]*D[w:m,];&lt;/P&gt;&lt;P&gt;G=root(R[w:m,]);&lt;/P&gt;&lt;P&gt;det=2*sum(log(vecdiag(G)));&lt;/P&gt;&lt;P&gt;square=eps[i,]*eps[i,]`;&lt;/P&gt;&lt;P&gt;h&lt;I&gt;=det;&lt;/I&gt;&lt;/P&gt;&lt;P&gt;y&lt;I&gt;=eps[i,]*inv(R[w:m,])*eps[i,]`;&lt;/I&gt;&lt;/P&gt;&lt;P&gt;s&lt;I&gt;=square;&lt;/I&gt;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;f=-0.5*sum(h+y-s);&lt;/P&gt;&lt;P&gt;return(f);&lt;/P&gt;&lt;P&gt;finish;&lt;/P&gt;&lt;P&gt;store module=Loglik_org;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;according to this formulation, the matrix R[w:m,]&amp;nbsp; which is one block of matrix R, is no way to be negative definite. I do not understand how this is&amp;nbsp; possible. You see in the definition, the block of&amp;nbsp; R evolves as a weighted average of a positive definite matrix eps[i-1,]`*eps[i-1,] and a semi-definite matrix Q[w:m,] which is initialized by R_bar. R_bar is simply the sample covariance &lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;matrix of eps. &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Jan 2015 18:02:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/multivariate-GARCH-model-using-SAS-IML/m-p/191307#M1970</guid>
      <dc:creator>Hanyu</dc:creator>
      <dc:date>2015-01-29T18:02:49Z</dc:date>
    </item>
    <item>
      <title>Re: multivariate GARCH model using SAS IML</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/multivariate-GARCH-model-using-SAS-IML/m-p/191308#M1971</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I try to locate this negative definite matrix in the matrix R using loc function. I cannot find any matrix has these values. I cannot understand how is this possible. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Jan 2015 22:11:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/multivariate-GARCH-model-using-SAS-IML/m-p/191308#M1971</guid>
      <dc:creator>Hanyu</dc:creator>
      <dc:date>2015-01-29T22:11:08Z</dc:date>
    </item>
  </channel>
</rss>

