ar1_sim_consecutive: Simulate from a stationary Gaussian AR(1) process.

Description Usage Arguments Value Examples

View source: R/simulation.R

Description

Simulate from a stationary Gaussian AR(1) process at n consecutive time points.

Usage

1
ar1_sim_consecutive(n, rho, sigma, mu = 0)

Arguments

n

The number of timepoints to simulate for.

rho

A real number strictly less than 1 in absolute value.

sigma

A positive real number.

mu

A vector of expected values with length n, or a scalar (default equal to 0).

Value

A vector of length n with the process values.

Examples

1
2
3
4
5
6
n <- 10
rho <- 0.5
sigma <- 1
mu <- 1:10
ar1_sim_consecutive(n, rho, sigma)
ar1_sim_consecutive(n, rho, sigma, mu)

irregulAR1 documentation built on May 2, 2019, 8:49 a.m.