# NOT RUN {
library(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))
# }
# NOT RUN {
## order w/o limit
system.time(val <- ARp(margdist = dist,
margarg = distarg,
acsvalue = acsvalue,
actfpara = fit,
n = 5000,
p = order,
p0 = p0))
# }
# NOT RUN {
## see the result
ggplot() +
geom_col(aes(x = seq_along(val),
y = val)) +
labs(x = '',
y = 'value') +
theme_classic()
# }
Run the code above in your browser using DataLab