Skip to content

Commit 31798d8

Browse files
change from ANE to NIE (#138)
1 parent a73a100 commit 31798d8

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

examples/ane.jl renamed to examples/nie.jl

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@ using Dates, DelimitedFiles, Plots, Random, ScoreDrivenModels
22

33
# Define dates and load historical Affluent Natural Energy data
44
dates = collect(Date(1961):Month(1):Date(2000, 12))
5-
y = vec(readdlm("../test/data/ane_northeastern.csv"))
5+
y = vec(readdlm("./test/data/nie_northeastern.csv"))
66
y_train = y[1:400]
77
y_test = y[401:460]
88

99
# Set RNG seed to guarantee consistent results
1010
Random.seed!(123)
1111

1212
# Specify GAS model: a lognormal model with time-varying μ, constant σ, and lags 4 and 12
13-
gas = Model([1, 2, 3, 4], [1, 2, 3, 10, 11, 12], LogNormal, 1.0; time_varying_params=[1])
13+
gas = Model([1,2,3,4], [1,2,3,10,11,12], LogNormal, 1.0; time_varying_params=[1])
1414

1515
# Obtain initial parameters to start the GAS recursion
1616
initial_params = dynamic_initial_params(y_train, gas)
@@ -26,6 +26,9 @@ plot(f)
2626
forec = forecast(y_train, gas, 60; S=1000, initial_params=initial_params)
2727

2828
# Plot results
29-
plot(dates[401:460], forec.observation_scenarios, color="grey", width=0.05, label="", ylims=(0, 70))
30-
plot!(dates[360:460], y[360:460], label="ANE", color="black", xlabel="Months", ylabel="GWmed", legend=:topright)
29+
plotly()
30+
plot(dates[401:460], forec.observation_scenarios, color="grey", w=0.05, label="", ylims=(0, 70));
31+
plot!(dates[360:460], y[360:460], label="NIE", color="black", xlabel="Months", ylabel="GWmed", legend=:topright);
3132
plot!(dates[401:460], forec.observation_quantiles, label=["Quantiles" "" ""], color="red", line=:dash)
33+
34+
plot(dates[1:400], y_train, label = "in-sample NIE", ylabel = "GWmed", xlabel = "Months", color = "black")
File renamed without changes.

0 commit comments

Comments
 (0)