Learn R Programming

tfarima (version 0.4.1)

tfest: Helper function to create a tf object

Description

tfest estimates the transfer function $$V(B) = w_0 * (theta(B)/phi(B)) * B^d$$ that relates the input X_t to the output Y_t.

Usage

tfest(
  y,
  x,
  delay = 0,
  p = 1,
  q = 2,
  um.y = NULL,
  um.x = NULL,
  n.back = NULL,
  par.prefix = "",
  envir = envir <- parent.frame()
)

Value

An object of class tf containing preestimated transfer function parameters.

Arguments

y

Output series, a ts object or numeric vector.

x

Input series, a ts object or numeric vector.

delay

Integer. Number of periods delay (default 0).

p

Integer. Order of the AR polynomial (default 1).

q

Integer. Order of the MA polynomial (default 2).

um.y

Univariate model for output series, um object or NULL.

um.x

Univariate model for input series, um object or NULL.

n.back

Integer. Number of backcasts to compute.

par.prefix

Character. Prefix for parameter names.

envir

Environment for evaluating arguments. If NULL, uses calling environment.

Details

Uses prewhitening to estimate initial parameter values.

Examples

Run this code
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)

Run the code above in your browser using DataLab