stressIndex: Stress Index

Description Usage Arguments Value References Examples

View source: R/StressIndex.R

Description

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
Types of Risk

"default risk":
  interest rate spread designed to measure
  the difference between yields on ariskyasset
  and arisk-freeasset

"liquidity risk""
  inability to secure resources to acquire short term
  liabilities

Stress Index
Uses a precedure (Principal Components) to create
the "stress index".

Creating the Stress Index

1. First, each of the data series is de-meaned.
   The de-meaned series are then
   divided by their respective sample standard deviations (SDs)
   (Because each variable was standardized,
   the coefficient of a variable (SEE 2.) represents the
   "influence of a 1 SD change in that variable on the Stress Index.")
2. Use the method of principal components:
   Extracting this factor (the first principal component).
   makes it able to create an index with a useful interpretation
3. Calculate the  coefficients of the variables.

   The factor loadings, also called component loadings in PCA,
   are the correlation coefficients
   between the variables (rows) and factors (columns).

   The elements of the eigenvectors of . . . are the
   "coefficients" or "loadings" of the principal components.

4. We then scale these coefficients so that the SD of the index is 1.
5. Finally, each data series is multiplied
   by its respective adjusted coefficient.
6. Stress Index for time t is
   the sum of each series multiplied
   by its respective adjusted coefficient.
   (Higher values of the FSI indicate a
   greater degree of financial stress in the economy.)

Stress Index proc details drawbacks
  A negative coefficient multiplied by a negative data value
  will result in a positive contribution to financial stress.

Stress Index percent of the total variation
  in the many variables
  1SSE/SST
SST is the total sum of squares
SSE is the sum of squared errors
X(N,t) is the value of the Nth standardized variable in month t,
and a(N) is the set of coefficients chosen.
Updating the Stress Index

When the sample changes (i.e., a new item of data is added),
the values of the Stress Index in the original sample can be changed.
This alteration can occur either through a
change in the coefficients of the variables in the index
or by a change in the actual values of the variables in the
original sample. The overall magnitude of the coefficients,
as well as their relative magnitudes, can change.

Usage

1
stressIndex(x, ValDates, ...)

Arguments

x

xts object. Required. This is the input used for prediction.

ValDates

List of (or vector of) pairs of vectors of begin and end date-time ranges. Required (if not all of the ValidationData is to be used).

Value

Index that is centered about zero(0) and scaled to the standard deviation of one(1).

References

How to compute varimax-rotated principal components in R?, 2014 https://stats.stackexchange.com/questions/59213/how-to-compute-varimax-rotated-principal-components-in-r

Aaron Schlegel, Principal Component Analysis with R Example, Thu 19 January 2017 https://aaronschlegel.me/principal-component-analysis-r-example.html

Introduction to Principal Components and FactorAnalysis, North Carolina State University ftp://statgen.ncsu.edu/pub/thorne/molevoclass/AtchleyOct19.pdf

Luke Hayden, Principal Component Analysis in R, August 9th, 2018 https://www.datacamp.com/community/tutorials/pca-analysis-r

author(s)?, National Economic Trends, Appendix, January 2010 https://files.stlouisfed.org/files/htdocs/publications/net/NETJan2010Appendix.pdf

Kevin L. Kliesen and Douglas C. Smith, Measuring Financial Market Stress, Economic SYNOPSES, 2010 Number 2, Posted on January 15, 2010 https://files.stlouisfed.org/files/htdocs/publications/es/10/ES1002.pdf

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## Not run: 
# E.g. some (and only some of the) interest rates
# of the St Louis Stress Index 2 (STLFSI2)
for(Symbol in c("DFF","DGS2","DGS10")) {
  quantmod::getSymbols(Symbol, src = "FRED")
  assign(Symbol, stLouisFEDdaily2Weekly(get(Symbol), Level = "ChangeInLevels"))
}

Data <- stats::na.omit(cbind(DFF,DGS2,DGS10))
# dygraphs::dygraph(stressIndex(Data))

## End(Not run)

AndreMikulec/econModel documentation built on June 30, 2021, 9:48 a.m.