Learn R Programming

irregulAR1 (version 1.0.0)

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

Description

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

Usage

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

Run this code
# NOT RUN {
n <- 10
rho <- 0.5
sigma <- 1
mu <- 1:10
ar1_sim_consecutive(n, rho, sigma)
ar1_sim_consecutive(n, rho, sigma, mu)
# }

Run the code above in your browser using DataLab