You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+46-40Lines changed: 46 additions & 40 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,33 +13,31 @@ using StateSpaceLearning
13
13
14
14
y =randn(100)
15
15
16
-
#Fit Model
17
-
output = StateSpaceLearning.fit_model(y)
18
-
19
-
#Main output options
20
-
model_input = output.model_input # Model inputs that were utilized to build the regression matrix.
21
-
Create_X = output.Create_X # The function utilized to build the regression matrix.
22
-
X = output.X # High Dimension Regression utilized in the estimation.
23
-
coefs = output.coefs # High Dimension Regression coefficients estimated in the estimation.
24
-
ε = output.ε # Residuals of the model.
25
-
fitted = output.fitted # Fit in Sample of the model.
26
-
components = output.components # Dictionary containing information about each component of the model, each component has the keys: "Values" (The value of the component in each timestamp) , "Coefs" (The coefficients estimated for each element of the component) and "Indexes" (The indexes of the elements of the component in the high dimension regression "X").
27
-
residuals_variances = output.residuals_variances # Dictionary containing the estimated variances for the innovations components (that is the information that can be utilized to initialize the state space model).
28
-
valid_indexes = output.valid_indexes # Vector containing valid indexes of the time series (non valid indexes represent NaN values in the time series).
29
-
30
-
#Forecast
16
+
# Instantiate Model
17
+
model =StructuralModel(y)
18
+
19
+
# Fit Model
20
+
fit!(model)
21
+
22
+
# Point Forecast
31
23
prediction = StateSpaceLearning.forecast(output, 12) #Gets a 12 steps ahead prediction
prediction_log = StateSpaceLearning.forecast(output, steps_ahead) # arguments are the output of the fitted model and number of steps ahead the user wants to forecast
67
+
model =StructuralModel(log_air_passengers)
68
+
fit!(model)
69
+
prediction_log = StateSpaceLearning.forecast(model, steps_ahead) # arguments are the output of the fitted model and number of steps ahead the user wants to forecast
71
70
prediction =exp.(prediction_log)
72
71
73
72
plot(airp.passengers, w=2 , color ="Black", lab ="Historical", legend =:outerbottom)
simulation = StateSpaceLearning.simulate(output, steps_ahead, N_scenarios) # arguments are the output of the fitted model, number of steps ahead the user wants to forecast and number of scenario paths
79
+
simulation = StateSpaceLearning.simulate(model, steps_ahead, N_scenarios) # arguments are the output of the fitted model, number of steps ahead the user wants to forecast and number of scenario paths
81
80
82
81
plot(airp.passengers, w=2 , color ="Black", lab ="Historical", legend =:outerbottom)
0 commit comments