gen t = _n
).rnormal
function (e.g., gen e = rnormal(0,1)
for standard normal distribution).L.e
for lag of e) after setting the time series (e.g., tsset t
).gen y = e + 0.6*L.e
for an MA(1) process).gen e1 = rnormal(0,1)
gen y1 = .
replace y1 = e1[1]
(first value)forvalues i = 2/200 {
replace y1[``i''] = 0.3*y1[``i''-1] + e1[``i'']
}
tsline
to visualize and Augmented Dickey-Fuller test for stationarity.corrgram gdpgr
.arima
command:arima gdpgr, ar(1) ma(1)
(ARMA(1,1))estimates save
.estimates use
and predict
commands.