pal.stochastic_scalar module
Stochastic scalar variables for Monte Carlo simulation.
Provides the StochasticScalar class for representing and manipulating scalar-valued stochastic variables in actuarial and risk modeling applications. Supports arithmetic operations, statistical functions, and numpy integration.
- class pal.stochastic_scalar.StochasticScalar(values)[source]
Bases:
ProteusStochasticVariableA class to represent a single scalar variable in a simulation.
- coupled_variable_group: CouplingGroup
- __init__(values)[source]
Initialize a stochastic scalar.
- Parameters:
values (
TypeAliasType) – An array of values that describe the distribution for the scalar variable.
- property ranks: StochasticScalar
Return the ranks of the variable.
- all()
Check if all values in the variable are True (non-zero).
- Return type:
- Returns:
True if all values are non-zero, False otherwise.
- any()
Check if any value in the variable is True (non-zero).
- Return type:
- Returns:
True if any value is non-zero, False otherwise.
- astype(dtype)
Convert the underlying values to a specified dtype.