View source: R/ts_segmentation.R
ts_segmentation | R Documentation |
Make density plot of subsequent returns conditioned on multiple binary indicators derived from a reference time series
ts_segmentation(
df,
date_idx,
invest_series,
invest_name = NULL,
cndtn_series,
cndtn_name = NULL,
bin_method,
lb = 6,
pc = 0.2,
fr = -0.05
)
df |
A dataframe containing the following columns:
|
date_idx |
The column in df representing the date index |
invest_series |
A column in df representing the time series for which returns are to be assessed |
invest_name |
A string representing the name of the time series for which returns are to be assessed. If populated, this this will display in the plot title as opposed to the column name. |
cndtn_series |
A column in df representing the conditioning time series to derive the multiple binary indicators |
cndtn_name |
A string representing the name of the conditioning time series to derive the multiple binary indicators. If populated, this this will display in the plot title as opposed to the column name. |
bin_method |
either, "level" - split time series into terciles only, or "both" - split time series into terciles and a 6 month change indicator ("increase" or "decrease") |
lb |
The look back period for draw-down assessment |
pc |
The percent draw-down for binary market in/out indicator cutoff |
fr |
The minimum forward return for binary market in/out indicator cutoff |
A ggplot object.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.