-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
ALG: ComputationsNew algorithms for computations or improvements of existing onesNew algorithms for computations or improvements of existing onescore.distributions
Description
Add characteristic std
Naming convention: "std".
std denotes the standard deviation of a random variable:
std(X) = sqrt(Var(X)).
1. Relation to variance
Standard deviation is defined as the square root of variance:
std(X) = sqrt(var(X))var(X) = central_moment(order=2)
No independent statistical computation logic should be implemented inside std.
All mathematical logic for obtaining dispersion-related quantities must live in:
central_moment(order=2)(primary definition),- and/or
var(as its thin wrapper).
std must be implemented strictly as a thin wrapper over var, applying an elementwise square root.
There must be no alternative computational paths that bypass var.
2. Integration into the characteristic graph
- Register
stdas a node in the global characteristic graph. - Add a single edge:
var -> std
The planner must obtain std exclusively via var.
No direct edges from:
central_moment,raw_moment,pdf,pmf,- or any other characteristic
should exist.
3. Implementation requirements
- The implementation must support NumPy array semantics.
- The square root must be applied elementwise.
- Behavior for negative numerical noise (e.g., tiny negative values due to floating-point errors) must be defined:
- Either clamp small negative values to zero within tolerance,
- Or raise a well-defined error (decision must be consistent with
varpolicy).
The behavior must be explicitly tested.
4. Tests
Add tests that verify:
stdequalssqrt(var)for analytical distributions.- For at least one distribution:
stdmatches the analytical standard deviation (within tolerance).stdequalssqrt(central_moment(order=2))via the graph.
- Array semantics:
- Scalar input,
- Vector input,
- Broadcasting behavior (if applicable).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
ALG: ComputationsNew algorithms for computations or improvements of existing onesNew algorithms for computations or improvements of existing onescore.distributions
Type
Projects
Status
No status