ldhmm.plot_spx_vix_obs: Plotting HMM expected volatility for SPX overlaid with...

Description Usage Arguments Author(s) Examples

View source: R/ldhmm-plot_spx_vix_obs.R

Description

This utility plots the HMM expected volatility of SPX overlaid with the VIX index adjusted by a ratio. The expected volatility is shown to have a long-term ratio of 0.79 relative to the VIX index. This plot will show how HMM deviates from VIX in a shorter time window. Optionally the insert shows the relation between the return and volatility indicated by each state. This plot is also called "volatility yield curve".

Usage

1
2
3
ldhmm.plot_spx_vix_obs(object, days.pa = 252, start.date = NULL,
  end.date = NULL, px.origin = NULL, px.scale = NULL,
  vix.adj.ratio = NULL, insert.plot = TRUE, insert.viewport = NULL)

Arguments

object

an ldhmm object with a stationary solution. If this is set to NULL, an internal 10-state HMM object will be used.

days.pa

a positive integer specifying trading days per year, default is 252.

start.date

Date or character of ISO format (YYYY-MM-DD), specifying the start date of the plot, default is NULL, which is converted to 1.5 years ago.

end.date

Date or character of ISO format (YYYY-MM-DD), specifying the end date of the plot, default is NULL, which means the latest date.

px.origin

numeric, specifying the starting value of the index price line, the default is NULL, which will start the index price line from the middle of y-axis.

px.scale

numeric, specifying the scaling factor when plotting price trend, default is 15. The closing price is converted to cumulative return by the price of the first date. Then plot from the mid-point of volatility axis with this scale.

vix.adj.ratio

numeric, if specified, VIX index is adjusted and plotted, default is NULL. Default is to use the long-term ratio between VIX and 10-state HMM, which is about 0.79.

insert.plot

logical, if true, also plot the volatility-return as insert in upper-right corner, default is TRUE.

insert.viewport

optional viewport for the insert, default is NULL, which is internally set to grid::viewport(.8, .75, .3, .3).

Author(s)

Stephen H. Lihn

Examples

1
2
3
4
## Not run: 
    ldhmm.plot_spx_vix_obs(h)

## End(Not run)

ldhmm documentation built on Jan. 11, 2020, 9:16 a.m.