Learn R Programming

tfarima (version 0.4.1)

tfm: Transfer Function Model Constructor

Description

Creates and optionally fits a multiple-input transfer function model. A transfer function model relates an output time series to one or more input series (transfer functions), exogenous regressors, and a noise model.

Usage

tfm(
  output = NULL,
  xreg = NULL,
  inputs = NULL,
  noise,
  fit = TRUE,
  new.name = TRUE,
  envir = parent.frame(),
  ...
)

Value

Object of class tfm with components: output, xreg, inputs, noise, param, kx, k, optim, method, and call.

Arguments

output

A numeric vector or ts object representing the dependent (output) time series. If NULL, it is taken from noise$z.

xreg

A numeric matrix or ts object of exogenous regressors. Columns correspond to different regressors. Defaults to NULL.

inputs

A list of transfer function objects of class tf. Each element represents one stochastic input. Can also be a single tf object. Defaults to NULL.

noise

An object of class um describing the univariate noise model. This defines the ARIMA-type structure for the residuals.

fit

Logical. If TRUE (default), the model parameters are estimated by maximum likelihood after construction.

new.name

Logical. Internal use. If TRUE (default), a new name is assigned to the output series. Otherwise, the name stored in noise$z is preserved.

envir

Environment in which the function arguments are evaluated. If NULL, the calling environment is used.

...

Additional arguments passed to fit.tfm when fit = TRUE.

Details

All series must have the same frequency. Input series must span at least the same period as output. The function applies differencing and Box-Cox transformation as specified in noise.

References

Box, G. E., Jenkins, G. M., Reinsel, G. C., & Ljung, G. M. (2015). Time Series Analysis: Forecasting and Control (5th ed.). Wiley.

See Also

tf, um, fit.tfm

Examples

Run this code
if (FALSE) {
data(seriesJ)
Y <- seriesJ$Y - mean(seriesJ$Y)
X <- seriesJ$X - mean(seriesJ$X)
umx <- um(X, ar = 3)
umy <- fit(umx, Y)
tfx <- tfest(Y, X, delay = 3, p = 2, q = 2, um.x = umx, um.y = umy)
tfmy <- tfm(Y, inputs = tfx, noise = um(ar = 2))
}

Run the code above in your browser using DataLab