buildClass-method: Build Extended S4 Class

Description Usage Arguments Examples

Description

buildClass extends the class RS to SM.dlm and SM.HL by adding the additional informations.

Usage

1
2
3
4
5
buildClass(object, method, freq, ind, lagMax, verify, parallel)

## S4 method for signature 'RS,character'
buildClass(object, method, freq, ind, lagMax,
  verify, parallel)

Arguments

object

An object of RS class.

method

An character value indicating the method to apply. Available method in this package are:

  • dlm: build a SM.dlm class;

  • hl: build a SM.HL class.

freq

Object with type ANY.

  • dlm method: a positive intervalue indicating the seasonality of the time series' structure;

  • hl method: a NULL value, it is not necessary for SM.HL class.

ind

R object with type ANY.

  • dlm method: a list containing outliers or human intervention indexes;

  • hl method: a numeric value indicating the offset value.

lagMax

R object with type ANY. For dlm method, lagMax is an integer value indicating the maximum effect lag for each outlier. Check section Details in SM.dlm for more information.

verify

R object with type ANY. For dlm method, verify is a logical value indicating whether the validation process should be applied. Check section Details in SM.dlm for more information.

parallel

R object with type ANY. For dlm method, verify is a logical value indicating whether the parallel process should be applied.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
n <- 50
# An example to create the RS class.
my_first_class <- RS(sigb = rnorm(n, mean = 0, sd = 1),
                     epsb = rnorm(n, mean = 0, sd = 2),
                     epsp = rnorm(n, mean = 1, sd = 1))

# build class
## build dlm model
dlm_class <- buildClass(object = my_first_class,
                        method = "dlm", freq = 1,
                        ind = list(), lagMax = 3,
                        verify = TRUE, parallel = TRUE)
## build HL model
hl_class <- buildClass(object = my_first_class,
                       method = "HL", ind = 9.5)
### ind in this case is offset

4301350/sm4sd documentation built on June 14, 2020, 4:22 p.m.