sim.ces(seasonality=c("none","simple","partial","full"),
frequency=1, A=NULL, B=NULL,
initial=NULL,
obs=10, nsim=1,
randomizer=c("rnorm","runif","rbeta","rt"),
iprob=1, ...)
none
- No seasonality; simple
- Simple seasonality, using lagged CES (based on t-m
observation, where m
is the seasonality lag); partial
- Partial seasonality with real seasonal components (equivalent to additive seasonality); full
- Full seasonality with complex seasonal components (can do both multiplicative and additive seasonality, depending on the data). First letter can be used instead of full words.
Any seasonal CES can only be constructed for time series vectors.
NOTE! CES is very sensitive to A and B values so it is advised to use values from previously estimated model.
seasonality="partial"
. In case of seasonality="full"
must be complex number.
seasonality="partial"
and seasonality="full"
first two columns should contain initial values for non-seasonal components, repeated frequency
times.
rnorm
, rt
, runif
, rbeta
. But any function from Distributions will do the trick if the appropriate parameters are passed. For example rpois
with lambda=2
can be used as well.
sd=0.5
to rnorm
function will lead to the call rnorm(obs, mean=0.5, sd=1)
.
nsim>1
, then this is a vector.seasonality="n"
or seasonality="s"
, then this is equal to NULL. If nsim>1
, then this is a vector.nsim>1
, then this is an array.nsim>1
) of the generated series.nsim>1
) of states. States are in columns, time is in rows.nsim
.sim.es, sim.ssarima, ces, Distributions
# Create 120 observations from CES(n). Generate 100 time series of this kind.
x <- sim.ces("n",obs=120,nsim=100)
# Generate similar thing for seasonal series of CES(s)_4
x <- sim.ces("s",frequency=4,obs=80,nsim=100)
# Estimate model and then generate 10 time series from it
ourModel <- ces(rnorm(100,100,5))
simulate(ourModel,nsim=10)
Run the code above in your browser using DataLab