Description Usage Arguments Value Author(s) See Also Examples

Generates a random realization of an AR(1) sequence

1 |

`n` |
Length of vector to produce |

`a0` |
Constant term in AR(1) sequence |

`a1` |
Coefficient of mean-reversion |

`trend` |
Linear trend |

`sd` |
Standard deviation of sequence of innovations |

`x0` |
Starting value of sequence |

If `trend=0`

, returns a vector of length `n`

representing
a simulation of an AR(1) process

*X[k] = a_0 + a_1 * X[k-1] + ε[t]*

where *ε[t]* is a sequence of independent and identically
distributed samples from a normal distribution with mean zero and
standard deviation `sd`

.

If `trend != 0`

, returns a vector of length `n`

representing
a simulation of a trend-stationary AR(1) process

*R[k] = a_0 + a_1 * R[k-1] + ε[t]*

*X[k] = k * trend + R[k]*

Matthew Clegg [email protected]

1 2 3 4 |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.