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.28-pp310-pypy310_pp73-win_amd64.whl (191.0 kB view details)

Uploaded PyPy Windows x86-64

mssm-0.1.28-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (228.1 kB view details)

Uploaded PyPy manylinux: glibc 2.17+ x86-64

mssm-0.1.28-pp310-pypy310_pp73-manylinux_2_17_i686.manylinux2014_i686.whl (234.7 kB view details)

Uploaded PyPy manylinux: glibc 2.17+ i686

mssm-0.1.28-pp310-pypy310_pp73-macosx_10_9_x86_64.whl (203.3 kB view details)

Uploaded PyPy macOS 10.9+ x86-64

mssm-0.1.28-cp312-cp312-win_amd64.whl (191.0 kB view details)

Uploaded CPython 3.12 Windows x86-64

mssm-0.1.28-cp312-cp312-win32.whl (174.4 kB view details)

Uploaded CPython 3.12 Windows x86

mssm-0.1.28-cp312-cp312-musllinux_1_1_x86_64.whl (752.7 kB view details)

Uploaded CPython 3.12 musllinux: musl 1.1+ x86-64

mssm-0.1.28-cp312-cp312-musllinux_1_1_i686.whl (806.3 kB view details)

Uploaded CPython 3.12 musllinux: musl 1.1+ i686

mssm-0.1.28-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (235.1 kB view details)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

mssm-0.1.28-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl (241.7 kB view details)

Uploaded CPython 3.12 manylinux: glibc 2.17+ i686

mssm-0.1.28-cp312-cp312-macosx_10_9_x86_64.whl (208.2 kB view details)

Uploaded CPython 3.12 macOS 10.9+ x86-64

mssm-0.1.28-cp311-cp311-win_amd64.whl (191.9 kB view details)

Uploaded CPython 3.11 Windows x86-64

mssm-0.1.28-cp311-cp311-win32.whl (174.7 kB view details)

Uploaded CPython 3.11 Windows x86

mssm-0.1.28-cp311-cp311-musllinux_1_1_x86_64.whl (753.3 kB view details)

Uploaded CPython 3.11 musllinux: musl 1.1+ x86-64

mssm-0.1.28-cp311-cp311-musllinux_1_1_i686.whl (806.9 kB view details)

Uploaded CPython 3.11 musllinux: musl 1.1+ i686

