Cobaya: Simple Likelihood with theory

Use of Cobaya. camb, CLASS, cosmomc, compilers, etc.
Post Reply
Kunhao Zhong
Posts: 2
Joined: May 02 2023
Affiliation: Stony Brook University

Cobaya: Simple Likelihood with theory

Post by Kunhao Zhong » May 02 2023

Hi,

Is there now a simple way of adding a prior with cobaya.likelihood? I know in the old version we can use _theory, with something like this:

Code: Select all

like_BBN: 'lambda _theory={''H0'': None,''omegab'': None,}: np.log(0.005 <= _theory.get_param(''omegab'')((_theory.get_param(''H0'')/100)*2)
  #   <= 0.04)'
which has been deprecated. Is there something similar we can use now?

Thanks!
Kunhao

Antony Lewis
Posts: 1932
Joined: September 23 2004
Affiliation: University of Sussex
Contact:

Re: Cobaya: Simple Likelihood with theory

Post by Antony Lewis » May 05 2023

You can add a prior to the priors block, explicitly listing arguments, e.g. see prior: block in

https://cobaya.readthedocs.io/en/latest/example_advanced.html#example-advanced-shell

If you need to use derived parameters in your prior, list them as derived parameters in the params block.

Kunhao Zhong
Posts: 2
Joined: May 02 2023
Affiliation: Stony Brook University

Re: Cobaya: Simple Likelihood with theory

Post by Kunhao Zhong » May 11 2023

Great. Thanks a lot!

kunhao

Post Reply