Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: AR1


From   Giovanni Bruno <[email protected]>
To   [email protected]
Subject   Re: st: AR1
Date   Mon, 3 Oct 2005 14:35:25 +0200

If your problem is to generate simulated data from
AR(1) processes, there are already some resources 
in the web doing that:

1) Jeff Pitblado's (StataCorp) code -sim_arma- 
(-findit sim_arma-)

2) My code -xtarsim- downloadable
from the SSC archive via

ssc install xtarsim

3) My SUGUK05 presentation (where
some hints are provided on the 
generation of AR simulated data in Stata)

http://ideas.repec.org/p/boc/usug05/06.html

Giovanni



Scrive Dirk Nachbar <[email protected]>:

> Dear all
> 
> I am trying to simulate an AR(1) process but it proves to be hard in Stata.
> My 
> idea was to declare a matrix and then do it in a loop, but it doesn't work. 
> Maybe someone can help.
> 
> Dirk
> 
> ------------------
> clear
> set matsize 800
> set obs 700
> gen time=_n
> tsset time
> gen y=invnorm(uniform())
> mkmat y
> local i = 1
> while `i' < `obs' {
> 	matrix y[i+1,1]=1+0.5*y[i,1] +invnorm(uniform())
>       local i = `i' + 1
>       }
> svmat y
> arima y, arima(1,0,0) 
> ---------------------------------------------------
> 
> Dirk Nachbar
> Assistant Economist
> Pensim2
> Department for Work and Pensions
> Level 4, The Adelphi
> 1-11 John Adam St
> WC2N 6HT London
> 020 796 22705
> **********************************************************************
> This document is strictly confidential and is intended only for use by the
> addressee. 
> If you are not the intended recipient, any disclosure, copying, distribution
> or other 
> action taken in reliance of the information contained in this e-mail is
> strictly prohibited.
> Any views expressed by the sender of this message are not necessarily those
> of the Department 
> for Work and Pensions.
> If you have received this transmission in error, please use the reply
> function to tell us 
> and then permanently delete what you have received.
> Please note: Incoming and outgoing e-mail messages are routinely monitored
> for compliance 
> with our policy on the use of electronic communications.
> **********************************************************************
> 
> 
> 
> The original of this email was scanned for viruses by the Government Secure
> Intranet (GSi) virus scanning service supplied exclusively by Energis in
> partnership with MessageLabs.
> 
> On leaving the GSi this email was certified virus-free


-- 
Giovanni S.F. Bruno
http://ideas.repec.org/e/pbr136.html
Istituto di Economia Politica, Universit� Bocconi
Via U. Gobbi, 5, 20136 Milano
Italy
tel. + 02 5836 5411
fax. + 02 5836 5438
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index