Description Usage Arguments Details Value References
The function diagnostic
perform checks to validate three models
proposed by \insertCiteFama;textualbindr. One diagnostic set is applied
to the in-sample forecasting errors, i.e. the difference
between actual and expected inflation. The second diagnostic
set evaluates the results obtained from regressing actual
inflation against a constant and the expected inflation, with the
ideal model showing a constant term of zero and an expected inflation
coefficient of one.
1 2 3 4 5 6 7 8 9 10 | diagnostic(
metrics,
diag_type = c("period", "rolling"),
wnd_sz = 60,
show_plot = F,
y_plot = c("mean", "test", "sd", "rmse", "term"),
select_ = c("constant", "slope"),
conf_level = 0.95,
truncate_at = 0.75
)
|
metrics |
The 'metrics' 'tibble' object in the list returned by
|
diag_type |
A string controlling the time intervals: period defines non-overlapping period of wnd_sz months in length, whereas rolling generates rolling windows of width wnd_sz |
wnd_sz |
A integer, strictly greater than 0, defining period length or rolling windows width. The unit should match the underlying series frequency (see details) |
show_plot |
Logical (default is FALSE). Plot the results if set to TRUE |
y_plot |
A string identifying which statistic will be calculated (and
displayed if |
select_ |
A string identifying which regression term will be selected.
Applies only if |
conf_level |
A double, between 0.5 and 1.0 (excluding boundary points). Controls the parameter confidence intervals in the regression of actual inflation against a constant and the expected inflation. |
truncate_at |
A double, between 0 and 1.0 (including boundary points).
Applicable only when |
The measured difference between actual and expected inflation is captured by the general expression I(t) - α - β E[I(t-1)], where I(t) is the actual inflation and E[I(t-1)] stands for the expected inflation derived from three different econometric models found in \insertCiteFama;textualbindr. The diagnostic set applied to the in-sample forecasting errors, i.e. the difference between actual and expected inflation, can be viewed as imposing the dual constraint α = 0, β = 1. The second diagnostic set applied on the results obtained from regressing actual inflation against a constant and the expected inflation can be viewed as a fitted difference I(t) - α - β E[I(t-1)], where α and β are estimated.
The parameter y_plot = c("mean", "test", "sd", "rmse")
pertains to the
difference between actual and expected inflation, whereas y_plot =
"term"
performs diagnostic checking on results obtained from regressing
actual inflation against a constant and the expected inflation. The latter
choice requires setting select_ = 'constant'
or select_ =
'slope'
.
The wnd_sz
parameter unit must implicitly match the underlying data
frequency. For instance, wnd_sz = 60
corresponds to a 5-year
window/period in monthly frequency. However, if the underlying frequency is
quarterly the same parameter value yields a 15-year window/period.
Note that when y_plot == c('mean', 'test', 'sd', 'rmse')
, three
list-columns (stats::lm, tidy_param, tidy_ols) are also returned.
List-columns are used in nested data frames and are stored as a column vector
of a data frame. They are part of the tidyverse framework, and
specifically documented in the package tidyr. List-columns are
typically created by calling group_by(...)
on a tibble/data frame
object followed by nest()
. See tidyr package documentation
and/or purrr cheat sheet for details. All three list-columns
(stats::lm, tidy_param, tidy_ols) contain results associated with
regressing actual inflation against a constant and the expected inflation.
y_plot == 'term'
: A 'tibble' object containing
model type
date or sub-period
coefficient estimate
coefficient standard error
coefficient t-test against Ho (constant = 0; inflation = 1)
coefficient p-value
coefficient confidence interval
y_plot == c('mean', 'test', 'sd', 'rmse')
: A 'tibble' object
containing in-sample forecasting errors statistics:
model type
date or sub-period
average of monthly forecast error (mean)
the t-statistic for the test of the null hypothesis that the average forecast error is equal to zero (test)
the standard deviation of the monthly forecast error (sd)
the square root of the average squared forecast error (rsme)
list-column of 'stats::lm' objects (see details)
list-column of 'tidy_param' objects (see details)
list-column of 'tidy_ols' objects (see details)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.