Skip to main content

Toolbox for estimating Generalized additive mixed models (GAMMs), semi-Markov-switching (sms) GAMMs, and Impulse response sms GAMMs.

Project description

mssm: Markov-switching Spline Models

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

  • With GAMMs: Take a look at tutorial 1 in the tutorial folder.
  • With sms-IR-GAMMs: Take a look at tutorial 2.
  • With sms-GAMMs: Take a look at tutorial 3.

Contributing

Contributions are welcome! Feel free to open issues or make pull-requests to main. Some problems that could use work are listed below.

  • Tensor smooth term setup is not very efficient and takes quite a lot of time.
  • Spline bases are always first evaluated as dense matrices followed by pruning zeros away afterwards. This is quite wasteful.
  • Fellner-Schall update computes generalized inverse for every term. This works but is not necessary. For univariate terms with a single penalty this could be based on the pre-computed rank (see Wood, 2020: Inference and computation with generalized additive models and their extensions) of the penalty matrix (for B-splines this is super easy to obtain).
  • Constraints. Sum-to-zero constraints (1.T @ f(x) = 0) are not so attractive from a sparse model perspective. However, that alternatives result in wider CIs is well documented (see Wood, 2017 for example). Finding a good trade-off is still high on my list, the alternatives implemented so far perform okayish.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

mssm-0.1.27-pp310-pypy310_pp73-win_amd64.whl (182.2 kB view details)

Uploaded PyPy Windows x86-64

mssm-0.1.27-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (220.8 kB view details)

Uploaded PyPy manylinux: glibc 2.17+ x86-64

mssm-0.1.27-pp310-pypy310_pp73-manylinux_2_17_i686.manylinux2014_i686.whl (227.2 kB view details)

Uploaded PyPy manylinux: glibc 2.17+ i686

mssm-0.1.27-pp310-pypy310_pp73-macosx_10_9_x86_64.whl (195.9 kB view details)

Uploaded PyPy macOS 10.9+ x86-64

mssm-0.1.27-cp312-cp312-win_amd64.whl (182.3 kB view details)

Uploaded CPython 3.12 Windows x86-64

mssm-0.1.27-cp312-cp312-win32.whl (167.4 kB view details)

Uploaded CPython 3.12 Windows x86

mssm-0.1.27-cp312-cp312-musllinux_1_1_x86_64.whl (745.3 kB view details)

Uploaded CPython 3.12 musllinux: musl 1.1+ x86-64

mssm-0.1.27-cp312-cp312-musllinux_1_1_i686.whl (799.3 kB view details)

Uploaded CPython 3.12 musllinux: musl 1.1+ i686

mssm-0.1.27-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (227.9 kB view details)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

mssm-0.1.27-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl (233.7 kB view details)

Uploaded CPython 3.12 manylinux: glibc 2.17+ i686

mssm-0.1.27-cp312-cp312-macosx_10_9_x86_64.whl (200.6 kB view details)

Uploaded CPython 3.12 macOS 10.9+ x86-64

mssm-0.1.27-cp311-cp311-win_amd64.whl (183.1 kB view details)

Uploaded CPython 3.11 Windows x86-64

mssm-0.1.27-cp311-cp311-win32.whl (168.1 kB view details)

Uploaded CPython 3.11 Windows x86

mssm-0.1.27-cp311-cp311-musllinux_1_1_x86_64.whl (746.0 kB view details)

Uploaded CPython 3.11 musllinux: musl 1.1+ x86-64

mssm-0.1.27-cp311-cp311-musllinux_1_1_i686.whl (799.6 kB view details)

Uploaded CPython 3.11 musllinux: musl 1.1+ i686

