sim.gum | R Documentation |
Function generates data using GUM with Single Source of Error as a data generating process.
sim.gum(orders = c(1), lags = c(1), obs = 10, nsim = 1,
frequency = 1, measurement = NULL, transition = NULL,
persistence = NULL, initial = NULL, randomizer = c("rnorm", "rt",
"rlaplace", "rs"), probability = 1, ...)
orders |
Order of the model. Specified as vector of number of states
with different lags. For example, |
lags |
Defines lags for the corresponding orders. If, for example,
|
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. |
measurement |
Measurement vector |
transition |
Transition matrix |
persistence |
Persistence vector |
initial |
Vector of initial values for state matrix. If |
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 GUM model.
measurement
- Matrix w.
transition
- Matrix F.
persistence
- Persistence vector. This is the place, where
smoothing parameters live.
initial
- Initial values of GUM 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. (2023) Smooth forecasting with the smooth package in R. arXiv:2301.01790. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.48550/arXiv.2301.01790")}.
Svetunkov I. (2015 - Inf) "smooth" package for R - series of posts about the underlying models and how to use them: https://openforecast.org/category/r-en/smooth/.
sim.es, sim.ssarima,
sim.ces, gum, Distributions
# Create 120 observations from GUM(1[1]). Generate 100 time series of this kind.
x <- sim.gum(orders=c(1),lags=c(1),obs=120,nsim=100)
# Generate similar thing for seasonal series of GUM(1[1],1[4]])
x <- sim.gum(orders=c(1,1),lags=c(1,4),frequency=4,obs=80,nsim=100,transition=c(1,0,0.9,0.9))
# Estimate model and then generate 10 time series from it
ourModel <- gum(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.