armaErr: 'armaErr' class generator using 'arima.sim'

armaErrR Documentation

armaErr class generator using arima.sim

Description

armaErr class generator using arima.sim

armaErr class generator using arima.sim

Super class

PersonAlyticsPower::err -> errARMA

Public fields

model

The parameters for FUN.

errVar

The error variance.

FUN

The function for simulating error terms.

fam

A gamlss.family family for the error term distribution. After data are simulated using FUN and its model, it can be transformed to have a distribution different from those available to FUN.

famParms

Parameters to be passed to fam, see gamlss.family.

Active bindings

model

The parameters for FUN.

errVar

The error variance.

FUN

The function for simulating error terms.

fam

A gamlss.family family for the error term distribution. After data are simulated using FUN and its model, it can be transformed to have a distribution different from those available to FUN.

famParms

Parameters to be passed to fam, see gamlss.family.

Methods

Public methods

Inherited methods

Method new()

Usage
armaErr$new(
  model = list(ar = c(0.5), ma = c(0)),
  fam = "NO",
  famParms = list(mu = 0, sigma = 1)
)

Method checkModel()

Usage
armaErr$checkModel(
  seed = 1234,
  n = 1000,
  doPlot = TRUE,
  doStats = TRUE,
  debug = FALSE
)

Method makeErrors()

Usage
armaErr$makeErrors(n, nObservations, seed = 123, debug = FALSE)

Method clone()

The objects of this class are cloneable with this method.

Usage
armaErr$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

Author(s)

Stephen Tueller stueller@rti.org

Examples


# set up a stationary arma model
testErr <- armaErr$new(model = list(ar=c(.5), ma=c(.2)))
testErr$checkModel()

# show testing for an unstationary ARMA model
testFail <- armaErr$new(model = list(ar=c(-.8, .5), ma=c(.2)))
testFail$checkModel()

# show that r* functions from gamlss.family distribution functions can be
# passed to arima.sim
errBeta <- arima.sim(list(ar=c(.5)), 1000, innov = rBE(1000, mu=.5, sigma=.2))

# note that the rand.gen option only allows the defaults for the function
# passed to rand.gen
#errBeta <- arima.sim(list(ar=c(.5)), 1000, rand.gen = rBE)
# that said, rand.gen's parameters can be passed via ...
#errBeta <- arima.sim(list(ar=c(.5)), 1000, rand.gen = rBE, mu=.9, sigma=.2)

# note that even though beta innovations are used, the resulting data is not
# constrained to be in (0,1)
hist(errBeta)
plot(errBeta)
auto.arima(ts(errBeta))

ICTatRTI/PersonAlyticsPower documentation built on Dec. 13, 2024, 11:08 p.m.