Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: st: creating AR(1) correlation matrix


From   "Lachenbruch, Peter" <Peter.Lachenbruch@oregonstate.edu>
To   "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu>
Subject   RE: st: creating AR(1) correlation matrix
Date   Thu, 16 May 2013 16:00:12 +0000

I'll try it.  I don't use mata much so it didn't occur to me.

Peter A. Lachenbruch,
Professor (retired)
________________________________________
From: owner-statalist@hsphsun2.harvard.edu [owner-statalist@hsphsun2.harvard.edu] on behalf of Federico Belotti [f.belotti@gmail.com]
Sent: Thursday, May 16, 2013 8:16 AM
To: statalist@hsphsun2.harvard.edu
Subject: Re: st: creating AR(1) correlation matrix

Did you mean something like this?

mata
Dim = 10
Lambda = I(Dim)
Lambda =  0.9:^abs(J(1,Dim,(1::Dim))-J(Dim,1,(1..Dim)))
Lambda
end

Federico

On May 16, 2013, at 4:56 PM, Lachenbruch, Peter wrote:

> I need to create a correlatoin matrix of rho^(i-j) where i and j are row and column indexes.  Is there a simple command in Stata that will do htis?  I can do it in a foreach loop (although i've been messing it up so far).  This is for a simulation and the dimension of the correlation is 50 or 100 so i don't want to do it manually.
>
>
> Peter A. Lachenbruch,
> Professor (retired)
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/faqs/resources/statalist-faq/
> *   http://www.ats.ucla.edu/stat/stata/

--
Federico Belotti, PhD
Research Fellow
Centre for Economics and International Studies
University of Rome Tor Vergata
tel/fax: +39 06 7259 5627
e-mail: federico.belotti@uniroma2.it
web: http://www.econometrics.it


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index