Learn R Programming

tfarima (version 0.4.1)

fit.tfm: Fit a Transfer Function Model

Description

Estimates the parameters of a transfer function model of class tfm by (conditional or exact) maximum likelihood.

Usage

# S3 method for tfm
fit(
  mdl,
  y = NULL,
  method = c("exact", "cond"),
  optim.method = "BFGS",
  show.iter = FALSE,
  fit.noise = TRUE,
  envir = NULL,
  ...
)

Value

An updated object of class tfm containing fitted parameters, estimated innovation variance, and optimization details.

Arguments

mdl

An object of class tfm created with tfm.

y

Optional ts object containing the output series. If NULL, the output stored in noise is used.

method

Character string specifying likelihood method: "exact" for exact maximum likelihood or "cond" for conditional maximum likelihood. Default is "exact".

optim.method

Character. Optimization method passed to optim. Default is "BFGS". Other options: "Nelder-Mead", "CG", "L-BFGS-B".

show.iter

Logical. If TRUE, prints iteration progress of the likelihood optimization.

fit.noise

Logical. If TRUE (default), the parameters of the noise model are estimated. If FALSE, noise parameters are fixed at their current values.

envir

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

...

Additional arguments.

See Also

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), fit = FALSE)
tfmy_fit <- fit(tfmy)
}

Run the code above in your browser using DataLab