s-broda / ARCHModels.jl
Showing 1 of 2 files from the diff.
Other files ignored by Codecov
test/runtests.jl has changed.

@@ -205,9 +205,11 @@
Loading
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,13 +220,15 @@
Loading
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 99.55%
Project Totals (12 files) 99.55%
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading