is.TFPmodel {RGAP}R Documentation

TFPmodel object check

Description

Tests whether the input object is a valid object of class TFPmodel.

Usage

is.TFPmodel(object, return.logical = FALSE)

Arguments

object

An object to be tested.

return.logical

If return.logical = FALSE (default), an error message is printed if the object is not of class TFPmodel. If return.logical = TRUE, a logical value is returned.

Value

A logical value or nothing, depending on the value of return.logical.

Examples

# load data for Germany
data("gap")
data("indicator")
country <- "Germany"
tsList <- amecoData2input(gap[[country]], alpha = 0.65)

# compute cubs indicator
namesCubs <- c("indu", "serv", "buil")
namesVACubs <- paste0("va", namesCubs)
tscubs <- cubs(
  tsCU = gap[[country]][, namesCubs],
  tsVA = gap[[country]][, namesVACubs]
)
tsList <- c(tsList, tscubs)

# define tfp model
model <- TFPmodel(
  tsl = tsList, trend = "DT", cycle = "RAR2",
  cycleLag = 2, cubsErrorARMA = c(1, 0)
)
is.TFPmodel(model, return.logical = TRUE)
attr(model, "cubs")$cycleLag <- 1
is.TFPmodel(model, return.logical = TRUE)

[Package RGAP version 0.1.1 Index]