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

Uploaded PyPy Windows x86-64

mssm-0.1.26-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (213.4 kB view details)

Uploaded PyPy manylinux: glibc 2.17+ x86-64

mssm-0.1.26-pp310-pypy310_pp73-manylinux_2_17_i686.manylinux2014_i686.whl (219.9 kB view details)

Uploaded PyPy manylinux: glibc 2.17+ i686

mssm-0.1.26-pp310-pypy310_pp73-macosx_10_9_x86_64.whl (188.5 kB view details)

Uploaded PyPy macOS 10.9+ x86-64

mssm-0.1.26-cp312-cp312-win_amd64.whl (174.9 kB view details)

Uploaded CPython 3.12 Windows x86-64

mssm-0.1.26-cp312-cp312-win32.whl (160.5 kB view details)

Uploaded CPython 3.12 Windows x86

mssm-0.1.26-cp312-cp312-musllinux_1_1_x86_64.whl (738.3 kB view details)

Uploaded CPython 3.12 musllinux: musl 1.1+ x86-64

mssm-0.1.26-cp312-cp312-musllinux_1_1_i686.whl (792.3 kB view details)

Uploaded CPython 3.12 musllinux: musl 1.1+ i686

mssm-0.1.26-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (221.2 kB view details)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

mssm-0.1.26-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl (226.8 kB view details)

Uploaded CPython 3.12 manylinux: glibc 2.17+ i686

mssm-0.1.26-cp312-cp312-macosx_10_9_x86_64.whl (193.2 kB view details)

Uploaded CPython 3.12 macOS 10.9+ x86-64

mssm-0.1.26-cp311-cp311-win_amd64.whl (175.8 kB view details)

Uploaded CPython 3.11 Windows x86-64

mssm-0.1.26-cp311-cp311-win32.whl (161.3 kB view details)

Uploaded CPython 3.11 Windows x86

mssm-0.1.26-cp311-cp311-musllinux_1_1_x86_64.whl (738.9 kB view details)

Uploaded CPython 3.11 musllinux: musl 1.1+ x86-64

mssm-0.1.26-cp311-cp311-musllinux_1_1_i686.whl (792.8 kB view details)

Uploaded CPython 3.11 musllinux: musl 1.1+ i686

