snarch {sisireg} | R Documentation |
S-NARCH Model
Description
Calculates the long-, middle- and short-term trends and vola for a financial time series.
Usage
snarch(dat)
Arguments
dat |
financial time series. |
Value
data frame
tr20 |
long-term trend |
vl20 |
long-term vola |
tr10 |
middle-term trend |
vl10 |
middle-term vola |
tr5 |
short-term trend |
vl5 |
short-term vola |
Author(s)
Dr. Lars Metzner
References
Dr. Lars Metzner (2019) Finanzmathematische Zeitreihenanalyse. Independently Published.
Examples
# generate test data
set.seed(1234)
x <- seq(1:250)
dat <- 13000 + cumsum(rnorm(250))
# calculate the S-NARCH model
df <- snarch(dat)
# plot the results
op <- par(mfrow=c(1,3))
plot(x,dat)
lines(x,df$tr20)
lines(x,df$tr20 - df$vl20, lty = 'dotted')
lines(x,df$tr20 + df$vl20, lty = 'dotted')
plot(x,dat)
lines(x,df$tr10)
lines(x,df$tr10 - df$vl10, lty = 'dotted')
lines(x,df$tr10 + df$vl10, lty = 'dotted')
plot(x,dat)
lines(x,df$tr5)
lines(x,df$tr5 - df$vl5, lty = 'dotted')
lines(x,df$tr5 + df$vl5, lty = 'dotted')
par(op)
[Package sisireg version 1.1.1 Index]