Learn R Programming

⚠️There's a newer version (1.3.1) of this package.Take me there.

MultiATSM (version 0.3.6)

Multicountry Term Structure of Interest Rates Models

Description

Estimation routines for several classes of affine term structure of interest rates models. All the models are based on the single-country unspanned macroeconomic risk framework from Joslin, Priebsch, and Singleton (2014, JF) . Multicountry extensions such as the ones of Jotikasthira, Le, and Lundblad (2015, JFE) , Candelon and Moura (2023, EM) , and Candelon and Moura (Forthcoming, JFEC) are also available.

Copy Link

Version

Install

install.packages('MultiATSM')

Monthly Downloads

324

Version

0.3.6

License

GPL-2 | GPL-3

Maintainer

Rubens Moura

Last Published

April 29th, 2024

Functions in MultiATSM (0.3.6)

DataForEstimation

Retrieve data from Excel and build the database used in the model estimation
BootstrapBoundsSet

Builds the confidence bounds and graphs (Bootstrap set)
FEVDgraphsSep

FEVDs graphs for ("sep Q" models)
FEVDjointOrthogoJLL

Orthogonalized FEVDs for JLL models
FEVDandGFEVDbs_sepQ

Creates the confidence bounds and the graphs of FEVDs and GFEVDs after bootstrap ("sep Q" models)
ForecastYields

Gather bond yields forecasts for all the model types
FEVDgraphsJoint

FEVDs graphs for ("joint Q" models)
FEVDandGFEVDbs_jointQ_Ortho

Creates the confidence bounds and the graphs of FEVDs and GFEVDs after bootstrap (JLL-based models)
FolderCreationPoint

Creates the folders and the path in which the graphical outputs are stored (ponit estimate version)
ForecastYieldsJointQ

Bond yields forecasts ("joint Q" models)
EstimationSigma_GVARrest

Estimate numerically the variance-covariance matrix from the GVAR-based models
FEVDgraphsJLLOrtho

FEVDs graphs for orthogonalized risk factors of JLL-based models
FitgraphsSep

Model fit graphs for ("sep Q" models)
FEVDjointOrthogoJLL_BS

FEVDs after bootstrap for JLL-based models
GFEVDjoint

GFEVDs for "joint Q" models
FitgraphsJoint

Model fit graphs for ("joint Q" models)
GFEVDjoint_BS

GFEVDs after bootstrap for "joint Q" models
GFEVDjointOrthoJLL_BS

GFEVDs after bootstrap for JLL-based models
FolderCreationBoot

Creates the folders and the path in which the graphical outputs are stored (Bootstrap version)
Functionf

Set up the vector-valued objective function (Point estimate)
ForecastYieldsSepQ

Bond yields forecasts ("sep Q" models)
FEVDjoint

FEVDs for "joint Q" models
GIRFjoint

GIRFs for "joint Q" models
FEVDsep_BS

FEVDs after bootstrap for "sep Q" models
GIRFgraphsSep

GIRFs graphs for ("sep Q" models)
FactorsGVAR

Data: Risk Factors for the GVAR - Candelon and Moura (forthcoming, JFEC)
FEVDjoint_BS

FEVDs after bootstrap for "joint Q" models
GIRFSep_BS

GIRFs after bootstrap for "sep Q" models
FEVDsep

FEVDs for "sep Q" models
GIRFSep

GIRFs for "sep Q" models
GaussianDensity

computes the density function of a gaussian process
FMN__Rotate

Performs state rotations
GIRFgraphsJLLOrtho

GIRFs graphs for orthogonalized risk factors of JLL-based models
FeedbackMatrixRestrictionsJLL

Set the zero-restrictions on the feedback matrix of JLL's P-dynamics
GFEVDgraphsJoint

GFEVDs graphs for "joint Q" models
GVARFactors

Data: Risk Factors for the GVAR - Candelon and Moura (2023)
GFEVDgraphsJLLOrtho

GFEVDs graphs for orthogonalized risk factors of JLL-based models
IRFandGIRFbs_sepQ

Creates the confidence bounds and the graphs of IRFs and GIRFs after bootstrap ("sep Q" models)
GFEVDjointOrthoJLL

Orthogonalized GFEVDs for JLL models
IRFgraphsJLLOrtho

IRFs graphs for orthogonalized risk factors of JLL-based models
Functionf_Boot

Set up the vector-valued objective function (Bootstrap)
GIRFgraphsJoint

GIRFs graphs for ("joint Q" models)
IRFjointOrthoJLL_BS

IRFs after bootstrap for JLL-based models
IRFjointOrthoJLL

Orthogonalized IRFs for JLL models
IRFjoint

IRFs for "joint Q" models
IdxAllSpanned

Find the indexes of the spanned factors
GFEVDsep

GFEVDs for "sep Q" models
ListModelInputs

