Commit 9c50e94
Multivariate Structural Statespace Components (#529)
* Reorganize structural model module
* Allow combination of components with different numbers of observed states
* Allow multiple observed in LevelTrend component
* Allow multiple observed states in measurement error component
* Allow multiple observed in AutoRegressive component
* Fix typo in docstrings
* Allow multiple observed in Cycle component
* Fix Cycle docstring examples
* Use pytensor block_diag for Cycle
* 1. updated level_trend component coord/param labels
2. Adjusted the regression component to allow multivariate regression component specification
3. Added a notebook for quick evaluation of the adjustments and additions made
* 1. removed incorrectly comitted file test_structural.py
2. replaced scipy block diag with pytensor block diag
3. Added forecast to test model in multivariate ssm notebook
* removed incorrectly committed file structural.py
* Always count names to determine k_endog
* LevelTrend state/shock names depend on component name
* Update tests to new names
* More test updates
* Delay dropping data names from states/coords until `.build`
* Remove docstring typo
* Update autoregressive component and tests
* 1. updated regression component to revert to univariate shape schema if k_endog=1
2. adjusted coord name in test_statespace test_forecast_with_exog test to avoid key error
3. Added forecast plot and missing value state space section to notebook
* Add component name to shock state names
* Allow multiple observed in TimeSeasonality component
* updated coord dimension names in regression component to always use the user given name as a prefix
* updated level_trend component so that component name is added as a prefix to coord dimension names and updated tests in test_statespace accordingly
* Allow multiple observed in FrequencySeasonality component
* Propagate static shape information in join_tensors_by_dim_labels where possible
* Regression component bugfix and tests
* update default name in test
* Improve cycle code with Jesse's feedback
* Explicitly test matrices in test_cycle
* Add test addition of two Cycles with different observed names
* Make code for state cov when no innov clearer
* 1. updated coords for level trend component and regression component
2. extended test_forecast to include multivariate forecasts with no exogenous variables
* 1. added seasonality params coords fix from Alex Andorra
2. added datetime multivariate forecast tests no exogenous variables
3. added test to check that parameter shapes and coordinate dims agree with one another
* 1. updated param dims in regression component
2. added all components to test_param_dims_coord
* Add exog names to shock_names in LevelTrend
* Update tests to respect new naming convention
* added multivariate forecast with exogenous variables test
* level_trend shock coords should be base_shock_names, not self.shock_names
* Save static shape of last data dim
* More static shapes
* Broken test of decomposition with multiple observed
* Don't use `pad`
* fix decompose test
* updated leveltrend, seasonal, cycle components to adhere to naming schema and updated tests in accordance to naming changes
* Delete notebook
* Use nwe name order in autoregressive component
* Improve docstrings
* Refactor test_regression to cover innotations = True
* Fix comment in test_cycle
* Add docstrings to core and measurement_error
* Improve cycle and seasonal docstrings
* Fix shape of AR params
* Some other AR dims fixes
* Cast all component parameters to lists in `Component.__init__`
* Add type checking and errors for property combination
* re-run structural notebook
---------
Co-authored-by: Alexandre Andorra <[email protected]>
Co-authored-by: Alex Andorra <[email protected]>
Co-authored-by: Jonathan Dekermanjian <[email protected]>1 parent 5ffaed6 commit 9c50e94
File tree
34 files changed
+5297
-2415
lines changed- notebooks
- pymc_extras/statespace
- models
- structural
- components
- utils
- tests/statespace
- core
- filters
- models
- structural
- components
- utils
34 files changed
+5297
-2415
lines changedLarge diffs are not rendered by default.
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
Whitespace-only changes.
Lines changed: 188 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
0 commit comments