Learn R Programming

MultiATSM (version 1.4.0)

Optimization: Perform the optimization of the log-likelihood function of the chosen ATSM

Description

Perform the optimization of the log-likelihood function of the chosen ATSM

Usage

Optimization(
  MLEinputs,
  StatQ,
  DataFreq,
  FactorLabels,
  Economies,
  ModelType,
  tol = 1e-04,
  TimeCount = TRUE,
  BS_outputs = FALSE,
  verbose = TRUE
)

Value

An object of class 'ATSMModelOutputs' containing model outputs after the optimization of the chosen ATSM specification.

Arguments

MLEinputs

A list containing the necessary inputs for building the log-likelihood function (see InputsForOpt function).

StatQ

A binary variable (1 or 0) indicating whether to impose that the largest eigenvalue under Q is strictly smaller than 1. Set to 1 to impose the restriction, or 0 otherwise.

DataFreq

A character vector specifying the data frequency. Available options: "Daily All Days", "Daily Business Days", "Weekly", "Monthly", "Quarterly", "Annually".

FactorLabels

A list of character vectors with labels for all variables in the model.

Economies

A character vector containing the names of the economies included in the system.

ModelType

A character vector indicating the model type to be estimated.

tol

Convergence tolerance (scalar). The default is 1e-4.

TimeCount

Logical. If TRUE, computes the time required for model estimation. Default is TRUE.

BS_outputs

Logical. If TRUE, generates a simplified output list in the bootstrap setting. Default is FALSE.

verbose

Logical flag controlling function messaging. Default is TRUE.

Available Methods

- `summary(object)`

References

This function is partially adapted from the LS__opt function by Le and Singleton (2018).
"A Small Package of Matlab Routines for the Estimation of Some Term Structure Models."
(Euro Area Business Cycle Network Training School - Term Structure Modelling). Available at: https://cepr.org/40029

Examples

Run this code
LoadData("CM_2024")
ModelType <- "JPS original"
Economy <- "Brazil"
t0 <- "01-05-2007" # Initial Sample Date (Format: "dd-mm-yyyy")
tF <- "01-12-2018" # Final Sample Date (Format: "dd-mm-yyyy")
N <- 1
GlobalVar <- "Gl_Eco_Act" # Global Variables
DomVar <- "Eco_Act" # Domestic Variables
DataFreq <- "Monthly"
StatQ <- 0

FacLab <- LabFac(N, DomVar, GlobalVar, Economy, ModelType)
ATSMInputs <- InputsForOpt(t0, tF, ModelType, Yields, GlobalMacroVar, DomesticMacroVar,
                           FacLab, Economy, DataFreq, CheckInputs = FALSE)

OptPara <- Optimization(ATSMInputs, StatQ, DataFreq, FacLab, Economy, ModelType)

Run the code above in your browser using DataLab