Package: MultiATSM 0.3.1

MultiATSM: Multicountry Term Structure of Interest Rates Models

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) <doi:10.1111/jofi.12131>. Multicountry extensions such as the ones of Jotikasthira, Le, and Lundblad (2015) <doi:10.1016/j.jfineco.2014.09.004> and Candelon and Moura (2021) <http://hdl.handle.net/2078.1/249985> are also available.

Authors:Rubens Moura

MultiATSM_0.3.1.tar.gz
MultiATSM_0.3.1.zip(r-4.5)MultiATSM_0.3.1.zip(r-4.4)MultiATSM_0.3.1.zip(r-4.3)
MultiATSM_0.3.1.tgz(r-4.4-any)MultiATSM_0.3.1.tgz(r-4.3-any)
MultiATSM_0.3.1.tar.gz(r-4.5-noble)MultiATSM_0.3.1.tar.gz(r-4.4-noble)
MultiATSM_0.3.1.tgz(r-4.4-emscripten)MultiATSM_0.3.1.tgz(r-4.3-emscripten)
MultiATSM.pdf |MultiATSM.html
MultiATSM/json (API)

# Install 'MultiATSM' in R:
install.packages('MultiATSM', repos = c('https://rubensmoura87.r-universe.dev', 'https://cloud.r-project.org'))

Peer review:

Bug tracker:https://github.com/rubensmoura87/multiatsm/issues

Datasets:
  • BR_jps_out - Replications of the JPS
  • FactorsGVAR - Data: Risk Factors for the GVAR - Candelon and Moura
  • ModelPara - Replications of the JPS (2014) outputs by the MultiATSM package
  • RiskFactors - Data: Risk Factors - Candelon and Moura
  • TradeFlows - Data: Trade Flows - Candelon and Moura
  • Yields - Data: Yields - Candelon and Moura

On CRAN:

23 exports 1 stars 0.82 score 39 dependencies 8 scripts 1.0k downloads

Last updated 2 years agofrom:b3d79dd545. Checks:ERROR: 7. Indexed: yes.

TargetResultDate
Doc / VignettesFAILSep 09 2024
R-4.5-winERRORSep 09 2024
R-4.5-linuxERRORSep 09 2024
R-4.4-winERRORSep 09 2024
R-4.4-macERRORSep 09 2024
R-4.3-winERRORSep 09 2024
R-4.3-macERRORSep 09 2024

Exports:Bias_Correc_VARBootstrapDatabasePrepDataForEstimationForecastYieldsFunctionfGVARInputsForMLEdensityInputsForOutputsJLLK1XQStationaryLabFacListModelInputsMaturitiesNumOutputsOptimizationParaLabelspca_weights_one_countryReg_K1QSpanned_FactorsStarFactorsTransition_MatrixVAR

Dependencies:clicolorspacecpp11dplyrfansifarvergenericsggplot2gluegtablehablarisobandlabelinglatticelifecyclelubridatemagrittrMASSMatrixmgcvmunsellnlmepillarpkgconfigpracmapurrrR6RColorBrewerrlangscalestibbletidyselecttimechangeutf8vctrsviridisLitewithrwraprzoo

Readme and manuals

Help Manual

