Description Usage Arguments Details Value
Plots historical vs fitted yields. Note that this function WILL work for any number of VAR components as long as calibrate_VAR.out input is correct (however currently calibrate_VAR() only takes 4 VAR components).
1 2 | compare_yield_fit(varData, histYields, calibrate_VAR.out, Phi, Sigma, N = c(2,
3, 5, 10))
|
varData |
VAR columns used in OLS (i.e. onemonth, inflation, tenyear, stock) |
histYields |
histYields to calibrate term structure with (i.e. twoyear, threeyear, fiveyear, tenyear) |
calibrate_VAR.out |
output of calibrate_VAR |
Phi |
coefficients of OLS |
Sigma |
covariance matrix of OLS |
N |
specifies the terms used in histYields (i.e. 2, 3, 5, 10). Should be the same as parameter than was passed to calibrate_VAR(). |
For example, marketData <- readRDS("~/Dropbox/Research/StocVal/data/Canada/varinput_canada.Rda"); varData <- data.frame(onemonth=marketData$onemonth, inflation=marketData$inflation, tenyear=marketData$tenyear, stock=marketData$stock); histYields <- data.frame(twoyear=marketData$twoyear, threeyear=marketData$threeyear, fiveyear=marketData$fiveyear, tenyear=marketData$tenyear); N <- c(2,3,5,10) calibrate_VAR.out <- calibrate_VAR(varData, histYields, Phi, Sigma, N); compare_yield_fit(varData, histYields, calibrate_VAR.out, Phi, Sigma, N)
see plots
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.