Concatenate the model-specific inputs in a list
GFEVDgraphsSep

GFEVDs graphs for ("sep Q" models)
GIRFjointOrthoJLL

Orthogonalized GIRFs for JLL models
IdxSpanned

Extract the indexes related to the spanned factors in the variance-covariance matrix
MLEdensity_jointQ

Compute the maximum likelihood function ("joint Q" models)
Optimization_Boot

Peform the minimization of mean(f) (adapted for the bootstrap setting)
IRFjoint_BS

IRFs after bootstrap for "joint Q" models
OutputConstructionJoint

Numerical outputs (variance explained, model fit, IRFs, GIRFs, FEVDs, GFEVDs and risk premia decomposition) for "joint Q" models
InputsForOutputs

Collect the inputs that are used to construct the numerical and the graphical outputs
Spanned_Factors

Compute the country-specific spanned factors
IRFandGIRFbs_jointQ

Creates the confidence bounds and the graphs of IRFs and GIRFs after bootstrap ("joint Q" models)
GFEVDsep_BS

GFEVDs after bootstrap for "sep Q" models
IRFandGIRFbs_jointQ_Ortho

Creates the confidence bounds and the graphs of IRFs and GIRFs after bootstrap (JLL-based models)
SpannedFactorsjointQ

Gather all spanned factors ("joint Q" models)
StarFactors

Generates the star variables necessary for the GVAR estimation
RMSEsep

Compute the root mean square error ("sep Q" models)
Reg_K1Q

Estimate the risk-neutral feedbak matrix K1Q using linear regressions
TPDecompGraphJoint

Term Premia decomposition graphs for "joint Q" models
LabelsStar

Generate the labels of the star variables
LabelsSpanned

Generate the labels of the spanned factors
TermPremiaDecompSep

Decomposition of yields into the average of expected future short-term interest rate and risk premia for "joint Q" models
MLEdensity_sepQ

Compute the maximum likelihood function ("sep Q" models)
MLEdensity_jointQ_sepSigma

Compute the maximum likelihood function ("joint Q" models for separate Sigma estimation)
VAR

Estimates a VAR(1)
mult_logabsdet

Inverse each 2D slice of an array (M) with arbitrary dimensions support
Reg__OLSconstrained

Restricted OLS regression
RemoveNA

Exclude series that contain NAs
TradeFlows

Data: Trade Flows - Candelon and Moura (forthcoming, JFEC)
RiskFactorsGraphs

Spanned and unspanned factors plot
df__dx

Computes numerical first order derivative of f(x)
contain

Check whether one element is a subset of another element
mult_inv_small

Inverse the (m,m,T) array of matrices for m<=4
VarianceExplainedSep

Percentage explained by the spanned factors of the variations in the set of observed yields for "sep Q" models
GIRFjoint_BS

GIRFs after bootstrap for "joint Q" models
mult__inv

Inverts an array of matrices so that: inva[,,i] = inv(a[,,i])
VarianceExplainedJoint

Percentage explained by the spanned factors of the variations in the set of observed yields for "joint Q" models
m_var

Find mean or median of OLS when DGP is VAR(1)
JLL

Set of inputs present at JLL's P-dynamics
RiskFactors

Data: Risk Factors - Candelon and Moura (forthcoming, JFEC)
sqrtm_robust

Compute the square root of a matrix
GIRFjointOrthoJLL_BS

GIRFs after bootstrap for JLL-based models
GVAR

Estimate a GVAR(1) and a VARX(1,1,1)
x2pos

Transform x to a positive number by: y = log(e^x + 1)
llk_JLL_Sigma

Build the log-likelihood function of the P-dynamics from the JLL-based models
YieldsFitJoint

Computes two measures of model fit for bond yields
IRFgraphsJoint

IRFs graphs for ("joint Q" models)
Yields

Data: Yields - Candelon and Moura (forthcoming, JFEC)
YieldsFitsep

Computes two measures of model fit for bond yields
true2aux

Map constrained parameters b to unconstrained auxiliary parameters a.
logdet

computes the logarithm of determinant of a matrix A
Optimization

Peform the minimization of mean(f)
ParaLabels

Create the variable labels used in the estimation
RiskFactorsPrep

Builds the complete set of time series of the risk factors (spanned and unspanned)
LabFac

Generates the labels factors
K1XQStationary

Impose stationarity under the Q-measure
NumOutputs_Bootstrap

Numerical outputs (IRFs, GIRFs, FEVD, and GFEVD) for bootstrap
OutputConstructionSep_BS

Gathers all the model numerical ouputs after bootstrap for "sep Q" models
IRFgraphsSep

IRFs graphs for ("sep Q" models)
Transition_Matrix

Compute the transition matrix required in the estimation of the GVAR model
update_para