Help pageTopics
Compute the cross-section loadings of yields of a canonical A0_N model ("joint Q" models)A0N__computeBnAn_jointQ
Compute the cross-section loadings of yields of a canonical A0_N model ("sep Q" models)A0N__computeBnAn_sepQ
Compute the maximum likelihood function (joint Q models) - Bootstrap versionA0N_MLEdensity_WOE__jointQ_Bootstrap
Compute the maximum likelihood function ("joint Q" models for separate Sigma estimation) - Bootstrap versionA0N_MLEdensity_WOE__jointQ_sepSigma_Bootstrap
Compute the maximum likelihood function ("sep Q" models) - Bootstrap versionA0N_MLEdensity_WOE__sepQ_Bootstrap
Map auxiliary (unconstrained) parameters a to constrained parameters baux2true
Estimate an unbiased VAR(1) using stochastic approximation (Bauer, Rudebusch and Wu, 2012)Bias_Correc_VAR
Generates the bootstrap-related outputsBootstrap
Builds the confidence bounds and graphs (Bootstrap set)BootstrapBoundsSet
Transform a number bounded between a lower bound and upper bound to x by:bound2x
Replications of the JPS (2014) outputs by Bauer and Rudebusch (2017)BR_jps_out
Transform B_spanned into B_unspanned for jointQ modelsBUnspannedAdapJoint
Transform B_spanned into B_unspanned for sepQ modelsBUnspannedAdapSep
Obtain the full form of B unspanned for "sep Q" models within the bootstrap settingBUnspannedAdapSep_BS
Check whether one element is a subset of another elementcontain
Prepare the GVARFactors databaseDatabasePrep
Retrieve data from Excel and build the database used in the model estimationDataForEstimation
Prepare the factor set for GVAR models (Bootstrap version)DataSet_BS
Computes numerical first order derivative of f(x)df__dx
Estimate a VAR(1) - suited to Bauer, Rudebusch and Wu (2012) methodologyestVARbrw
Use function f to generate the outputs from a ATSMf_with_vectorized_parameters
Data: Risk Factors for the GVAR - Candelon and Moura (2021)FactorsGVAR
Creates the confidence bounds and the graphs of FEVDs and GFEVDs after bootstrap ("joint Q" models)FEVDandGFEVDbs_jointQ
Creates the confidence bounds and the graphs of FEVDs and GFEVDs after bootstrap (JLL-based models)FEVDandGFEVDbs_jointQ_Ortho
Creates the confidence bounds and the graphs of FEVDs and GFEVDs after bootstrap ("sep Q" models)FEVDandGFEVDbs_sepQ
FEVDs graphs for orthogonalized risk factors of JLL-based modelsFEVDgraphsJLLOrtho
FEVDs graphs for ("joint Q" models)FEVDgraphsJoint
FEVDs graphs for ("sep Q" models)FEVDgraphsSep
FEVDs for "joint Q" modelsFEVDjoint
FEVDs after bootstrap for "joint Q" modelsFEVDjoint_BS
Orthogonalized FEVDs for JLL modelsFEVDjointOrthogoJLL
FEVDs after bootstrap for JLL-based modelsFEVDjointOrthogoJLL_BS
FEVDs for "sep Q" modelsFEVDsep
FEVDs after bootstrap for "sep Q" modelsFEVDsep_BS
Model fit graphs for ("joint Q" models)FitgraphsJoint
Model fit graphs for ("sep Q" models)FitgraphsSep
Performs state rotationsFMN__Rotate
Gather bond yields forecasts for all the model typesForecastYields
Bond yields forecasts ("joint Q" models)ForecastYieldsJointQ
Bond yields forecasts ("sep Q" models)ForecastYieldsSepQ
Set up the vector-valued objective function (Point estimate)Functionf
Set up the vector-valued objective function (Bootstrap)Functionf_Boot
computes the density function of a gaussian processGaussianDensity
Generate M data sets from VAR(1) modelgenVARbrw
Extract the parameter values from varargingetpara
Obtain the auxiliary values corresponding to each parameter, its size and its namegetx
GFEVDs graphs for orthogonalized risk factors of JLL-based modelsGFEVDgraphsJLLOrtho
GFEVDs graphs for "joint Q" modelsGFEVDgraphsJoint
GFEVDs graphs for ("sep Q" models)GFEVDgraphsSep
GFEVDs for "joint Q" modelsGFEVDjoint
GFEVDs after bootstrap for "joint Q" modelsGFEVDjoint_BS
Orthogonalized GFEVDs for JLL modelsGFEVDjointOrthoJLL
GFEVDs after bootstrap for JLL-based modelsGFEVDjointOrthoJLL_BS
GFEVDs for "sep Q" modelsGFEVDsep
GFEVDs after bootstrap for "sep Q" modelsGFEVDsep_BS
GIRFs graphs for orthogonalized risk factors of JLL-based modelsGIRFgraphsJLLOrtho
GIRFs graphs for ("joint Q" models)GIRFgraphsJoint
GIRFs graphs for ("sep Q" models)GIRFgraphsSep
GIRFs for "joint Q" modelsGIRFjoint
GIRFs after bootstrap for "joint Q" modelsGIRFjoint_BS
Orthogonalized GIRFs for JLL modelsGIRFjointOrthoJLL
GIRFs after bootstrap for JLL-based modelsGIRFjointOrthoJLL_BS
GIRFs for "sep Q" modelsGIRFSep
GIRFs after bootstrap for "sep Q" modelsGIRFSep_BS
Generate the graphical outputs for the selected models (Point estimate)GraphicalOutputs
Estimate a GVAR(1) and a VARX(1,1,1)GVAR
Find the indexes of the spanned factorsIdxAllSpanned
Extract the indexes related to the spanned factors in the variance-covariance matrixIdxSpanned
Generates several inputs that are necessary to build the likelihood functionInputsForMLEdensity
Generates several inputs that are necessary to build the likelihood function - Bootstrap versionInputsForMLEdensity_BS
Collect the inputs that are used to construct the numerical and the graphical outputsInputsForOutputs
Creates the confidence bounds and the graphs of IRFs and GIRFs after bootstrap ("joint Q" models)IRFandGIRFbs_jointQ
Creates the confidence bounds and the graphs of IRFs and GIRFs after bootstrap (JLL-based models)IRFandGIRFbs_jointQ_Ortho
Creates the confidence bounds and the graphs of IRFs and GIRFs after bootstrap ("sep Q" models)IRFandGIRFbs_sepQ
IRFs graphs for orthogonalized risk factors of JLL-based modelsIRFgraphsJLLOrtho
IRFs graphs for ("joint Q" models)IRFgraphsJoint
IRFs graphs for ("sep Q" models)IRFgraphsSep
IRFs for "joint Q" modelsIRFjoint
IRFs after bootstrap for "joint Q" modelsIRFjoint_BS
Orthogonalized IRFs for JLL modelsIRFjointOrthoJLL
IRFs after bootstrap for JLL-based modelsIRFjointOrthoJLL_BS
IRFs for "sep Q" modelsIRFsep
IRFs after bootstrap for "sep Q" modelsIRFsep_BS
Set of inputs present at JLL's P-dynamicsJLL
Impose stationarity under the Q-measureK1XQStationary
Eliminates the @killa
Generate the labels of the spanned factorsLabelsSpanned
Generate the labels of the star variablesLabelsStar
Generates the labels factorsLabFac
Concatenate the model-specific inputs in a listListModelInputs
Find mean or median of OLS when DGP is VAR(1)m_var
Create a vector of numerical maturities in yearsMaturities
Compute the maximum likelihood function ("joint Q" models)MLEdensity_jointQ
Compute the maximum likelihood function ("joint Q" models for separate Sigma estimation)MLEdensity_jointQ_sepSigma
Compute the maximum likelihood function ("sep Q" models)MLEdensity_sepQ
Replications of the JPS (2014) outputs by the MultiATSM packageModelPara
ATSM PackageMultiATSM
Construct the model numerical outputs (model fit, IRFs, GIRFs, FEVDs, GFEVDs, and risk premia decomposition)NumOutputs
Numerical outputs (IRFs, GIRFs, FEVD, and GFEVD) for bootstrapNumOutputs_Bootstrap
Peform the minimization of mean(f)Optimization
Peform the minimization of mean(f) (adapted for the bootstrap setting)Optimization_Boot
Numerical outputs (variance explained, model fit, IRFs, GIRFs, FEVDs, GFEVDs and risk premia decomposition) for "joint Q" modelsOutputConstructionJoint
Gathers all the model numerical ouputs after bootstrap for "joint Q" modelsOutputConstructionJoint_BS
Numerical outputs (variance explained, model fit, IRFs, GIRFs, FEVDs, GFEVDs, and risk premia decomposition) for "sep Q" modelsOutputConstructionSep
Gathers all the model numerical ouputs after bootstrap for "sep Q" modelsOutputConstructionSep_BS
Create the variable labels used in the estimationParaLabels
Weigth matrix from principal components (matrix of eigenvectors)pca_weights_one_country
Compute some key parameters from the P-dynamics (Bootstrap set)PdynamicsSet_BS
Transform a positive number y to back to x by:pos2x
Restricted OLS regressionReg__OLSconstrained
Estimate the risk-neutral feedbak matrix K1Q using linear regressionsReg_K1Q
Exclude series that contain NAsRemoveNA
Data: Risk Factors - Candelon and Moura (2021)RiskFactors
Spanned and unspanned factors plotRiskFactorsGraphs
Builds the complete set of time series of the risk factors (spanned and unspanned)RiskFactorsPrep
Compute the root mean square error ("joint Q" models)RMSEjoint
Compute the root mean square error ("sep Q" models)RMSEsep
Killan's VAR stationarity adjustmentshrink_Phi
Compute the country-specific spanned factorsSpanned_Factors
Gather all spanned factors ("joint Q" models)SpannedFactorsjointQ
Gather all spanned factors ("sep Q" models)SpannedFactorsSepQ
Compute the square root of a matrixsqrtm_robust
Generates the star variables necessary for the GVAR estimationStarFactors
Decomposition of yields into the average of expected future short-term interest rate and risk premia for "joint Q" modelsTermPremiaDecompJoint
Decomposition of yields into the average of expected future short-term interest rate and risk premia for "joint Q" modelsTermPremiaDecompSep
Term Premia decomposition graphs for "joint Q" modelsTPDecompGraphJoint
Term Premia decomposition graphs for "joint Q" modelsTPDecompGraphSep
Data: Trade Flows - Candelon and Moura (2021)TradeFlows
Compute the transition matrix required in the estimation of the GVAR modelTransition_Matrix
Map constrained parameters b to unconstrained auxiliary parameters a.true2aux
converts the vectorized auxiliary parameter vector x to the parameters that go directly into the likelihood function.update_para
Estimates a VAR(1)VAR
Percentage explained by the spanned factors of the variations in the set of observed yields for "joint Q" modelsVarianceExplainedJoint
Percentage explained by the spanned factors of the variations in the set of observed yields for "sep Q" modelsVarianceExplainedSep
Transform x to a number bounded btw lb and ub by:x2bound
Transform x to a positive number by: y = log(e^x + 1)x2pos
Data: Yields - Candelon and Moura (2021)Yields
Fit yields for all maturities of interestYieldsFitAllJoint
Fit yields for all maturities of interestYieldsFitAllSep
Computes two measures of model fit for bond yieldsYieldsFitJoint
Computes two measures of model fit for bond yieldsYieldsFitsep