AR1: Autoregressive model of order 1

View source: R/ar-models.R

AR1R Documentation

Autoregressive model of order 1

Description

Generates a Gaussian time series from a first-order autoregressive (AR(1)) model with specified lag-1 autocorrelation, mean, and standard deviation.

Usage

AR1(n, alpha, mean = 0, sd = 1)

Arguments

n

Positive integer. Number of values to generate.

alpha

Numeric in (-1, 1). Lag-1 autocorrelation coefficient.

mean

Numeric. Process mean. Default 0.

sd

Positive numeric. Process standard deviation. Default 1.

Value

A numeric vector of length n.


CoSMoS documentation built on May 8, 2026, 1:08 a.m.