sim.ces | R Documentation |
Function generates data using CES with Single Source of Error as a data generating process.
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, ...)
seasonality |
The type of seasonality used in CES. Can be: |
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
|
initial |
A matrix with initial values for CES. In case with
|
randomizer |
Type of random number generator function used for error
term. Defaults are: |
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 |
For the information about the function, see the vignette:
vignette("simulate","smooth")
List of the following values is returned:
model
- Name of CES model.
a
- Value of complex smoothing parameter a. If nsim>1
, then
this is a vector.
b
- Value of complex smoothing parameter b. If seasonality="n"
or seasonality="s"
, then this is equal to NULL. If nsim>1
,
then this is a vector.
initial
- Initial values of CES in a form of matrix. If nsim>1
,
then this is an array.
data
- Time series vector (or matrix if nsim>1
) of the generated
series.
states
- Matrix (or array if nsim>1
) of states. States are in
columns, time is in rows.
residuals
- Error terms used in the simulation. Either vector or matrix,
depending on nsim
.
occurrence
- Values of occurrence variable. Once again, can be either
a vector or a matrix...
logLik
- Log-likelihood of the constructed model.
Ivan Svetunkov, ivan@svetunkov.ru
Svetunkov, I., Kourentzes, N. (February 2015). Complex exponential smoothing. Working Paper of Department of Management Science, Lancaster University 2015:1, 1-31.
Svetunkov I., Kourentzes N. (2017) Complex Exponential Smoothing for Time Series Forecasting. Not yet published.
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.