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: docs/src/adapting_package.md
+9-9Lines changed: 9 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ The StateSpaceLearning framework supports any additive state space formulation.
4
4
5
5
## Local Level Model
6
6
7
-
Although the Local Level Model is already implemented within the scope of unobserved components, we use it here as an example. To incorporate a new model, it is necessary to create a dictionary containing the model inputs and another dictionary containing three functions (create_X, get_components_indexes, and get_variances).
7
+
Although the Local Level Model is already implemented within the scope of unobserved components, we use it here as an example. To incorporate a new model, it is necessary to create a dictionary containing the model inputs and another dictionary containing three functions (create\_X, get\_components\_indexes, and get\_variances).
8
8
9
9
### Model Inputs
10
10
For the Local Level Model, no parameters are needed. Thus, the model input can be created as:
@@ -13,8 +13,8 @@ For the Local Level Model, no parameters are needed. Thus, the model input can b
13
13
model_input =Dict()
14
14
```
15
15
16
-
### create_X
17
-
The create_X function constructs the matrices in the State Space Learning format. It must accept the following inputs: (model_input::Dict, Exogenous_X::Matrix{Fl}, steps_ahead::Int64=0, Exogenous_Forecast::Matrix{Fl}). It must return a matrix.
16
+
### create\_X
17
+
The create\_X function constructs the matrices in the State Space Learning format. It must accept the following inputs: (model\_input::Dict, Exogenous\_X::Matrix{Fl}, steps\_ahead::Int64=0, Exogenous\_Forecast::Matrix{Fl}). It must return a matrix.
@@ -30,8 +30,8 @@ function create_X_LocalLevel(model_input::Dict, Exogenous_X::Matrix{Fl},
30
30
end
31
31
```
32
32
33
-
### get_components_indexes
34
-
The get_components_indexes function outputs a dictionary indicating the indexes of each model component, including a set of indexes for all initial states. For the Local Level Model, the only components are the initial state μ1 and its innovations ξ. The function must accept the following inputs: (Exogenous_X::Matrix{Fl}, model_input::Dict). It must return a dictionary.
33
+
### get\_components\_indexes
34
+
The get\_components\_indexes function outputs a dictionary indicating the indexes of each model component, including a set of indexes for all initial states. For the Local Level Model, the only components are the initial state μ1 and its innovations ξ. The function must accept the following inputs: (Exogenous\_X::Matrix{Fl}, model\_input::Dict). It must return a dictionary.
The get_variances function calculates the variances of the innovations and residuals. It must accept the following inputs:(ε::Vector{Fl}, coefs::Vector{Fl}, components_indexes::Dict{String, Vector{Int64}}). It must return a dictionary.
45
+
### get\_variances
46
+
The get\_variances function calculates the variances of the innovations and residuals. It must accept the following inputs:(ε::Vector{Fl}, coefs::Vector{Fl}, components\_indexes::Dict{String, Vector{Int64}}). It must return a dictionary.
The current estimation procedure is based on an Adaptive Lasso. However, alternative methods can be chosen within the StateSpaceLearning framework. Below is an example of how to implement a simple model that minimizes the sum of squares of the residuals. This requires creating two variables: a dictionary estimation_input (which is empty in this case) and a function estimation_function with the following arguments:(Estimation_X::Matrix{Tl}, estimation_y::Vector{Fl}, components_indexes::Dict{String, Vector{Int64}}, estimation_input::Dict). The function should return a tuple containing the model coefficients and residuals.
73
+
The current estimation procedure is based on an Adaptive Lasso. However, alternative methods can be chosen within the StateSpaceLearning framework. Below is an example of how to implement a simple model that minimizes the sum of squares of the residuals. This requires creating two variables: a dictionary estimation\_input (which is empty in this case) and a function estimation\_function with the following arguments:(Estimation_X::Matrix{Tl}, estimation\_y::Vector{Fl}, components\_indexes::Dict{String, Vector{Int64}}, estimation\_input::Dict). The function should return a tuple containing the model coefficients and residuals.
Quick example on how to perform best subset selection in time series utilizing StateSpaceLearning.
@@ -221,9 +219,9 @@ julia paper_tests/m4_test/m4_test.jl
221
219
python paper_tests/m4_test/m4_test.py
222
220
```
223
221
224
-
The results for SSL model in terms of MASE and sMAPE for all 48000 series will be stored in folder "paper_tests/m4_test/results_SSL". The average results of MASE, sMAPE and OWA will be saved in file "paper_tests/m4_test/metric_results/SSL_METRICS_RESULTS.csv".
222
+
The results for SSL model in terms of MASE and sMAPE for all 48000 series will be stored in folder "paper\_tests/m4\_test/results\_SSL". The average results of MASE, sMAPE and OWA will be saved in file "paper\_tests/m4\_test/metric\_results/SSL\_METRICS\_RESULTS.csv".
225
223
226
-
The results for SS model in terms of MASE and sMAPE for all 48000 series will be stored in folder "paper_tests/m4_test/results_SS". The average results of MASE, sMAPE and OWA will be saved in file "paper_tests/m4_test/metric_results/SS_METRICS_RESULTS.csv".
224
+
The results for SS model in terms of MASE and sMAPE for all 48000 series will be stored in folder "paper\_tests/m4\_test/results\_SS". The average results of MASE, sMAPE and OWA will be saved in file "paper\_tests/m4\_test/metric\_results/SS\_METRICS\_RESULTS.csv".
227
225
228
226
### Simulation Experiment
229
227
@@ -239,7 +237,7 @@ As this test takes a long time, you may want to run it in parallel, for that you
239
237
julia paper_tests/simulation_test/simulation.jl 3
240
238
```
241
239
242
-
The results will be saved in two separated files: "paper_tests/simulation_test/results_metrics/metrics_confusion_matrix.csv" and "paper_tests/simulation_test/results_metrics/metrics_bias_mse.csv"
240
+
The results will be saved in two separated files: "paper\_tests/simulation\_test/results\_metrics/metrics\_confusion\_matrix.csv" and "paper\_tests/simulation\_test/results\_metrics/metrics\_bias\_mse.csv"
0 commit comments