Learn R Programming

CoSMoS (version 2.2.0)

ARp: Autoregressive model of order p

Description

Generates a time series from an AR(\(p\)) model. The parent Gaussian process is constructed to match a target autocorrelation structure via the Yule-Walker equations, then transformed to a target marginal distribution and optional intermittency (probability of zeros).

Usage

ARp(margdist, margarg, acsvalue, actfpara, n, p = NULL, p0 = 0)

Value

A numeric vector of length n with the following attributes:

margdist

Target marginal distribution name.

margarg

Target marginal distribution parameters.

acsvalue

Original (untransformed) target ACS.

p0

Probability of zeros.

ar_coef

AR(\(p\)) coefficients (Yule-Walker solution).

noise_sd

Standard deviation of the Gaussian innovations.

gaussian

The underlying Gaussian process (length n).

transformed_acs

ACTF-transformed ACS used for the AR model.

Arguments

margdist

Character. Name of the target marginal distribution (e.g. "ggamma", "paretoII"). Must have a quantile function q<margdist> available.

margarg

Named list. Parameters of the marginal distribution passed to q<margdist>.

acsvalue

Numeric vector. Target autocorrelation structure starting from lag 0 (i.e. acsvalue[1] = 1).

actfpara

List returned by fitactf, containing the fitted ACTF coefficients in actfpara$actfcoef.

n

Positive integer. Length of the generated time series.

p

Positive integer or NULL. AR model order. When NULL (default), the order is chosen automatically as the number of lags where the transformed ACS exceeds 0.01, capped at 1000.

p0

Numeric in \([0, 1)\). Probability of zero values (intermittency). Default 0.

See Also

generateTS, actpnts, fitactf, acs