skypy.utils.random.schechter¶
- skypy.utils.random.schechter(alpha, x_min, x_max, resolution=100, size=None, scale=1.0)[source] [edit on github]¶
Sample from the Schechter function.
- Parameters:
- alphafloat or int
The alpha parameter in the Schechter function in [1].
- x_min, x_maxarray_like
Lower and upper bounds for the random variable x.
- resolutionint
Resolution of the inverse transform sampling spline. Default is 100.
- size: int, optional
Output shape of samples. If size is None and scale is a scalar, a single sample is returned. If size is None and scale is an array, an array of samples is returned with the same shape as scale.
- scale: array-like, optional
Scale factor for the returned samples. Default is 1.
- Returns:
- x_samplearray_like
Samples drawn from the Schechter function.
Warning
The inverse cumulative distribution function is approximated from the Schechter function evaluated on a logarithmically-spaced grid. The user must choose the
resolution
of this grid to satisfy their desired numerical accuracy.References