Learn R Programming

tfarima (version 0.4.1)

fit.ucarima: Estimation of UCARIMA models

Description

Estimates the parameters of a UCARIMA model using maximum likelihood.

Usage

# S3 method for ucarima
fit(mdl, z = NULL, method = "BFGS", show.iter = FALSE, envir = NULL, ...)

Value

An updated ucarima object with estimated parameters, log-likelihood, and convergence information.

Arguments

mdl

An object of class ucarima.

z

Optional. A time series object (ts) used for estimation if not already included in mdl.

method

Character string specifying the optimization method passed to optim. Default is "BFGS".

show.iter

Logical. If TRUE, displays parameter estimates during each iteration of the optimization process. Default is FALSE.

envir

Environment where the estimation is evaluated. If NULL (default), uses the parent environment.

...

Additional arguments passed to optim.

Examples

Run this code
# Define a local level model with trend and irregular components
trend <- um(i = 1, sig2 = c(s2t = 0.5))
irreg <- um(sig2 = c(s2i = 1))

# Create and estimate the UCARIMA model
uca <- ucarima(ucm = list(trend = trend, irreg = irreg))
uca_fitted <- fit(uca, Nile)

Run the code above in your browser using DataLab