converts the vectorized auxiliary parameter vector x to the parameters that go directly into the likelihood function.
genVARbrw

Generate M data sets from VAR(1) model
Trade_Flows

Data: Trade Flows - Candelon and Moura (2023)
getpara

Extract the parameter values from varargin
SpannedFactorsSepQ

Gather all spanned factors ("sep Q" models)
IRFsep

IRFs for "sep Q" models
x2bound

Transform x to a number bounded btw lb and ub by:
GraphicalOutputs

Generate the graphical outputs for the selected models (Point estimate)
IDXZeroRestrictionsJLLVarCovOrtho

Find the indexes of zero-restrictions from the orthogonalized variance-covariance matrix from the JLL-based models
Maturities

Create a vector of numerical maturities in years
MultiATSM

ATSM Package
InputsForMLEdensity

Generates several inputs that are necessary to build the likelihood function
TermPremiaDecompJoint

Decomposition of yields into the average of expected future short-term interest rate and risk premia for "joint Q" models
OutputConstructionSep

Numerical outputs (variance explained, model fit, IRFs, GIRFs, FEVDs, GFEVDs, and risk premia decomposition) for "sep Q" models
IRFsep_BS

IRFs after bootstrap for "sep Q" models
OutputConstructionJoint_BS

Gathers all the model numerical ouputs after bootstrap for "joint Q" models
NumOutputs

Construct the model numerical outputs (model fit, IRFs, GIRFs, FEVDs, GFEVDs, and risk premia decomposition)
ModelPara

Replications of the JPS (2014) outputs by the MultiATSM package
f_with_vectorized_parameters

Use function f to generate the outputs from a ATSM
getx

Obtain the auxiliary values corresponding to each parameter, its size and its name
estVARbrw

Estimate a VAR(1) - suited to Bauer, Rudebusch and Wu (2012) methodology
TPDecompGraphSep

Term Premia decomposition graphs for "joint Q" models
YieldsFitAllSep

Fit yields for all maturities of interest
InputsForMLEdensity_BS

Generates several inputs that are necessary to build the likelihood function - Bootstrap version
PdynamicsSet_BS

Compute some key parameters from the P-dynamics (Bootstrap set)
YieldsFitAllJoint

Fit yields for all maturities of interest
RMSEjoint

Compute the root mean square error ("joint Q" models)
aux2true

Map auxiliary (unconstrained) parameters a to constrained parameters b
mult_inv_large

Inverse each 2D slice of an array (M) with arbitrary dimensions support
bound2x

Transform a number bounded between a lower bound and upper bound to x by:
mult__prod

Efficient computation of matrix product for arrays
pos2x

Transform a positive number y to back to x by:
shrink_Phi

Killan's VAR stationarity adjustment
killa

Eliminates the @
pca_weights_one_country

Weigth matrix from principal components (matrix of eigenvectors)
multiprod_2terms

computes matrix product for arrays a and b: c[,,i] = a[,,i] b[,,i]
A0N_MLEdensity_WOE__sepQ_Bootstrap

Compute the maximum likelihood function ("sep Q" models) - Bootstrap version
Bias_Correc_VAR

Estimate an unbiased VAR(1) using stochastic approximation (Bauer, Rudebusch and Wu, 2012)
A0N__computeBnAn_jointQ

Compute the cross-section loadings of yields of a canonical A0_N model ("joint Q" models)
A0N__computeBnAn_sepQ

Compute the cross-section loadings of yields of a canonical A0_N model ("sep Q" models)
BUnspannedAdapSep_BS

Obtain the full form of B unspanned for "sep Q" models within the bootstrap setting
BUnspannedAdapJoint

Transform B_spanned into B_unspanned for jointQ models
A0N_MLEdensity_WOE__jointQ_sepSigma_Bootstrap

Compute the maximum likelihood function ("joint Q" models for separate Sigma estimation) - Bootstrap version
BUnspannedAdapSep

Transform B_spanned into B_unspanned for sepQ models
A0N_MLEdensity_WOE__jointQ_Bootstrap

Compute the maximum likelihood function (joint Q models) - Bootstrap version
BR_jps_out

Replications of the JPS (2014) outputs by Bauer and Rudebusch (2017)
EstimationSigma_Ye

Estimate numerically the Cholesky-factorization from the JLL-based models
CholRestrictionsJLL

Impose the zero-restrictions on the Cholesky-factorization from JLL-based models.
DataSet_BS

Prepare the factor set for GVAR models (Bootstrap version)
Bootstrap

Generates the bootstrap-related outputs
DatabasePrep

Prepare the GVARFactors database
Convert2JordanForm

Convert a generic matrix to its Jordan form
FEVDandGFEVDbs_jointQ

Creates the confidence bounds and the graphs of FEVDs and GFEVDs after bootstrap ("joint Q" models)