axe_narch_predict {sisireg}R Documentation

Prediction function for the AxE-NARCH model

Description

Calculates the prediction for a given model

Usage

axe_narch_predict(model, quotes, tgt)

Arguments

model

previously calculated model.

quotes

20 days of history.

tgt

target variable: tgt = 'trend' or 'vola'.

Value

prediction

prediction based in the model and the given coordinates.

Author(s)

Dr. Lars Metzner

References

Dr. Lars Metzner (2021) Adäquates Maschinelles Lernen. Independently Published.

Examples


set.seed(1234)
n <- 250
s <- 13000 + cumsum(rnorm(n))
T = 20
# create model for 5-day trend
model <- axe_narch_model(s, T, 'trend')
# calculate prognosis for trend 
s_ <- s[n] + cumsum(rnorm(20))
s_T <- axe_narch_predict(model, s_, 'trend')
# plot the results
plot(seq(1:20), s_, type = "l", 
    xlim = c(0,21+T), ylim = c(min(s_, s_T)-5, max(s_, s_T)+5))
points(20+T, s_T, col='red', pch = 16)
# create model for 5-day vola
model <- axe_narch_model(s, T, 'vola')
r_T <- axe_narch_predict(model, s_, 'vola')
lines(c(20+T,20+T), c(s_T-r_T, s_T+r_T), col='orange')


[Package sisireg version 1.1.1 Index]