mssm-0.1.26-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (221.6 kB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

mssm-0.1.26-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl (226.6 kB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ i686

mssm-0.1.26-cp311-cp311-macosx_10_9_x86_64.whl (196.1 kB view details)

Uploaded CPython 3.11 macOS 10.9+ x86-64

mssm-0.1.26-cp310-cp310-win_amd64.whl (174.8 kB view details)

Uploaded CPython 3.10 Windows x86-64

mssm-0.1.26-cp310-cp310-win32.whl (160.0 kB view details)

Uploaded CPython 3.10 Windows x86

mssm-0.1.26-cp310-cp310-musllinux_1_1_x86_64.whl (737.6 kB view details)

Uploaded CPython 3.10 musllinux: musl 1.1+ x86-64

mssm-0.1.26-cp310-cp310-musllinux_1_1_i686.whl (791.7 kB view details)

Uploaded CPython 3.10 musllinux: musl 1.1+ i686

mssm-0.1.26-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (220.4 kB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

mssm-0.1.26-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl (225.8 kB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ i686

mssm-0.1.26-cp310-cp310-macosx_10_9_x86_64.whl (194.6 kB view details)

Uploaded CPython 3.10 macOS 10.9+ x86-64

File details

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

File metadata

File hashes

Hashes for mssm-0.1.26-pp310-pypy310_pp73-win_amd64.whl
Algorithm Hash digest
SHA256 e353786b8216f712a73b6bdf67279071ea80427e0c7365269a60f98cf65a34db
MD5 7f6390b5d3fe8c69f26264b678604614
BLAKE2b-256 297bedd3d63b16ca80e1f4d5cc12abacbbf793c2c0c9e4766a3898db4cbdd8ec

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mssm-0.1.26-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 72f614988a7b77d216a0a0dc34b141207fed5afbc77f986c78f1f4041424a4c9
MD5 4097ffd1fd214cd9f18710eb8bcfb611
BLAKE2b-256 219580aff906286ee3e286ce340c265409ca255d33111c052e8cc28452dbbcb6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mssm-0.1.26-pp310-pypy310_pp73-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 3d754fb3e7cdcd68cd040c6d51417b117cfd4979ed579e8c6bb15d65d61ab713
MD5 0a754f9eec9d5a46baa42ca8dd21929c
BLAKE2b-256 8a913f065f05de920c8efd933a27f2becd36b23b136fcfb7dc34aad7942ca591

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mssm-0.1.26-pp310-pypy310_pp73-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 13b1ea326a60788fba8ef9640420e308962f302e0f145a268ce12a3eea30531b
MD5 002b830f0bccacd1bf2d5f953dec7f4f
BLAKE2b-256 6b358632ffa38af488f307642037a1208d4e4e4111c5eee55ac91f2453975716

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for mssm-0.1.26-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 af94e9dde815cc28e64a385c72a98225833508cac3d5eb1bdfcf35d420211b18
MD5 5d7ce64c4f98e816f131626579cb48f1
BLAKE2b-256 3d438983d267e9fb17ac5c5a2515bf0c711ec19b5de26e7349bcd5427f4e8ac9

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for mssm-0.1.26-cp312-cp312-win32.whl
Algorithm Hash digest
SHA256 b57d2a1821c76981265a32906794502f4fc5698dddcfb1ec84896e97ccb5ddb0
MD5 c2ebeea401351eae4e1c64dda628cf8f
BLAKE2b-256 de5d768939b70ecfcd7b61bf86db3c0435667e12d004ceaf69946fa120afd644

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mssm-0.1.26-cp312-cp312-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 d5eda4d767b5839215ad6ec2f8399d038271d8551f3cdecf6c06a023d737bab3
MD5 35e9377111c441a0cbdba008f2fbd1a2
BLAKE2b-256 488be17a097834abcb71e1e0bb690297e6471591e2e9defe7000a6d060b5653e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mssm-0.1.26-cp312-cp312-musllinux_1_1_i686.whl
Algorithm Hash digest
SHA256 d9cfdcef2ccfdd88f339a6ae78bad73315adb068dcd70b39aab28979aeaf9381
MD5 4ec292129747e4289fca93f2cab32bcc
BLAKE2b-256 f427a8cccd723262d3496baa2ff550eed302b653e0eacba19477dd4f594462cc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mssm-0.1.26-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2abb9c75a217875b047e0d6fc769bbd7deeddba986a98e552dcd384a2d4730f3
MD5 2c5dd29b506fb3eac136b5dd3dc15f5d
BLAKE2b-256 3c34dd3ddf100487ef6577b1c04b7a72ad3ec56ccee60ca654a7095769b96039

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mssm-0.1.26-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 7b39bbc2a66c5e30faea1f25fc44c04fe7e82e94280f71aa67ad22b8f8a04935
MD5 c3b202f9940a45073f7c53d2094a0483
BLAKE2b-256 cbae0b327c77aca1c9578e370c54ac10451e3e6c96756c514d8edbbb02d125ef

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mssm-0.1.26-cp312-cp312-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 511fdb801f388f49cc130f32f1969a36ef161606d35d208f9671c4b70fae93d3
MD5 7feb870f4cd36482951446629ed828cc
BLAKE2b-256 e8097270610743636c681a7c672ac5b34dd89bf6a9bf675c90d0ce64ca52f742

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for mssm-0.1.26-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 6eb5902f9e763125c743ded27b433db575d833a453a6f0c43d802e1ece43f833
MD5 7f2f6fef4329c5569b86c4dec6c5839b
BLAKE2b-256 d23c6eca461040d8c95bd06ddfceeb7d8e249923a730af0d027771e9607aad5d

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for mssm-0.1.26-cp311-cp311-win32.whl
Algorithm Hash digest
SHA256 32d192592eaa54e578edba198ee53d14f150ad3c0bf5eeaac2d00bfa908b0114
MD5 916d3e59f627d3d38c1221d01a1ba473
BLAKE2b-256 c31776eaca838ccc774db3d298c2a499b9d8a8826d60c0ab123f20f2f5fec613

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mssm-0.1.26-cp311-cp311-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 b4c71700dd287fe628610a5551ebfd41d8df0a82ef7f3b3ac3292771040b3089
MD5 6a990002bc60a79bcb97762b79e75bb0
BLAKE2b-256 54efbd06ad5e6f9abea4f356ab23766846804b6c381341014550b9559e5ca340

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mssm-0.1.26-cp311-cp311-musllinux_1_1_i686.whl
Algorithm Hash digest
SHA256 f141c0b5090445394030ac292a438418d36c70beed2a222874ec9eb2dcb1d1fc
MD5 46e789852f72c8c7bacd0f76c20f0a7e
BLAKE2b-256 acfcfe8bcd2342db995382c3b63690bc571a229a2c8fd4ef110e4fcccf6fdb51

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mssm-0.1.26-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c9af260050db7f28e1842a9ad5058fc62c57e43ed5bd113d3cbdb2be2163acbb
MD5 7bd822605b2363427fedc54b12c28453
BLAKE2b-256 3d2ff0496a1e3e1bc03cf399a2f4f34f5b532994b5b7af0fea261fe4418e0282

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mssm-0.1.26-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 caa26a50cb387c9aece395d5924f845723f187ff8562154aa5b4a9cfb2106b4d
MD5 d41a91b709d23e3ec22de7553ffd11d4
BLAKE2b-256 170acd3f902441cfc88ef2d99f96a1c73210d19cb00bea40f8b28d967eaed48a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mssm-0.1.26-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 f9ba77944cf6aac7d10c48072c83e13c63aef98ca16e78e8dc905bc60d384545
MD5 3e185c908a1062f98b4f70c66f432096
BLAKE2b-256 1244ac8d825962e3b8f52f34d43c36ebe80c593ecb622811a861ce1c3e7dda93

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for mssm-0.1.26-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 32183e256f9cb4dcd28a8b6b4081b83080984333b80612578b9b1e8771a60cf5
MD5 442994952aa10f5be3d528d7045f81a2
BLAKE2b-256 14607b70ff5d0fa606af4e3dbe7d1bbd7518d19571f3528e7e41cebd07a81f3c

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for mssm-0.1.26-cp310-cp310-win32.whl
Algorithm Hash digest
SHA256 1f0fefb910719240ab594521fd981237fa626cdcc4aabaed829e59243efd24b6
MD5 3615697b4040e26cbaae7a62499fff4b
BLAKE2b-256 5141e360f1bcd63a52d7ac76ef432a47601071b1730ba97733fa044063394ca6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mssm-0.1.26-cp310-cp310-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 3aa97329fbf9a381aaebfcd52b5563c945663ae1cbb29f78595059733b8a741f
MD5 ede754663a8e26aaf68465ede8317cb7
BLAKE2b-256 c2feeab2612bf46107ed4eb8e1523d05ab99d84b6f6814b1fe552aeb1e21a1f5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mssm-0.1.26-cp310-cp310-musllinux_1_1_i686.whl
Algorithm Hash digest
SHA256 d4ecd3926594df0604f2dd70eedc341ff907646f4244a9431684325352927b1b
MD5 a8e70cf2794d872e90624a5ca29f3f65
BLAKE2b-256 0b281d17558b51741e66da487e892a72c53d22205c5e3b663b887955fa56371f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mssm-0.1.26-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1ce01792b56d8fc02a0e951ba3903fa473a3c7a7a94c3039626f08ec9e337192
MD5 413e729ebf4ca68ab12fe11e2cd2579d
BLAKE2b-256 737a13916920ed758972e69b38259a220b9b7d547b4d53e91e3f66dd62f863c8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mssm-0.1.26-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 81d869f01b7157e5f084687d7632eaa4f6b376fee489098687bd9a0ca3d8c96f
MD5 df0ff35b5f69d4c02272443b831c6e43
BLAKE2b-256 594c92072b5e2524ca997cdd103f1ce3d5a9f0c4c39eb6eade8a5e528c542dd0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mssm-0.1.26-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 8872fce4643f49c5ed0c469c62f716678b5c682b0ec5aa7b652a23f4ee03b3ac
MD5 0f323ce2bacd9395c947a961cf8275ea
BLAKE2b-256 119a4dceb68183854a8dd5bf92d742a80c48281ef7f62b1db7d0c5f9217ba302

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