mssm-0.1.27-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (229.0 kB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

mssm-0.1.27-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl (234.0 kB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ i686

mssm-0.1.27-cp311-cp311-macosx_10_9_x86_64.whl (203.4 kB view details)

Uploaded CPython 3.11 macOS 10.9+ x86-64

mssm-0.1.27-cp310-cp310-win_amd64.whl (182.1 kB view details)

Uploaded CPython 3.10 Windows x86-64

mssm-0.1.27-cp310-cp310-win32.whl (166.8 kB view details)

Uploaded CPython 3.10 Windows x86

mssm-0.1.27-cp310-cp310-musllinux_1_1_x86_64.whl (744.7 kB view details)

Uploaded CPython 3.10 musllinux: musl 1.1+ x86-64

mssm-0.1.27-cp310-cp310-musllinux_1_1_i686.whl (798.5 kB view details)

Uploaded CPython 3.10 musllinux: musl 1.1+ i686

mssm-0.1.27-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (227.5 kB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

mssm-0.1.27-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl (233.0 kB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ i686

mssm-0.1.27-cp310-cp310-macosx_10_9_x86_64.whl (202.0 kB view details)

Uploaded CPython 3.10 macOS 10.9+ x86-64

File details

Details for the file mssm-0.1.27-pp310-pypy310_pp73-win_amd64.whl.

File metadata

File hashes

Hashes for mssm-0.1.27-pp310-pypy310_pp73-win_amd64.whl
Algorithm Hash digest
SHA256 d5b4647c9de8bef8debd67afa099621188f0981b8ef2d5432aca15c22fbbb84d
MD5 68553750ea63b6010d9e9546782c316e
BLAKE2b-256 a9998c69c3e41881e19fcc0aadd46cdddcc64f9982aeb089485bc793df1aabb5

See more details on using hashes here.

File details

Details for the file mssm-0.1.27-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for mssm-0.1.27-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 820ded554090cffbec5fe222034310ee4b94ffa21015d27095d553c666b50694
MD5 5f204a4979bea480cc318e5966d32746
BLAKE2b-256 73da9ab47465c58613879c69bbc17584666d5f891cbeebb43c66351c0b6e042c

See more details on using hashes here.

File details

Details for the file mssm-0.1.27-pp310-pypy310_pp73-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for mssm-0.1.27-pp310-pypy310_pp73-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 666c9961c199716b2e5cded9438d0b7dd696df51b8b79fc895e87ce3255a5a27
MD5 ab75e5c6e49b456bd68a6f4e8ab66901
BLAKE2b-256 aeadf1fd0f207a5575ee377df4bc26b9d2ec7a23765de1a07afa1ce6a41215ed

See more details on using hashes here.

File details

Details for the file mssm-0.1.27-pp310-pypy310_pp73-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for mssm-0.1.27-pp310-pypy310_pp73-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 a2ce52fa2ecf1fc4bdd0cd756c7ad0f7900172765ded388dfba3bf17a84c19c3
MD5 5885fb38e12e033c57bf3f49a676ce79
BLAKE2b-256 4ac122d65446d7d6fb0eaf7c7b527803f80a6ff8abfb48072682aaea04917e73

See more details on using hashes here.

File details

Details for the file mssm-0.1.27-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: mssm-0.1.27-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 182.3 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.8

File hashes

Hashes for mssm-0.1.27-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 4f43e2beef61b2247d6c30b2fde3f6ec3e26121be6880471c2c94fc8006da33e
MD5 5569960dfd2098c8203c0b6d19480d33
BLAKE2b-256 22867cd7eac84d5fb8dabe5395b4fb8dbebbc42fbcccb5256f22bf3e83143d6b

See more details on using hashes here.

File details

Details for the file mssm-0.1.27-cp312-cp312-win32.whl.

File metadata

  • Download URL: mssm-0.1.27-cp312-cp312-win32.whl
  • Upload date:
  • Size: 167.4 kB
  • Tags: CPython 3.12, Windows x86
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.8

File hashes

Hashes for mssm-0.1.27-cp312-cp312-win32.whl
Algorithm Hash digest
SHA256 5bfed46dba897bf6ff8579a50e73f57077eda2bf9af1378a299e637834fba8d1
MD5 b534789966f2271140b89a65a223fe9c
BLAKE2b-256 229fbd23d08561a7e09254c8960e8bdb6e5c51956f039f9e497183b493660777

See more details on using hashes here.

File details

Details for the file mssm-0.1.27-cp312-cp312-musllinux_1_1_x86_64.whl.

File metadata

File hashes

Hashes for mssm-0.1.27-cp312-cp312-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 35829de18aecb6be1e232055dc9d6e924c1a30966617f30416efad6b4fd371c2
MD5 40acc53e920f288d935eb46362e50be6
BLAKE2b-256 c3bf15245a758514c79f5f5836bce0b619d26f9ecb0d635550aa597002203aa7

See more details on using hashes here.

File details

Details for the file mssm-0.1.27-cp312-cp312-musllinux_1_1_i686.whl.

File metadata

File hashes

Hashes for mssm-0.1.27-cp312-cp312-musllinux_1_1_i686.whl
Algorithm Hash digest
SHA256 f0b94dd5a483499438bab3bd8365d04db9c9ab19e6b3c2c83ed677408fcdee37
MD5 c26113bd5f2fe28660e4fdb22207b6a7
BLAKE2b-256 ecb69d4236f5a99ff451362cfe16ab9552ec0bf9b0e37a4e8d5d4b7ecf172b79

See more details on using hashes here.

File details

Details for the file mssm-0.1.27-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for mssm-0.1.27-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b5c429bb3026cd48fc0566e76e7554ed6b16ba4ab8bbc687f92366edd7feefa7
MD5 22f55312d79cfa46fcc2308bbb9bf1ff
BLAKE2b-256 cd9c44692a606bcea43d2ef70ba75cae40b891e3eb2a7eedfa808db9aae9d382

See more details on using hashes here.

File details

Details for the file mssm-0.1.27-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for mssm-0.1.27-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 87a11b8cdc0fcc3449212b0ec6ea56c207bd0699d979619bc1c97a0e38610f58
MD5 96d4d724b9ba9b2a6db059e069946fb4
BLAKE2b-256 0e2c928fa17dcb74dcd4c72d5b82795772db83ad568ef40e3a2acc4ca3779efd

See more details on using hashes here.

File details

Details for the file mssm-0.1.27-cp312-cp312-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for mssm-0.1.27-cp312-cp312-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 4b124e54f7ec251f5c0e2d6d311eb17b9632436dfe5fbfd6ff6a620d0e211137
MD5 abf015f96080e6419e98b5b9abbed6da
BLAKE2b-256 11ab2059e5a36b83cfb5ec7ae75ce00614fd340dc2ff98ad80439dc2f7a1eac3

See more details on using hashes here.

File details

Details for the file mssm-0.1.27-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: mssm-0.1.27-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 183.1 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.8

File hashes

Hashes for mssm-0.1.27-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 9a8a9680939801ec2dc35a91bd12bd6c4c1c1bc1281894861acffef1e6272f15
MD5 5a52c98109af10baae749e3028689b0d
BLAKE2b-256 3b4a99920b29a387549d57034a83d6b5a9f9219fd78c1315884511cbfe826e1e

See more details on using hashes here.

File details

Details for the file mssm-0.1.27-cp311-cp311-win32.whl.

File metadata

  • Download URL: mssm-0.1.27-cp311-cp311-win32.whl
  • Upload date:
  • Size: 168.1 kB
  • Tags: CPython 3.11, Windows x86
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.8

File hashes

Hashes for mssm-0.1.27-cp311-cp311-win32.whl
Algorithm Hash digest
SHA256 873d95b1eba45d581ea95d3033360338ff92c01a6f117240cf7f899339d48f71
MD5 956e1dc5c9eb2fb71aabddb0fefcbf4c
BLAKE2b-256 85bc040e4ed4590b78540968707dcfa0f97b0de84a74b736c125bb5bda8fdb04

See more details on using hashes here.

File details

Details for the file mssm-0.1.27-cp311-cp311-musllinux_1_1_x86_64.whl.

File metadata

File hashes

Hashes for mssm-0.1.27-cp311-cp311-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 5335983e11e82554bdcdd006bca71613ddf36ac9b8561c390d257b0dd2f1b09b
MD5 9fa1524f8e6f169d4fbd1c7098f6bc06
BLAKE2b-256 ea4ae5d0af41e5cea733f1046a222daad717478e38d9fbc64801402ce062dc57

See more details on using hashes here.

File details

Details for the file mssm-0.1.27-cp311-cp311-musllinux_1_1_i686.whl.

File metadata

File hashes

Hashes for mssm-0.1.27-cp311-cp311-musllinux_1_1_i686.whl
Algorithm Hash digest
SHA256 1e90df9f314d6a05bf6def6b48f8f55803ace657f040eb1a22c67a4a43459a97
MD5 fcea1cafe220354e5b87bde72aa71b75
BLAKE2b-256 c90c57ca91b8c63d91fdba0a0396dfe14eba4629b0ec6380cff08c780a110fc8

See more details on using hashes here.

File details

Details for the file mssm-0.1.27-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for mssm-0.1.27-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c1c32668976d43175ce8679f725e941c48067ac7b32574167bdbdcc64e1c32a7
MD5 17c8c7c24ef2a354e72280eba31be4a6
BLAKE2b-256 d345eed6642c566b39dd011f272baf19d48f817c8336fa8348e1fc86bf2e32d1

See more details on using hashes here.

File details

Details for the file mssm-0.1.27-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for mssm-0.1.27-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 5b066a5c69a39f01d107e0700823208fbbbb75038edb110cb4aff68e98750c31
MD5 bb07014df11f6ba8af605fcaccab7318
BLAKE2b-256 4e23d6cd65fb649fe31750506e6524c2fd584d45cbd9d36a94d772b2c09c60f3

See more details on using hashes here.

File details

Details for the file mssm-0.1.27-cp311-cp311-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for mssm-0.1.27-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 c351a6a749f86c5aae254f82bab2c00f76c55f12b4c5f441b87888f2d08e8ee0
MD5 465be7174220c15fa523ced83d855885
BLAKE2b-256 b62c624f78eb9bf7e9b3dc4b764edc48e696ea1427fc665d5b5e6840e9c7b9a7

See more details on using hashes here.

File details

Details for the file mssm-0.1.27-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: mssm-0.1.27-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 182.1 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.8

File hashes

Hashes for mssm-0.1.27-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 cc4729bfa73f7aca89a1a5488a8a94b13e3106b89877bb817310d0e19acbcc88
MD5 b386f5d42093767afce12366dfadc795
BLAKE2b-256 8fbff55b85d89312e89a47e5909383af06529174624abb2e0c21651bf955a3d4

See more details on using hashes here.

File details

Details for the file mssm-0.1.27-cp310-cp310-win32.whl.

File metadata

  • Download URL: mssm-0.1.27-cp310-cp310-win32.whl
  • Upload date:
  • Size: 166.8 kB
  • Tags: CPython 3.10, Windows x86
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.8

File hashes

Hashes for mssm-0.1.27-cp310-cp310-win32.whl
Algorithm Hash digest
SHA256 7496984e93cbf802b33af51c0fffd99344fd8380fecc82c9e52bd5f74f45344b
MD5 efba37af40db5874813ec0c676245065
BLAKE2b-256 5076b8f23e7065f6740f3eeca0e990672cef077ce6a6bb9a7ae44919e32f087f

See more details on using hashes here.

File details

Details for the file mssm-0.1.27-cp310-cp310-musllinux_1_1_x86_64.whl.

File metadata

File hashes

Hashes for mssm-0.1.27-cp310-cp310-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 97feb16682db034f1d5d36eebbc4a3126aa2df9098dd900135f663f8731eeceb
MD5 573ea03baf3a28219195d80f80c6afdd
BLAKE2b-256 deee5b186fefc219431e69bdaeb19bd6c706251a531042b2fc2a65fac28e472b

See more details on using hashes here.

File details

Details for the file mssm-0.1.27-cp310-cp310-musllinux_1_1_i686.whl.

File metadata

File hashes

Hashes for mssm-0.1.27-cp310-cp310-musllinux_1_1_i686.whl
Algorithm Hash digest
SHA256 b798a95cf2f9e0319561f0c30340f1aebff341a9a14bec13c20c6549e158fb93
MD5 f44a4f2d1d69b65310532745401ccd23
BLAKE2b-256 1639d09886f630de0a7fa087bc91554af5f6e852788ac2e4ea2cccfff9f12f88

See more details on using hashes here.

File details

Details for the file mssm-0.1.27-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for mssm-0.1.27-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 868555920439157118187e7029083c6cdfdb7076f8869088c741129dcb444e7c
MD5 eb4c5946e1ccfe72ab7e435af728474c
BLAKE2b-256 f17dba1d46919d24c2bfb34ac9664e2649ec5bfba5512d1526a326a85016b16e

See more details on using hashes here.

File details

Details for the file mssm-0.1.27-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for mssm-0.1.27-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 312a0183e7b69817b1238525dcfc6122faaa2bf68e67a72cd01a80f75204b452
MD5 da09a21b35feb1bfc1618281d194ce96
BLAKE2b-256 a866866db35186c7ad2c54fca8b68e42f914c66b8da66254bc27fadc843d475f

See more details on using hashes here.

File details

Details for the file mssm-0.1.27-cp310-cp310-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for mssm-0.1.27-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 0b3b64f49b51dfc5dec58f6a64af343ba0970ec121c3891f92fd91631e08dad2
MD5 3d316af971e5e7b6f6c00822ab78fbad
BLAKE2b-256 8de5b83fb868d5cdcee0010d75e1204c022b22c61e0c4b6d439deea024ce1125

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page