mssm-0.1.28-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (235.1 kB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

mssm-0.1.28-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl (242.0 kB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ i686

mssm-0.1.28-cp311-cp311-macosx_10_9_x86_64.whl (210.8 kB view details)

Uploaded CPython 3.11 macOS 10.9+ x86-64

mssm-0.1.28-cp310-cp310-win_amd64.whl (190.9 kB view details)

Uploaded CPython 3.10 Windows x86-64

mssm-0.1.28-cp310-cp310-win32.whl (173.6 kB view details)

Uploaded CPython 3.10 Windows x86

mssm-0.1.28-cp310-cp310-musllinux_1_1_x86_64.whl (752.3 kB view details)

Uploaded CPython 3.10 musllinux: musl 1.1+ x86-64

mssm-0.1.28-cp310-cp310-musllinux_1_1_i686.whl (805.6 kB view details)

Uploaded CPython 3.10 musllinux: musl 1.1+ i686

mssm-0.1.28-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (234.4 kB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

mssm-0.1.28-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl (240.3 kB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ i686

mssm-0.1.28-cp310-cp310-macosx_10_9_x86_64.whl (209.4 kB view details)

Uploaded CPython 3.10 macOS 10.9+ x86-64

File details

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

File metadata

File hashes

Hashes for mssm-0.1.28-pp310-pypy310_pp73-win_amd64.whl
Algorithm Hash digest
SHA256 8c7c226b0627ba53fa1dd9954bee72699724a0d50735b78d8c5ea33f61906051
MD5 c738031cb62e61e906cd07303202d95e
BLAKE2b-256 83b403f29e064c443857eafcdb90c41565284e45a8008fb8725f4c4b0f398d30

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mssm-0.1.28-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 061c905f400d5b1880ed35b02e6de2a77b18e2814edd8e9096c424b141eebbe2
MD5 3a1e106d9d0294db7fd01b8e27b01646
BLAKE2b-256 88a7a74e9904d9103a29d940cb685d8c76b51ecaa7b56ed40d1713c8ac829323

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mssm-0.1.28-pp310-pypy310_pp73-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 07c0c9c92abc5e0c1c889102e44ed06e51d8b3f20f4ffa15cacc09521d442c91
MD5 b3de371fbf79f8eb633ae80a1061b4f8
BLAKE2b-256 c8a98134f53995e30625c85e2512e9cdbd9b0ac0c0206335aefbbb5e33708231

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mssm-0.1.28-pp310-pypy310_pp73-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 f7aa3e16d8ec2d237b9e05fed420e2c6e4eceeab4d9e045ae4465cab36e9b7bc
MD5 540a0bf28d0033ffe9fb8a455fe6c743
BLAKE2b-256 843fc34512344ee8a2ee11c3b3af91483228e017d01a9d47b80daba3725755cd

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mssm-0.1.28-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 191.0 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.28-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 b2f3b24af4254befb8359a756985cf4df1afda0b7c08821ecdab8b1e100651b8
MD5 228da3d4dbf36fd3f2da62339b55e152
BLAKE2b-256 c2780dfa8432a69fceeeda62a911da012b763e46b9be05415c04669d5d1f1cc4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mssm-0.1.28-cp312-cp312-win32.whl
  • Upload date:
  • Size: 174.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.28-cp312-cp312-win32.whl
Algorithm Hash digest
SHA256 ff45df0df205ba6048e5765550e56afd6f77eab8356f443be34985999df3e0f6
MD5 621ab16573cce63a6165e6a8470f637c
BLAKE2b-256 6a85e960669a33f110bde9d0839b153affb7dcb810e7585500206d639bceb122

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mssm-0.1.28-cp312-cp312-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 5a8978f3ea38c0e6ba02ad406ee8bcbda5e44321e7e82980c13c922ea9dfd07b
MD5 a073d02058d21eee3a45a028d432d69b
BLAKE2b-256 b03a980a01a86a4d2fc5f9da3bcdace8178264e8c7dc2a6b8b1d1b4dcc857d09

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mssm-0.1.28-cp312-cp312-musllinux_1_1_i686.whl
Algorithm Hash digest
SHA256 7cde5f9ca26ca05bae79661529af959c5bf71504fd1176a5debeb134d22a2fda
MD5 781794e2b55641380d1b55b75001d9be
BLAKE2b-256 64945b3c6e6021b35fb97424b92bbe910005f3980ac8f07a4cd1d7f9cf41cefe

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mssm-0.1.28-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 9ac5d85b3a403652054c36859568de80167067f2c48fbe8a2e2485e1a4aa2941
MD5 c783c1576a420a8cef76d4c6c80ebbdc
BLAKE2b-256 049329c4e07b5fe3718ed50ad186f40ad633362706c32320c4c1d4f6fe661326

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mssm-0.1.28-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 3757c447fd0ed6f53900625f8a4840d97ee2f8af7c4323b4223b4ce83a318bae
MD5 1d2dfd5324a611f6e60e3486b2d8184f
BLAKE2b-256 892bbe0f136b2cf218077dcdd6471e6b200e18f74b428b31a285a03b667cc467

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mssm-0.1.28-cp312-cp312-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 38a151e24cde58f6656af7c41cb2d5b2fb704a4421558d5d2ce7864a583abf5a
MD5 b0070c6441346d7cb0bd88be71d97826
BLAKE2b-256 9a02f5069c15436d74312331ca420c418b928a16990b9b0d7e431ced224cca17

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mssm-0.1.28-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 191.9 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.28-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 9f41e4383829a136149271275185188321c651da502e4cda90fccd90d21c6f66
MD5 d0e8de5288a23588c11b0bd1ac17cb7f
BLAKE2b-256 59f3da1ee2fed4d693062a853b50e2946fdf9aeef602c7603c339a2b4898ef2a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mssm-0.1.28-cp311-cp311-win32.whl
  • Upload date:
  • Size: 174.7 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.28-cp311-cp311-win32.whl
Algorithm Hash digest
SHA256 8ca4a331ac8a337f5cff4fea669475894fb3f7694a942af1431c209b01086f47
MD5 839ebb74d184994f211cf6f105d6d0f8
BLAKE2b-256 f42e590b32180e90e354697f0a9425fb6a9c74ab9a524c4637186fd8e394a9cc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mssm-0.1.28-cp311-cp311-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 afb1cc40305cf984816ea3d2ea1942062f1324166f213039b4f20105a066bc44
MD5 25be8d6b75ae0811df8a42dc6041ad1e
BLAKE2b-256 f48cf7c87dd915fe9a402bd89e09026213426c80a384ab4feb3249aac27c0f9e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mssm-0.1.28-cp311-cp311-musllinux_1_1_i686.whl
Algorithm Hash digest
SHA256 4c162ab7107da994148aad6b49d42ee84c9680938ea75e2c6bf7711360a696b7
MD5 615fefd89b08598e379daf027bbf2a67
BLAKE2b-256 a4c87f6e1844d748b1be5b2669d72ce888e6bd3446f6e27e2c23da37c0f2f1ec

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mssm-0.1.28-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 66339f6a3e636437cdb32410a771e879c69b1281baf86b2becf21638ce14cd00
MD5 1ff34c8bad0e5821ab55a93668425733
BLAKE2b-256 dbbb2841fc61acd8c2ef049038ecd3fa3e694baba9f3f13e12d2509d28e6a927

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mssm-0.1.28-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 7604b066eceae4eab5ab69ba2a2318ec16137c7ad53703bbb024cb71f16f8f6c
MD5 c0351e906b0b7cbad2103f82bb5d5d2f
BLAKE2b-256 af77a4ab3cdfa89dee9f1786bcfa445fd266bc21aaed73cbcb417f8332d13ec8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mssm-0.1.28-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 02131eee3ea2e4caa8858cb2bfb94807635ac9b404446832d97a725a5dac553e
MD5 e2fd467b40618d4eece3cd43ac56a172
BLAKE2b-256 51acf65fc09eec26ce0b6642d6396804044080505ebaec5ca4f7c426af4eeae5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mssm-0.1.28-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 190.9 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.28-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 6ab07488144710d334ed7f6e63e6a9de60fa5b8d261bf57a683883c8bc5d5c57
MD5 7895a27ee8ef770f27f27f4523bcccf8
BLAKE2b-256 af9897a9bddb9277bab02241697aa70fff16369798964e03b9c9fafac81c37dc

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mssm-0.1.28-cp310-cp310-win32.whl
  • Upload date:
  • Size: 173.6 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.28-cp310-cp310-win32.whl
Algorithm Hash digest
SHA256 a754525fff53d5ca8d020370528af310da98385ae8f287af007d1d3fa9f27737
MD5 314b159fd88f5055284789065a26c33a
BLAKE2b-256 8b1c5b7779e930fe6f1c9865bced872536e97bfb804fcbb17ac8aebed70f5204

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mssm-0.1.28-cp310-cp310-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 7ae882c312289fe9aea3eab5576aacee398ad6b8244476e6a225493ce7550b1d
MD5 443bb5d72dd379e7930c80c53e27510a
BLAKE2b-256 1de6f444fe34a7866818f02954455d698b311c69a515f0b2e991f80bbb885668

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mssm-0.1.28-cp310-cp310-musllinux_1_1_i686.whl
Algorithm Hash digest
SHA256 68e5e4b22f066434ac0ce7cc92a9453225db72eb7378b0339bc8c6ca1e3d68fa
MD5 0308e83d23bf8d67f2c594302c7f6fd2
BLAKE2b-256 7320bcb6ddf871a409fe18a58ec2207e3cb4370cf9fc83a936b449c3f514c836

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mssm-0.1.28-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 27ba06fd2590e33f49032d490c5558ae744b730ba1b400a9268a73b52cfe6ae9
MD5 162217a268d0ed31b958e99256eea6f7
BLAKE2b-256 ff4994fe6812a591f4bd5a44a11242a5beedd1916c1273d94f288668d1cad348

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mssm-0.1.28-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 e1ace70a5ffc9c2d68fdb7fcda072a656cc34304b3d3af201514f4ad55d519f6
MD5 e551e1c0d964dc5a662f5db2c1110a47
BLAKE2b-256 6401185d477a30e6e87174f021ed74d8eaabd6cca34dcbd77b48198304026f29

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mssm-0.1.28-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 4716e26979c9f054aa4ad6e96dc0ba46ea37f1a3710dc92e1ddbe8ad418b9486
MD5 dce57d10d404f8a5877cc01e655b4e19
BLAKE2b-256 3b0b1bb2a999b4288270daff031fd43b0c8aa77c47af1f94070d41e4d9340f6d

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