Skip to content
/ mssm Public

Toolbox to estimate Generalized Additive Mixed Models and their Markov-switching extensions in Python

License

Notifications You must be signed in to change notification settings

JoKra1/mssm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mssm: Markov-switching Spline Models

GitHub CI Stable codecov

Description

mssm is a toolbox to estimate Generalized Additive Mixed Models (GAMMs) semi Markov-switching GAMMs (sMs-GAMMs) and sMs Impulse Response GAMMs (sMs-IR-GAMMs). The main branch is updated frequently to reflect new developments. The stable branch should reflect the latest releases. If you don't need the newest functionality, you should install from the stable branch (see below for instructions).

Installation

The easiest option is to install from pypi via pip.

  1. Setup a conda environment with python > 3.10
  2. Install mssm via pip

The latest release of mssm can be installed from pypi. So to install mssm simply run:

conda create -n mssm_env python=3.10
conda activate mssm_env
pip install mssm
pip install matplotlib # Only needed for tutorials

The fourth line, installing matplotlib is only necessary if you want to run the tutorials. Note: pypi will only reflect releases (Basically, the state of the stable branch). If you urgently need a feature currently only available on the main branch, consider building from source.

Building from source

You can also build directly from source. This requires conda or an installation of eigen (setup.py then expects eigen in "usr/local/include/eigen3". This will probably not work on windows - the conda strategy should.). Once you have conda installed, install eigen from conda-forge. After cloning and navigating into the downloaded repository you can then install via:

pip install .

To get started

Take a look at the tutorials provided in this repository!

Contributing

Contributions are welcome! Feel free to open issues or make pull-requests to main.