# DHSimulate: Simulate General Linear Process In ltsa: Linear Time Series Analysis

## Description

Uses the Davies-Harte algorithm to simulate a Gaussian time series with specified autocovariance function.

## Usage

 1 DHSimulate(n, r, ReportTestOnly = FALSE, rand.gen = rnorm, ...)

## Arguments

 n length of time series to be generated r autocovariances at lags 0,1,... ReportTestOnly FALSE – Run normally so terminates with an error if Davies-Harte condition does not hold. Othewise if TRUE, then output is TRUE if the Davies-Harte condition holds and FALSE if it does not. rand.gen random number generator to use. It is assumed to have mean zero and variance one. ... optional arguments passed to rand.gen

## Details

The method uses the FFT and so is most efficient if the series length, n, is a power of 2. The method requires that a complicated non-negativity condition be satisfed. Craigmile (2003) discusses this condition in more detail and shows for anti-persistent time series this condition will always be satisfied. Sometimes, as in the case of fractinally differenced white noise with parameter d=0.45 and n=5000, this condition fails and the algorithm doesn't work. In this case, an error message is generated and the function halts.

## Value

Either a vector of length containing the simulated time series if Davies-Harte condition holds and ReportTestOnly = FALSE. If argument ReportTestOnly is set to TRUE, then output is logical variable indicating if Davies-Harte condition holds, TRUE, or if it does not, FALSE.

A.I. McLeod

## References

Craigmile, P.F. (2003). Simulating a class of stationary Gaussian processes using the Davies-Harte algorithm, with application to long memory processes. Journal of Time Series Analysis, 24, 505-511.

Davies, R. B. and Harte, D. S. (1987). Tests for Hurst Effect. Biometrika 74, 95–101.

McLeod, A.I., Yu, Hao, Krougly, Zinovi L. (2007). Algorithms for Linear Time Series Analysis, Journal of Statistical Software.