sim.oes: Simulate Occurrence Part of ETS model

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

View source: R/simoes.R

Description

Function generates data using ETS with Single Source of Error as a data generating process for the demand occurrence. As the main output it produces probabilities of occurrence.

Usage

1
2
3
4
5
6
7
sim.oes(model = "MNN", obs = 10, nsim = 1, frequency = 1,
  occurrence = c("odds-ratio", "inverse-odds-ratio", "direct", "general"),
  bounds = c("usual", "admissible", "restricted"), randomizer = c("rlnorm",
  "rinvgauss", "rgamma", "rnorm"), persistence = NULL, phi = 1,
  initial = NULL, initialSeason = NULL, modelB = model,
  persistenceB = persistence, phiB = phi, initialB = initial,
  initialSeasonB = initialSeason, ...)

Arguments

model

Type of ETS model according to [Hyndman et. al., 2008] taxonomy. Can consist of 3 or 4 chars: ANN, AAN, AAdN, AAA, AAdA, MAdM etc. The conventional oETS model assumes that the error term is positive, so "MZZ" models are recommended for this. If you use additive error models, then the function will exponentiate the obtained values before transforming them and getting the probability. This is the type of model A.

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.

occurrence

Type of occurrence model. See vignette("oes","smooth") for details.

bounds

Type of bounds to use for persistence vector if values are generated. "usual" - bounds from p.156 by Hyndman et. al., 2008. "restricted" - similar to "usual" but with upper bound equal to 0.3. "admissible" - bounds from tables 10.1 and 10.2 of Hyndman et. al., 2008. Using first letter of the type of bounds also works. These bounds are also used for multiplicative models, but the models are much more restrictive, so weird results might be obtained. Be careful!

randomizer

Type of random number generator function used for error term. It is advised to use rlnorm() or rinvgauss() in case of multiplicative error models. If a randomiser is used, it is advised to specify the parameters in the ellipsis.

persistence

Persistence vector, which includes all the smoothing parameters. Must correspond to the chosen model. The maximum length is 3: level, trend and seasonal smoothing parameters. If NULL, values are generated.

phi

Value of damping parameter. If trend is not chosen in the model, the parameter is ignored.

initial

Vector of initial states of level and trend. The maximum length is 2. If NULL, values are generated.

initialSeason

Vector of initial states for seasonal coefficients. Should have length equal to frequency parameter. If NULL, values are generated.

modelB

Type of model B. This is used in occurrence="general" and occurrence="inverse-odds-ratio".

persistenceB

The persistence vector for the model B.

phiB

Value of damping parameter for the model B.

initialB

Vector of initial states of level and trend for the model B.

initialSeasonB

Vector of initial states for seasonal coefficients for the model B.

...

Additional parameters passed to the chosen randomizer. All the parameters should be passed in the order they are used in chosen randomizer. Both model A and model B share the same parameters for the randomizer.

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

oes, sim.es, Distributions

Examples

1
2
3
4
5
6
7
# This example uses rinvgauss function from statmod package.
oETSMNNIG <- sim.oes(model="MNN",frequency=12,obs=60,
                               randomizer="rinvgauss",mean=1,dispersion=0.5)

# A simpler example with log normal distribution
oETSMNNlogN <- sim.oes(model="MNN",frequency=12,obs=60,initial=1,
                       randomizer="rlnorm",meanlog=0,sdlog=0.1)

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