Git Product home page Git Product logo

mgemu's Introduction

DOI

Emulator for fast generation of PMG(k)/PLCDM(k) for f(R) Hu-Sawicki model

Requirements

The emulator is developed using the following packages:

  • python 3.7
  1. tensorflow==1.14.0 pip install tensorflow==1.14.0
  2. gpflow=1.5.1 pip install gpflow==1.5.1
  3. scikit-learn=0.21.3 pip install scikit-learn

Installation

To install the package in developer mode, clone the git repo locally and then use a pip development installation by running:

git clone https://github.com/LSSTDESC/mgemu.git
cd mgemu
python setup.py install --user   # Add --user flag to install it locally

from the top-level of the repo. From the same directory, run the test suite:

pytest

Running the Emulator

A script for running the emulator is also provided in `mgemu/notebooks/'.

Import the Emulator

from mgemu import emu

Define the Cosmological Parameters

# LCDM parameters
h = 0.67 # See notes regarding the value of h below
Omh2=(h**2)*0.281
ns=0.971
s8=0.82

# Hu-Sawicki model parameters
fr0 = 1e-5
n=1

# Redshift
z= 0.3

Run the Emulator

pkratio, k = emu(Omh2=Omh2, ns=ns, s8=s8, fR0=fr0, n=n, z=z)

Plotting the power spectra ratios should provide:

Important notes:

  1. The emulator is trained within the range:
  • 0.12 ≤ Ωmh2 ≤ 0.15
  • 0.85 ≤ ns ≤ 1.1
  • 0.7≤ σ8 ≤0.9
  • 10−8 ≤ fR0 ≤10−4
  • 0 ≤ n ≤4
  • 0 ≤ z ≤ 49

Hence the estimation is only reliable in this range. Outside of this, the GP performs extrapolation, and may provide unreliable results.

  1. Emulator is trained with COLA simulations with h = 0.67, in agreement with Planck. For small differences of h, the emulator output does not vary much. However the user must exercise caution, and limit the use of h = 0.67 as much as possible.

  2. Output from the mgemu.emu function will be the binned power spectra enhancement PMG(k)/PLCDM(k) and wavenumber k in 213 bins.

  3. Although the k range of the emulator is up to 0 ≤ k ≤ 3.5 h/Mpc, we do not advocate the use of the emulator for small scales beyond k ~ 1.0 h/Mpc.

License and Feedback:

This software was developed within the LSST DESC using LSST DESC resources, and so meets the criteria given in, and is bound by, the LSST DESC Publication Policy for being a “DESC product”.

The list of released versions of this package can be found here, with the master branch including the most recent (non-released) development.

This repository is maintained by Georgios Valogiannis (@gvalgioa) and Nesar Ramachandra (@nesar). If you have comments, suggestions or questions, please write us an issue.

This is open source software, available for re-use under the modified BSD license.

mgemu's People

Contributors

nesar avatar gvalogia avatar

Stargazers

 avatar  avatar

Watchers

Phil Marshall avatar James Cloos avatar Rachel Mandelbaum avatar Shuo Yuan avatar  avatar  avatar  avatar

mgemu's Issues

Using mgemu with multiprocessing

Hello,

I am trying to use mgemu with emcee and to parallelize it using multiprocessing. I use mgemu in my likelihood function, and it works nicely when I use emcee without multiprocessing. However, when using multiprocessing, there is no error but it seems that nothing happens (the chain doesn't advance).
The problem is related to mgemu because the same code runs without problem when I comment the call to mgemu.

Would you have any idea why I've got this problem, or have you ever tried to use multiprocessing with mgemu ?

Thank you very much in advance,

Raphaël Kou

Getting P_LCDM(k) from CAMB

Hi @nesar and @gvalogia I've been looking at your wonderful emulator and I have a small question. I get PMG(k)/PLCDM(k) from the emulator, and if I want to use CAMB to get PLCDM(k) -and then multiply to get PMG(k)- am I right that this should be CAMB with HALOFIT (Takahashi et al. 2012)?

installation issue (and solution): 'Dataset' has no attribute 'value'

Hi @nesar and @gvalogia just wanted to mention this issue I encountered while installing mgemu in a clean environment on a new MacBook Pro. I attach a screenshot below (with errors when running the test suite) which was solved by downgrading h5py with pip3 install h5py=='2.9.0'. I imagine this is not the optimal solution but I thought to report it here.

Docs httpsdocs pytest orgenstablewarnings html

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.