https://github.com/charlesknipp/ssmconstructor
A modeling language which uses mathematically familiar syntax to interface with SSMProblems.jl
https://github.com/charlesknipp/ssmconstructor
Last synced: 2 months ago
JSON representation
A modeling language which uses mathematically familiar syntax to interface with SSMProblems.jl
- Host: GitHub
- URL: https://github.com/charlesknipp/ssmconstructor
- Owner: charlesknipp
- License: mit
- Created: 2025-01-28T21:34:38.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2025-02-05T17:56:08.000Z (4 months ago)
- Last Synced: 2025-02-05T18:56:04.003Z (4 months ago)
- Language: Julia
- Size: 8.79 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SSMConstructor
A modeling language which uses mathematically familiar syntax to interface with SSMProblems.jl## A Simple Example
Consider a local level trend model with two parameters `σε` and `ση`
```julia
@statespace function UC(ση, σε)
# local level model
y[t] = x[t] + η[t]
x[t] = x[t-1] + ε[t]# noise
ε[t] ~ Normal(0, σε)
η[t] ~ Normal(0, ση)
end
```The aim of this macro is to define a `LatentDynamics` and `ObservationProcess` from the above block.
Additionally, the above block defines a linear and Gaussian model; which is easy to detect by rearranging the AST such that the first expression is an addition call with subsequent layers containing the multiplication. In theory, we should be able to rearrange any affine transformation to this structure and define a respective linear system.
For conditionally linear Gaussian models, this again should be easy by only defining the scope of the first 2 layers of the AST.
## Things to Note
- In it's nascant state, this module will only define the recursive calls; therefore the user must define the initial draws
- I only intend for automatic marginalization on linear Gaussian models
- Compared to something like [OnlineSampling.jl](https://github.com/wazizian/OnlineSampling.jl), this macro refrains from symbolic execution, leading to an enormous gain in computation time.
- My demo cases in `tests/linear_models.jl` and `tests/conditionally_linear_models.jl` only consider scalar time series