Generalized drift diffusion modeling for Python
Project description
PyDDM - Generalized drift-diffusion models for Python
Overview
PyDDM is a simulator and modeling framework for generalized drift-diffusion models (DDM). Key features include:
- Fast solutions for drift-diffusion models (DDM) and generalized drift-diffusion models (GDDM)
- Easy and flexible syntax for building models
- Arbitrary Python functions define parameters for drift rate, noise, bounds, non-decision time, and starting position
- Graphical interface for exploring new models
- Multiprocessor support
See the documentation, FAQs, or tutorial for more information. If you want to try it out before installing, visit the interactive online demo. See the Github Forums for help from the PyDDM community. You can also sign up for release announcements by email (a couple emails per year).
Examples
To simulate a simple DDM:
from pyddm import gddm
import matplotlib.pyplot as plt
model = gddm(drift=2, noise=1.5, bound=1.3, starting_position=.1, nondecision=.1)
plt.plot(model.solve().pdf("upper_bound"))
To fit data to a simple DDM:
import pyddm, pandas
model = pyddm.gddm(drift="driftrate", noise=1, bound="B", starting_position="x0", nondecision="ndt",
parameters={"driftrate": (-1, 1),
"B": (.5, 2),
"x0": (-.5, .5),
"ndt": (0, .5)})
data = pandas.from_csv("your_data_here.csv")
sample = pyddm.Sample.from_pandas_dataframe(df, rt_column_name="rt", choice_column_name="correct")
model.fit(sample)
To use PyDDM's GUI to visualize a complex model with leaky integration, a constant drift rate, exponentially collapsing bounds, and a variable starting position:
import pyddm
import pyddm.plot
import numpy as np
model = pyddm.gddm(drift=lambda x,leak,driftrate : driftrate - x*leak,
bound=lambda t,initial_B,collapse_rate : initial_B * np.exp(-collapse_rate*t),
starting_position="x0",
parameters={"leak": (0, 2),
"driftrate": (-3, 3),
"initial_B": (.5, 1.5),
"collapse_rate": (0, 10),
"x0": (-.9, .9)})
pyddm.plot.model_gui(model) # If not using a Jupyter notebook, or...
pyddm.plot.model_gui_jupyter(model) # If using a Jupyter notebook
Installation
Normally, you can install with:
$ pip install pyddm
If you are in a shared environment (e.g. a cluster), install with:
$ pip install pyddm --user
If installing from source, download the source code, extract, and do:
$ python3 setup.py install
System requirements
- Python 3.6 or above
- Numpy version 1.9.2 or higher
- Scipy version 0.16.0 or higher
- Matplotlib
- Paranoid Scientist
- Pathos (optional, for multiprocessing support)
- To install from source, you will need a C compiler (If you don't already have one, the easiest way to install one may be by installing Cython.) This is not necessary if installing from pip.
Contact
For help on using PyDDM, see the Github Forums.
Please report bugs to https://github.com/mwshinn/pyddm/issues. This includes any problems with the documentation. Pull Requests for bugs are greatly appreciated.
Feature requests are currently not being accepted due to limited resources. If you implement a new feature in PyDDM, please do the following before submitting a Pull Request on Github:
- Make sure your code is clean and well commented
- If appropriate, update the official documentation in the docs/ directory
- Ensure there are Paranoid Scientist verification conditions to your code
- Write unit tests and optionally integration tests for your new feature (runtests.sh)
- Ensure all existing tests pass
For all other questions or comments, contact m.shinn@ucl.ac.uk.
License
All code is available under the MIT license. See LICENSE.txt for more information.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for pyddm-0.8.1-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | febd8308622d507ad3bc30aeb31216da2892d17c70d7a23f688e73f23bff8a55 |
|
MD5 | ea5a3f1322db28f0d25ededdcd5f43d1 |
|
BLAKE2b-256 | 0fd62ea8ce4a589f43906a140bea2e2b6fa67c0fc45e6266bd050a3fe819d93a |
Hashes for pyddm-0.8.1-cp311-cp311-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1c5f7d2abe45aecf1514dc25d4a7a18074d6f90ba2fa331229063f7c04f6cb3f |
|
MD5 | e0b52e4a279c0ff291ef7a273b425d34 |
|
BLAKE2b-256 | 051b9d7a85012e249b7234b6f25791502f1ce6de973cc48ef1ab49e933d88ebe |
Hashes for pyddm-0.8.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1806e7486ccf66fb7f5074e9e6f28ae984a0404ad1532a0ed350423f8d3c3dfd |
|
MD5 | c97f4ae1e8a3b44b77db9556a26cb5a0 |
|
BLAKE2b-256 | dc1c20f3d5ec207baead60c4d1f9bd00d98fe16f532e3f931affb3aba7ec28e6 |
Hashes for pyddm-0.8.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f79d1740ce9f283f7ae3556baac04b09d06fdb65258c9992e47c2b68945f7d62 |
|
MD5 | d726b41fb9c7785f2798ddc04abbe40b |
|
BLAKE2b-256 | 7d057526978419c0a5d6349a26c9b8f73fe8ceb818d2872d90b5dd0bde376651 |
Hashes for pyddm-0.8.1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4ac6208bf70f6f3d5afbff23f00e798a45acf8fd84a7454a56e4a0ed31bcd2e2 |
|
MD5 | 94b3d3817e2dc694d4d3e05c89603362 |
|
BLAKE2b-256 | 8cd16cfc4142c6fa1e4f218bdd660441080ec647cc24a249a5036b527bc2b478 |
Hashes for pyddm-0.8.1-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0d4fc32c178a3a48accd5794d8cc61994bb2afe831b544ce102c2569342bc9cc |
|
MD5 | deedd64da3e5b2710d739ceb1245600d |
|
BLAKE2b-256 | 67b7fd96fce3acdd4691a87d57043938ca5fae0b0502ffc56cf9afa30a85b667 |
Hashes for pyddm-0.8.1-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | be4c8d8a4481dd0bb93ce5272dd1433b925a7dce3739fc4edf8114299b2f5078 |
|
MD5 | d2e29507440714f1838d03fd1b5d94f4 |
|
BLAKE2b-256 | 77dddd343a1ea8c2be8b3859c770c88080d2525659b4d4ea5131ed1db01a3845 |
Hashes for pyddm-0.8.1-cp310-cp310-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f9ce88ea56081875b31ae95ceb654e50eaf31d61387241d4b7f3d5b442a1e2fb |
|
MD5 | fedbf6dda9e061032bab46c00ca0c42d |
|
BLAKE2b-256 | 566fe09a68bfcc82f7b0587baf73d3b63a38d532aa0591d5a6442e379baddc6b |
Hashes for pyddm-0.8.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 92a1bb4aaaaf4c969e7b4d37ab5e5d48808740d56b4ef2111e1f9c2e8b937478 |
|
MD5 | 59390f3471363ed0f64d4f36d1edde90 |
|
BLAKE2b-256 | 18d1b29a98d7f18ecefe70c8c295d8a875fedf17b0675d323b6a20db34dbe49a |
Hashes for pyddm-0.8.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 35fa1fc627d54fa2afbf14c8527602e94b86776b4f7fba7149da0c9f99f9d8ae |
|
MD5 | 29b6d735d6248f7859fd651ea4b68586 |
|
BLAKE2b-256 | b256d80dd1a7f81a8328a2071628815d41ce13a188baf330d77c9f90fd93eb3b |
Hashes for pyddm-0.8.1-cp310-cp310-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 880880d2361a40d63cc65f30827d015eb07013516553ab0dd6261508a6a1f219 |
|
MD5 | 86190ee71cf12b8a2706fd80fff8f8a9 |
|
BLAKE2b-256 | ed5b568f46b3a76b8fb947546976152590ba2d55ed566b16584111582d697c4f |
Hashes for pyddm-0.8.1-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7f2066450c9779ced461baaf7301601aca97598646e9c5492d993bce8ae56119 |
|
MD5 | 00654e99863ffc36cfb637f3d2ec8a8e |
|
BLAKE2b-256 | 27f96064c774e3cb694b2a25dc9ec3670f2693d8639fc75dab7f6164ba1f3191 |
Hashes for pyddm-0.8.1-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 525feb38397c226bff16bfc08c86a3c852944d2ad1eba5d3ebffa046033c9dbc |
|
MD5 | 63188114269487925d1ca299372cc29d |
|
BLAKE2b-256 | 89aadaac0f9df7594ca92395f841afd529524bf2f30daba427dace9939ff0d30 |
Hashes for pyddm-0.8.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cc93354f73c61265692966da1209987b4a930c8cd5a19e6a898fd5f6b2215d33 |
|
MD5 | 634448a54dd3ad22cd3303b50f1762c5 |
|
BLAKE2b-256 | b76488e29d22a0e87ca0eb1f45c8b0f91122049a7bb71c59583807767738b364 |
Hashes for pyddm-0.8.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 878cd7b2c10b51af30004960e4e4a5eef5f1a5753ff097d9f1897cbf2aac7774 |
|
MD5 | 5e520305ff784f417ff515e746335eac |
|
BLAKE2b-256 | 986567121288e64f71f9cd0ce4be71ef34c2557ad9f442764748d6e0bb5b3f64 |
Hashes for pyddm-0.8.1-cp39-cp39-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1b913f5ad70ec273706f35d8b772528f9d4d845fcdf3c5c3ab32d03bd1d94897 |
|
MD5 | e37a2e1d34a206a05ff0bba9e705c55f |
|
BLAKE2b-256 | 62696422cc841a3919b654c63fccb2655558d5e81357a1a6e8309661c4024a57 |
Hashes for pyddm-0.8.1-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2ba86d96b68a76ffddb33f15455a1d8bc80b8cf4f4d0b89ac614728aad8f14ed |
|
MD5 | ceef55c167f6679863bf7aacd8521ae2 |
|
BLAKE2b-256 | b9ac7a3ef2c502639ee02c7e94ca3f7a03a084ddd79d6f5036bc5282ed532e62 |
Hashes for pyddm-0.8.1-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 567b4eac8d3b623f2ac83cc5056e8bd0765eba45c2218ce296074346eeb90512 |
|
MD5 | 8edd0df72f37fcf33e3a0efe8bad1aad |
|
BLAKE2b-256 | ebf1cee90047fc6a97bc0c4a1ae1ba1ea822f936bc0481acc7e4ec37093392d8 |
Hashes for pyddm-0.8.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 27c4f22b234836d05c27443cd01c4c085d3590667096167529ca0df53f195a5b |
|
MD5 | 9472352d5b4ed72c50daec2d03d97b30 |
|
BLAKE2b-256 | 8517b91398e931e6ab8f0fda7e2af20198e08c951456be80426afb0d716ebbc3 |
Hashes for pyddm-0.8.1-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c542780452a42186b9fb699cde763e19c0c53b28ff1006500796b79f40ad3c7d |
|
MD5 | 0e451e301806599cbd945ef67533773f |
|
BLAKE2b-256 | 833f8f4ee128524bff811deb585ad9a9d40f33682be70547281669a960ed1ebb |
Hashes for pyddm-0.8.1-cp38-cp38-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b7decf2c278c4ccd4169bd99686ed63fcf02b8f385e731e8962f0a03b9693cb7 |
|
MD5 | b39555680b861a71cac753e0f7fa7395 |
|
BLAKE2b-256 | 9cc4d1476aff811ae97b9bb2d5cdc8dddefda409f0a9a59d124a5ca9cee95948 |
Hashes for pyddm-0.8.1-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 869d5d84c09ee2a72ecfc8b8fade29bc4c67a9920cd495972e379ef39e5a180f |
|
MD5 | 85c005567de82468cd8d83b8214eff9d |
|
BLAKE2b-256 | 78103dc12146c1400fed0db5380bfd028f655ad33dd3ab053fd41eab65cb682d |
Hashes for pyddm-0.8.1-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e1ee696fb2d8e844bd4df0a63a65d72f22e6a14bad1b0c9daf6c73690a81db72 |
|
MD5 | 36be990f29117d82cb8a2a9c453a497c |
|
BLAKE2b-256 | 1efea23560c45e46453bd74f78d7872c4f0451ffb7bec91705dbf4b9cbfa8cda |
Hashes for pyddm-0.8.1-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4303ea5cc2a1a81285ef7d269b9cbea5dae7930174aaf7537c7c4796f2075b98 |
|
MD5 | 68df429fc9eabf4e8b05c45485729717 |
|
BLAKE2b-256 | 1b3fc72816f065bdb94bc2a8d4ff3b19196653c91d636d204e8955e01b9f997f |
Hashes for pyddm-0.8.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a3c6cabc2cbd20b9d74c601b298e316249be97e6fe6b0e950db31cb523ff2931 |
|
MD5 | a2233055418aedf8f01ecb37b0b8ff23 |
|
BLAKE2b-256 | 6513e4ae6de8387f2f7a55478765ac2f9f73c46dcf37001186dbf581261fcacb |
Hashes for pyddm-0.8.1-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c5795119cb7d92d8a4d770cefc1d71d8051971f9e015f27a2e5b0e5f42e1fcf3 |
|
MD5 | 770139e62d3bc69a9009b8ae5227d79e |
|
BLAKE2b-256 | bf7ce359c0bc3af455417155e97ec33add0556a415ca3220291a3ee5db24fc9e |
Hashes for pyddm-0.8.1-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 83d01127e4a7873765b34d75fb92e3082dc52fe9fa54363ddddc420c54969aac |
|
MD5 | dbd032b2112de39a7d6e233576c1dd67 |
|
BLAKE2b-256 | 4763d8367ed05409b130c0a4437502f5cc7548374aba997cc0af7b4d9c749930 |
Hashes for pyddm-0.8.1-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e170890bf95235f208183987336d46f71f61d3fdce621d31698f3e785eb4b682 |
|
MD5 | 6ac7be34eedabbd654baaed85e6f02d7 |
|
BLAKE2b-256 | a3be052592d04067acdcbbec68b698e76f246bc97089efc9a050a869b9dcb6d9 |
Hashes for pyddm-0.8.1-cp36-cp36m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 423063fb6068d594df1193da32659fda07dfa82d4a68f832f3ca87c27e16a60f |
|
MD5 | 86ab043172caf2928498d13d8de8659f |
|
BLAKE2b-256 | 41f351f4a410fce9848fef60a341616fe2b3abc16fd011dd8cecf20f81af295c |
Hashes for pyddm-0.8.1-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 74f0b88e83295cde93beae63cb4128c164e349dd42a2088d20fa40794b3ea0f3 |
|
MD5 | 246d54eb8c60dd615283d175b043bf69 |
|
BLAKE2b-256 | eae744f49c98f4674ab6c19c156acf44fdf76048739ce37caed70ad05ecead32 |
Hashes for pyddm-0.8.1-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a7607102e85db963bcfa11fef2b0740cf4974d5d309d4cc7f25616a03c5ef880 |
|
MD5 | 979f1d2cf94821e7949830c744a5082e |
|
BLAKE2b-256 | 55a889acad72b0d30f8da4968f394e1ec6a0fe83c21b3746203a63f725ff9583 |
Hashes for pyddm-0.8.1-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 228fb51fc37217dadaf04716a4b9b67f0290425577608956e84df02ebb226046 |
|
MD5 | b0bfa121fe5517e17112344070077eb0 |
|
BLAKE2b-256 | 16bee1e5ec9723658f3a0717f8ee810a575158682be0e53f169f8d985ac48b72 |