Autoregressive model of order p
Generates time series from an Autoregressive model of order p.
ARp(margdist, margarg, acsvalue, actfpara, n, p = NULL, p0 = 0)
margdist: target marginal distributionmargarg: list of marginal distribution argumentsacsvalue: target auto-correlation structure (from lag 0)actfpara: auto-correlation structure transformation parametersn: number of valuesp: integer - model order (if NULL - limits maximum model order according to auto-correlation structure values)p0: probability zerolibrary(CoSMoS) ## choose the marginal distribution as Pareto type II with corresponding parameters dist <- 'paretoII' distarg <- list(scale = 1, shape = .3) p0 <- .5 ## estimate rho 'x' and 'z' points using ACTI pnts <- actpnts(margdist = dist, margarg = distarg, p0 = p0) ## fit ACTF fit <- fitactf(pnts) ## define target auto-correlation structure and model order order <- 1000 acsvalue <- acs(id = 'weibull', t = 0:order, scale = 10, shape = .75) ## limit ACS lag (recomended) system.time(val <- ARp(margdist = dist, margarg = distarg, acsvalue = acsvalue, actfpara = fit, n = 5000, p0 = p0)) ## order w/o limit system.time(val <- ARp(margdist = dist, margarg = distarg, acsvalue = acsvalue, actfpara = fit, n = 5000, p = order, p0 = p0)) ## see the result ggplot() + geom_col(aes(x = seq_along(val), y = val)) + labs(x = '', y = 'value') + theme_classic()
Related functions from the same R package