pearl.sample
Module for sampling functions used in the PEARL model.
Functions
|
Return a numpy array filled with n values drawn from a truncated normal distribution defined by the given parameters. |
- pearl.sample.draw_from_trunc_norm(lower_bound: float, upper_bound: float, mu: float, sigma: float, n: int, random_state: numpy.random.RandomState) numpy.typing.NDArray.typing.Any[source]
Return a numpy array filled with n values drawn from a truncated normal distribution defined by the given parameters. If n=0 return an empty numpy array.
- Parameters:
lower_bound (float) – Lower bound of truncation.
upper_bound (float) – Upper bound of truncation.
mu (float) – Mean value of normal distribution for sampling.
sigma (float) – Standard deviation of normal distribution for sampling.
n (int) – Number of values to sample from distribution.
random_state (np.random.RandomState) – Random State object for random number sampling.
- Returns:
numpy array of sampled values.
- Return type:
NDArray[Any]