[R] how to simulate a time series

Rolf Turner rolf at math.unb.ca
Thu Mar 31 17:43:18 CEST 2005


Bogdan Romocea wrote:

> I want to simulate a time series (stationary; ... <snip> ...
> values is skewed to the right; quite a few ARMA absolute standardized

	<snip>
> 
> sim <- list(NULL)	#simulated
> for (i in 1:5) {
> 	sim[[i]] <- as.vector(arima.sim(list(ar=c(farma[["coef"]][1]),
> 		ma=c(farma[["coef"]][2])),n=length(rdtb),innov=rdtb))
> 	}
> 
> I don't understand why the simulation runs generate virtually
> identical values:

	<snip>

	They are identical because you are using the same
	innovations i.e. rdtb, over and over!!!

	If you want different results, you have to use
	different innovations.

	BTW it would seem to make more sense to use the
	***residuals*** from your fit to rdtb, rather than rdtb
	itself, as your innovations.  (But then you would
	be essentially reconstructing rdtb.)

	You probably want to ***fit*** some distribution to the
	residuals from rdtb, and then sample from that distribution
	to get your innovations.

			cheers,

				Rolf Turner
				rolf at math.unb.ca




More information about the R-help mailing list