sim.oes {smooth} | R Documentation |
Simulate Occurrence Part of ETS model
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
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: |
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 |
bounds |
Type of bounds to use for persistence vector if values are
generated. |
randomizer |
Type of random number generator function used for error
term. It is advised to use |
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 |
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 |
initialSeason |
Vector of initial states for seasonal coefficients.
Should have length equal to |
modelB |
Type of model B. This is used in |
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:
-
model
- Name of ETS model. -
modelA
- Model A, generated usingsim.es()
function; -
modelB
- Model B, generated usingsim.es()
function; -
probability
- The value of probability generated by the model; -
occurrence
- Type of occurrence used in the model; -
logLik
- Log-likelihood of the constructed model.
Author(s)
Ivan Svetunkov, ivan@svetunkov.ru
References
Snyder, R. D., 1985. Recursive Estimation of Dynamic Linear Models. Journal of the Royal Statistical Society, Series B (Methodological) 47 (2), 272-276.
Hyndman, R.J., Koehler, A.B., Ord, J.K., and Snyder, R.D. (2008) Forecasting with exponential smoothing: the state space approach, Springer-Verlag. doi:10.1007/978-3-540-71918-2.
See Also
Examples
# 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)