sim.ces: Simulate Complex Exponential Smoothing

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/simces.R

Description

Function generates data using CES with Single Source of Error as a data generating process.

Usage

1
2
3
sim.ces(seasonality = c("none", "simple", "partial", "full"), obs = 10,
  nsim = 1, frequency = 1, a = NULL, b = NULL, initial = NULL,
  randomizer = c("rnorm", "rt", "rlaplace", "rs"), probability = 1, ...)

Arguments

seasonality

The type of seasonality used in CES. Can be: 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.

obs

Number of observations in each generated time series.

nsim

Number of series to generate (number of simulations to do).

frequency

Frequency of generated data. In cases of seasonal models must be greater than 1.

a

First complex smoothing parameter. Should be a complex number.

NOTE! CES is very sensitive to a and b values so it is advised to use values from previously estimated model.

b

Second complex smoothing parameter. Can be real if seasonality="partial". In case of seasonality="full" must be complex number.

initial

A matrix with initial values for CES. In case with seasonality="partial" and seasonality="full" first two columns should contain initial values for non-seasonal components, repeated frequency times.

randomizer

Type of random number generator function used for error term. Defaults are: rnorm, rt, rlaplace and rs. rlnorm should be used for multiplicative models (e.g. ETS(M,N,N)). 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, but might result in weird values.

probability

Probability of occurrence, used for intermittent data generation. This can be a vector, implying that probability varies in time (in TSB or Croston style).

...

Additional parameters passed to the chosen randomizer. All the parameters should be passed in the order they are used in chosen randomizer. For example, passing just sd=0.5 to rnorm function will lead to the call rnorm(obs, mean=0.5, sd=1).

Details

For the information about the function, see the vignette: vignette("simulate","smooth")

Value

List of the following values is returned:

Author(s)

Ivan Svetunkov, ivan@svetunkov.ru

References

See Also

sim.es, sim.ssarima, ces, Distributions

Examples

1
2
3
4
5
6
7
8
9
# 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)

config-i1/smooth documentation built on June 16, 2021, 2:13 p.m.