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
+60-19Lines changed: 60 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,17 +17,15 @@ y = randn(100)
17
17
output = StateSpaceLearning.fit_model(y)
18
18
19
19
#Main output options
20
-
model_type = output.model_input # State Space Equivalent model utilized in the estimation (default = Basic Structural).
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.
21
22
X = output.X # High Dimension Regression utilized in the estimation.
22
23
coefs = output.coefs # High Dimension Regression coefficients estimated in the estimation.
23
24
ϵ = output.ϵ # Residuals of the model.
24
25
fitted = output.fitted # Fit in Sample of the model.
25
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").
26
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).
27
-
T = output.T # The length of the original time series.
28
-
outlier = output.outlier # Boolean indicating the presence of outlier component (default = false).
29
28
valid_indexes = output.valid_indexes # Vector containing valid indexes of the time series (non valid indexes represent NaN values in the time series).
30
-
ζ_ω_threshold = output.ζ_ω_threshold # ζ_ω_threshold parameter (default = 0). A non 0 value for this parameter might be important in terms of forecast for some time series to lead to more stable predictions (we recommend ζ_ω_threshold = 11 for monthly series).
31
29
32
30
#Forecast
33
31
prediction = StateSpaceLearning.forecast(output, 12) #Gets a 12 steps ahead prediction
@@ -37,11 +35,9 @@ prediction = StateSpaceLearning.forecast(output, 12) #Gets a 12 steps ahead pred
Quick example on how to use StateSpaceLearning to initialize StateSpaceModels
140
182
@@ -168,7 +210,6 @@ To reproduce M4 paper results you can clone the repository and run the following
168
210
```shell
169
211
julia paper_tests/m4_test/m4_test.jl
170
212
python paper_tests/m4_test/m4_test.py
171
-
1
172
213
```
173
214
174
215
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".
Copy file name to clipboardExpand all lines: docs/src/adapting_package.md
+6-4Lines changed: 6 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,11 +14,12 @@ model_input = Dict()
14
14
```
15
15
16
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}, outlier::Bool, ζ_ω_threshold::Int64, T::Int64, steps_ahead::Int64=0, Exogenous_Forecast::Matrix{Fl}=zeros(steps_ahead, size(Exogenous_X, 2))). This function may not use parameters such as outlier, ζ_ω_threshold, or Exogenous_X. It must return a matrix.
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.
steps_ahead::Int64=0, Exogenous_Forecast::Matrix{Fl}=zeros(steps_ahead, size(Exogenous_X, 2))) where Fl
22
+
T =size(Exogenous_X, 1)
22
23
initial_states_matrix =ones(T+steps_ahead, 1)
23
24
ξ_matrix =Matrix{Float64}(undef, T+steps_ahead, T -1)
24
25
for t in1:T+steps_ahead
@@ -30,10 +31,11 @@ end
30
31
```
31
32
32
33
### get_components_indexes
33
-
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: (T::Int64, Exogenous_X::Matrix{Fl}, model_input::Dict, outlier::Bool, ζ_ω_threshold::Int64). This function may not use parameters such as outlier, ζ_ω_threshold, or Exogenous_X. It must return a dictionary.
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.
StateSpaceLearning.jl is a package for modeling and forecasting time series in a high-dimension regression framework.
9
8
10
9
## Quickstart
@@ -18,17 +17,15 @@ y = randn(100)
18
17
output = StateSpaceLearning.fit_model(y)
19
18
20
19
#Main output options
21
-
model_type = output.model_input # State Space Equivalent model utilized in the estimation (default = Basic Structural).
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
22
X = output.X # High Dimension Regression utilized in the estimation.
23
23
coefs = output.coefs # High Dimension Regression coefficients estimated in the estimation.
24
24
ϵ = output.ϵ # Residuals of the model.
25
25
fitted = output.fitted # Fit in Sample of the model.
26
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
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
-
T = output.T # The length of the original time series.
29
-
outlier = output.outlier # Boolean indicating the presence of outlier component (default = false).
30
28
valid_indexes = output.valid_indexes # Vector containing valid indexes of the time series (non valid indexes represent NaN values in the time series).
31
-
ζ_ω_threshold = output.ζ_ω_threshold # ζ_ω_threshold parameter (default = 0). A non 0 value for this parameter might be important in terms of forecast for some time series to lead to more stable predictions (we recommend ζ_ω_threshold = 11 for monthly series).
32
29
33
30
#Forecast
34
31
prediction = StateSpaceLearning.forecast(output, 12) #Gets a 12 steps ahead prediction
@@ -38,11 +35,9 @@ prediction = StateSpaceLearning.forecast(output, 12) #Gets a 12 steps ahead pred
Quick example on how to use StateSpaceLearning to initialize StateSpaceModels
141
182
@@ -169,7 +210,6 @@ To reproduce M4 paper results you can clone the repository and run the following
169
210
```shell
170
211
julia paper_tests/m4_test/m4_test.jl
171
212
python paper_tests/m4_test/m4_test.py
172
-
1
173
213
```
174
214
175
215
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".
0 commit comments