-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Galaxy bias as cobaya theory #41
Conversation
I'm attempting to run tests evaluating the model using the
This currently fails both with and without the linear bias theory, when trying to run the sampler:
|
I guess your calculate function always gets the Pk even if the class isn't actually asked to calculate anything. Rather than sampling a mock, you could call get_model() and then add_requirements (https://cobaya.readthedocs.io/en/latest/models.html?highlight=get_model#model.Model.add_requirements) to tell it something that you need to compute. There's an example at https://cobaya.readthedocs.io/en/latest/cosmo_model.html Or maybe you can add a "requires" argument for Pkgg to the likelihood in the yaml (not tried it). |
That works, thanks! I had tried |
soliket/bias.py
Outdated
'Cannot do log extrapolation with zero-crossing pk ' | ||
'for %s, %s' % var_pair) | ||
result = PowerSpectrumInterpolator(self.z, self.k, pk, logP=log_p, logsign=sign, | ||
extrap_kmax=extrap_kmax) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure I would pass these downstream as interpolators, as opposed to arrays. Other downstream codes (e.g. CCL, but there must be others) will use their own interpolating functions based on input arrays, so you'll need to resample these upstream interpolators and reinterpolate them, which will be inefficient and give rise to errors.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(sorry for the delay, was moving house)
Okay, I agree this seems sensible. There are a couple of SOLikeT likelihoods (xcorr, clusters) which request Pk_interpolator
but it would be trivial to have them request grids and do any interpolation inside the likelihood.
This will implement a cobaya theory class to calculate power spectra with a bias term (e.g. linear galaxy bias).
To begin with this will just be a constant linear bias
Pk_gg = b_lin**2. Pk_mm
but other subclasses can contain more sophisticated bias models (including ones calculated by external codes such as velcileptors or fastpt).
Merging will close #33.