Skip to contents

model= y_t = a + bt + z_t where z_t = rho z_t-1 + e_t (e_t ~ N(0,sigma^2)) Uses unconditional mean and variance to simulate first data point

Usage

simulate_ar1(alpha, beta = 0, sigma, rho, n, missingValues = NULL)

Arguments

alpha

Numeric scalar. Intercept

beta

Numeric scalar. Slope

sigma

Numeric scalar. Standard deviation of error term

rho

Numeric scalar. Auto regressive parameter

n

Numeric scalar. Length of time series

missingValues

Numeric vector. Indices of y values for which there is missing data