Thomas Petzoldt
2006-Mar-22 21:48 UTC
[R] generating multivariate autocorrelated time series
Hello expeRts, for an application in hydrology I need to generate multivariate (log)normally distributed time series with given auto- and cross-correlations. While this is simple for the univariate case (e.g. with conditional normal sampling) it seems to be not so trivial for multivariate time series (according to papers available about this topic). An example: I have several (e.g. 3) time series (which are, of course, *correlated* measurements in reality): z <- ts(matrix(rnorm(300), 100, 3), start=c(1961, 1), frequency=12) and I want to get the vector for the next time step(s): z[n+1, 1:3] respecting the autocorrelations from that matrix up to a given lag value: a <- acf(z, lag=2) My question: Does anybody know about a solution (function, package, example etc...) available in R? Thanks a lot! Thomas P. --- http://tu-dresden.de/Members/thomas.petzoldt
If you can specify an ARMA or state-space model for the vector process, then you can do this with simulate in the dse bundle. Paul Gilbert Thomas Petzoldt wrote:>Hello expeRts, > >for an application in hydrology I need to generate multivariate >(log)normally distributed time series with given auto- and >cross-correlations. While this is simple for the univariate case (e.g. >with conditional normal sampling) it seems to be not so trivial for >multivariate time series (according to papers available about this topic). > >An example: > >I have several (e.g. 3) time series (which are, of course, *correlated* >measurements in reality): > >z <- ts(matrix(rnorm(300), 100, 3), start=c(1961, 1), frequency=12) > >and I want to get the vector for the next time step(s): > >z[n+1, 1:3] > >respecting the autocorrelations from that matrix up to a given lag value: > >a <- acf(z, lag=2) > >My question: Does anybody know about a solution (function, package, >example etc...) available in R? > >Thanks a lot! > >Thomas P. > >--- >http://tu-dresden.de/Members/thomas.petzoldt > >______________________________________________ >R-help at stat.math.ethz.ch mailing list >https://stat.ethz.ch/mailman/listinfo/r-help >PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html > >