Code Monkey home page Code Monkey logo

pyabc-copasi's Introduction

Using COPASI in pyABC

This project holds a couple of sample scripts, that show how COPASI simulations can be used in pyABC.

COPASI Logo pyABC Logo

Installation

Checkout the project:

git clone https://github.com/fbergmann/pyabc-copasi

Install the requirments (pyabc, python-copasi, basico) in a new virtual environment:

cd pyabc-copasi
pip install -r requirements.txt

Usage

At the moment the scripts port the markov jump example from the pyabc tutorial. It is present twice, once as:

* `example_distance_gillespie.py`: this is just copy pasted from the tutorial, and uses the pure python gillespie implementation
* `example_distance_basico.py`: uses basico to simulate the models included in the `data` directory. 

Running:

python example_distance_basico.py

Yields:

INFO:Sampler:Parallelizing the sampling on 8 cores.
INFO:History:Start <ABCSMC id=27, start_time=2021-03-04 10:51:38.388675>
INFO:ABC:Calibration sample t=-1.
INFO:Epsilon:initial epsilon is 5.55
INFO:ABC:t: 0, eps: 5.55.
INFO:ABC:Acceptance rate: 500 / 1039 = 4.8123e-01, ESS=5.0000e+02.
INFO:Adaptation:Change nr particles 500 -> 109
INFO:ABC:t: 1, eps: 2.8.
INFO:ABC:Acceptance rate: 109 / 305 = 3.5738e-01, ESS=1.0582e+02.
INFO:Adaptation:Change nr particles 109 -> 85
INFO:ABC:t: 2, eps: 2.2.
INFO:ABC:Acceptance rate: 85 / 222 = 3.8288e-01, ESS=4.7117e+01.
INFO:Adaptation:Change nr particles 85 -> 69
INFO:ABC:t: 3, eps: 1.95.
INFO:ABC:Acceptance rate: 69 / 215 = 3.2093e-01, ESS=4.1095e+01.
INFO:Adaptation:Change nr particles 69 -> 89
INFO:ABC:t: 4, eps: 1.6028273013884138.
INFO:ABC:Acceptance rate: 89 / 336 = 2.6488e-01, ESS=4.0208e+01.
INFO:Adaptation:Change nr particles 89 -> 95
INFO:ABC:t: 5, eps: 1.45.
INFO:ABC:Acceptance rate: 95 / 419 = 2.2673e-01, ESS=3.8843e+01.
INFO:Adaptation:Change nr particles 95 -> 87
INFO:ABC:t: 6, eps: 1.25.
INFO:ABC:Acceptance rate: 87 / 417 = 2.0863e-01, ESS=4.5705e+01.
INFO:Adaptation:Change nr particles 87 -> 93
INFO:ABC:t: 7, eps: 0.85.
INFO:ABC:Acceptance rate: 93 / 474 = 1.9620e-01, ESS=5.8819e+01.
INFO:Adaptation:Change nr particles 93 -> 57
INFO:ABC:t: 8, eps: 0.7.
INFO:ABC:Acceptance rate: 57 / 387 = 1.4729e-01, ESS=5.5188e+01.
INFO:Adaptation:Change nr particles 57 -> 48
INFO:pyabc.util:Stopping: minimum epsilon.
INFO:History:Done <ABCSMC id=27, duration=0:00:32.578834, end_time=2021-03-04 10:52:10.967509>

as well as images as these ones:

Distributions

Probabilities

Generations

Which matches what was found in the original example. Sometimes the it doesn't work and stops with:

pyabc.transition.exceptions.NotEnoughParticles: Fitting not possible.

in that case you just run it again.

License

The packages available on this page are provided under the Artistic License 2.0, which is an OSI approved license. This license allows non-commercial and commercial use free of charge.

pyabc-copasi's People

Contributors

fbergmann avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.