LogNormalScatterModel¶
- class halotools.empirical_models.LogNormalScatterModel(prim_haloprop_key='halo_mpeak', **kwargs)[source]¶
Bases:
object
Simple model used to generate log-normal scatter in a stellar-to-halo-mass type relation.
- Parameters:
- prim_haloprop_keystring, optional
String giving the column name of the primary halo property governing the level of scatter. Default is set in the
model_defaults
module.- scatter_abscissaarray_like, optional
Array of values giving the abscissa at which the level of scatter will be specified by the input ordinates. Default behavior will result in constant scatter at a level set in the
model_defaults
module.- scatter_ordinatesarray_like, optional
Array of values defining the level of scatter at the input abscissa. Default behavior will result in constant scatter at a level set in the
model_defaults
module.
Examples
>>> scatter_model = LogNormalScatterModel() >>> scatter_model = LogNormalScatterModel(prim_haloprop_key='halo_mvir')
To implement variable scatter, we need to define the level of log-normal scatter at a set of control values of the primary halo property. Here we give an example of a model in which the scatter is 0.3 dex for Milky Way table and 0.1 dex in cluster table:
>>> scatter_abscissa = [12, 15] >>> scatter_ordinates = [0.3, 0.1] >>> scatter_model = LogNormalScatterModel(scatter_abscissa=scatter_abscissa, scatter_ordinates=scatter_ordinates)
Methods Summary
mean_scatter
(**kwargs)Return the amount of log-normal scatter that should be added to the galaxy property as a function of the input table.
scatter_realization
([seed])Return the amount of log-normal scatter that should be added to the galaxy property as a function of the input table.
Methods Documentation
- mean_scatter(**kwargs)[source]¶
Return the amount of log-normal scatter that should be added to the galaxy property as a function of the input table.
- Parameters:
- prim_haloproparray, optional
Array of mass-like variable upon which occupation statistics are based. If
prim_haloprop
is not passed, thentable
keyword argument must be passed.- tableobject, optional
Data table storing halo catalog. If
table
is not passed, thenprim_haloprop
keyword argument must be passed.
- Returns:
- scatterarray_like
Array containing the amount of log-normal scatter evaluated at the input table.
- scatter_realization(seed=None, **kwargs)[source]¶
Return the amount of log-normal scatter that should be added to the galaxy property as a function of the input table.
- Parameters:
- prim_haloproparray, optional
Array of mass-like variable upon which occupation statistics are based. If
prim_haloprop
is not passed, thentable
keyword argument must be passed.- tableobject, optional
Data table storing halo catalog. If
table
is not passed, thenprim_haloprop
keyword argument must be passed.- seedint, optional
Random number seed. Default is None.
- Returns:
- scatterarray_like
Array containing a random variable realization that should be summed with the galaxy property to add scatter.