Description Usage Arguments Value Examples
excluding values that are out of sd range (mean p/n threshold times sd) from the rolling window to get more stable range of changes
1 2 | GenSubidxSD(series, winlen = 36, sd.threshold = 3, smooth.winlen = 3,
IF.LAG = FALSE)
|
series |
xts object, benchmark time series, monthly for now |
winlen |
numeric, rolling window length for calculating sd and mean |
sd.threshold |
integer, used for the boundary of standard deviation for the range |
smooth.winlen |
integer, showing how many true in a row to get a true in the index, used for cleaning fragmental: minimum allowed len for index to be positive |
zoo::index, monthly for now, can used by series[idx]
1 2 3 4 5 6 7 8 9 | # to filter the efa's EFA
pcg.SEE <- pe.SEE / xts::lag.xts(pe.SEE) - 1 # pe.SEE is a PE ratio xts dataframe
stable.idx.efa <- pcg.SEE$EFA %>% na.omit %>%
GenSubidxSD(sd.threshold = 2, IF.LAG = TRUE, smooth.winlen = 3, winlen = 36)
pcg.SEE$EFA %>% na.omit %>%
PlotFilterCompLine(stable.idx.efa, "Std Filter for EFA")
# partially modify the signal
signal[!(index(signal) %in% stable.idx.efa)] <- 1;
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.