No flags found
Use flags to group coverage reports by test type, project and/or folders.
Then setup custom commit statuses and notifications for each flag.
e.g., #unittest #integration
#production #enterprise
#frontend #backend
0ab2ae0
... +4 ...
77e5741
Use flags to group coverage reports by test type, project and/or folders.
Then setup custom commit statuses and notifications for each flag.
e.g., #unittest #integration
#production #enterprise
#frontend #backend
205 | 205 | ||
206 | 206 | """ |
|
207 | 207 | predict(am::UnivariateARCHModel, what=:volatility; level=0.01, horizon=1) |
|
208 | - | Form a 1-step ahead prediction from `am`. `what` controls which object is predicted. |
|
208 | + | Form a `horizon`-step ahead prediction from `am`. `what` controls which object is predicted. |
|
209 | 209 | The choices are `:volatility` (the default), `:variance`, `:return`, and `:VaR`. The VaR |
|
210 | 210 | level can be controlled with the keyword argument `level`. |
|
211 | + | ||
212 | + | For `what=:VaR`, only a `horizon = 1` horizon is currently supported. |
|
211 | 213 | """ |
|
212 | 214 | function predict(am::UnivariateARCHModel{T, VS, SD}, what=:volatility, horizon=1; level=0.01) where {T, VS, SD, MS} |
|
213 | 215 | ht = volatilities(am).^2 |
218 | 220 | if horizon > 1 && what == :VaR |
|
219 | 221 | error("Predicting VaR more than one period ahead is not implemented. Consider predicting one period ahead and scaling by `sqrt(horizon)`.") |
|
220 | 222 | end |
|
221 | - | for t = length(am.data) .+ (1 : horizon) |
|
223 | + | data = copy(am.data) |
|
224 | + | for t = length(data) .+ (1 : horizon) |
|
222 | 225 | if what == :return || what == :VaR |
|
223 | 226 | themean = mean(at, ht, lht, am.data, am.meanspec, am.meanspec.coefs, t) |
|
224 | 227 | end |
|
225 | 228 | update!(ht, lht, zt, at, VS, am.spec.coefs) |
|
226 | 229 | push!(zt, 0.) |
|
227 | 230 | push!(at, 0.) |
|
231 | + | push!(data, themean) |
|
228 | 232 | end |
|
229 | 233 | if what == :return |
|
230 | 234 | return themean |
Files | Coverage |
---|---|
src | +<.01% 99.55% |
Project Totals (12 files) | 99.55% |
77e5741
623b998
43b4c14
b9f8fa7
999ffe6
0ab2ae0