Skip to main content

An efficient alternative halo mass function distribution

Project description

https://travis-ci.org/steven-murray/mrpy.png?branch=master https://coveralls.io/repos/steven-murray/mrpy/badge.svg?branch=master&service=github

A Python package for calculations with the MRP parameterisation of the Halo Mass Function.

See Murray, Robotham, Power 2016 (in prep.) for more details on what the MRP is.

Quick Start

Installation

Required packages are numpy, scipy, mpmath (for incomplete gamma functions), and cached_property. These should be automatically installed when installing mrpy.

To use the MCMC fitting features, emcee and pystan are needed. These are not installed automatically.

The simplest way to install is pip install mrpy. This should install the required dependencies automatically.

To get the bleeding edge, use pip install git+git://github.com/steven-murray/mrpy.git.

If for some reason pip is not an option, manually download the github repo and use python setup.py install.

Getting Started

There’s a lot of things that you can do with mrpy. What you require will depend on the problem at hand. We recommend looking at some of the examples, and the API itself for how to use the code.

Documentation

Read the docs.

Features

With mrpy you can:

  • Calculate basic statistics of the truncated generalised gamma distribution (TGGD) with the TGGD class: mean, mode, variance, skewness, pdf, cdf, generate random variates etc.

  • Generate MRP quantities with the MRP class: differential number counts, cumulative number counts, various methods for generating normalisations.

  • Generate the MRP-based halo mass function as a function of physical parameters via the mrp_b13 function.

  • Fit MRP parameters to data in the form of arbitrary curves with the get_fit_curve function.

  • Fit MRP parameters to data in the form of a sample of variates with the PerObjFit class: simulation data is supported with extra efficiency, simulation suites fitted simultaneously is also supported, arbitrary priors on parameters, log-normal uncertainties on variates supported through a Stan-based routine.

  • Calculate analytic hessians, jacobians at any point (including the solution of a fit).

  • Use alternate parameterisations of the same form via the reparameterise module.

  • Work with a special entirely analytic model to understand the effects of various parameters in the analytic_model module.

Examples

There are several examples featured in the docs/examples directory of the github repository. These can also be found in the official documentation.

Project details


Download files

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

Source Distribution

mrpy-1.0.0.tar.gz (32.9 kB view details)

Uploaded Source

Built Distribution

mrpy-1.0.0-py2-none-any.whl (42.3 kB view details)

Uploaded Python 2

File details

Details for the file mrpy-1.0.0.tar.gz.

File metadata

  • Download URL: mrpy-1.0.0.tar.gz
  • Upload date:
  • Size: 32.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for mrpy-1.0.0.tar.gz
Algorithm Hash digest
SHA256 8fe21d8be39b5f8ed03fc3747fb0dae5bf1c2f573a9d12ff25ef30c992a589f9
MD5 a0128555fa163ece0eb0335cede14fe1
BLAKE2b-256 1e443b8237386fea7ea624679edb0ff26e9d01e24f2a968dcef9f8f359ecfa8f

See more details on using hashes here.

File details

Details for the file mrpy-1.0.0-py2-none-any.whl.

File metadata

File hashes

Hashes for mrpy-1.0.0-py2-none-any.whl
Algorithm Hash digest
SHA256 a22a6973d2bd25d39c592ea1799beaca6cf26a14d0df3a5cfb6e6aea78d271e8
MD5 eeec64b54e1d632eefe0c7d5b1ea9dfc
BLAKE2b-256 a98a246eb6fb088cd53432ebb15b78e804635158aaabd82a2c791c43970733f4

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