sim_parAcvf: Create a random periodic autocovariance function

View source: R/sim.R

sim_parAcvfR Documentation

Create a random periodic autocovariance function

Description

Select randomly a periodic autoregression model and return the periodic autocovariances associated with it.

Usage

sim_parAcvf(period, order, sigma2)

Arguments

period

the period, a positive integer.

order

the AR order, a vector of non-negative integers.

sigma2

the variances of the innovations, a numeric vector of length period (todo: or one?).

Details

Uses sim_parCoef() to generate a random PAR model.

Value

an object of class "matrix". In addition, the specification of the model is in attribute "model" which is a list with the following components:

ar

a matrix, the coefficients of the PAR model,

sigma2

numeric, the innovation variances,

order

the PAR order.

Author(s)

Georgi N. Boshnakov

References

\insertRef

boshnakov2009genpcts

Examples

sim_parAcvf(2, 5)
sim_parAcvf(3, 5)

res <- sim_parAcvf(2, 6)
res
slMatrix(res)[3, 4, type = "tt"]

res <- sim_parAcvf(2, 4)
attr(res, "model")
acv <- res[ , ] # drop attributes

acv[2, 1 + 0]
acv[2, 1 + 1]
slMatrix(acv)[2, 0]
slMatrix(acv)[2, 1]
slMatrix(acv)[3, 4, type = "tt"]
slMatrix(acv)[1:2, 1:2, type = "tt"]
slMatrix(acv)[1:4, 1:4, type = "tt"]

## TODO: need method for autocorrelation()
## pc.acrf(acv)

## TODO: these need changing, after the change of the return values of sim_parAcvf
## pc.fcoeffs(acv, 2)
## pc.fcoeffs(acv, 3)
## pc.fcoeffs(acv, 4)
pcts:::calc_predictionCoefficients(acv, c(2, 2))
pcts:::calc_predictionCoefficients(acv, c(3, 3))
pcts:::calc_predictionCoefficients(acv, c(4, 4))

GeoBosh/pcts documentation built on Dec. 8, 2023, 9:57 p.m.