ErrorBar
Mojo struct π‘
ErrorBar
@memory_only
struct ErrorBarHow the uncertainty around an estimate is sized.
ErrorBar.none()– no interval.ErrorBar.sd(k)–ksample standard deviations, the spread of the observations themselves.ErrorBar.se(k)–kstandard errors of the mean, the spread of the estimate.ErrorBar.pi(level)– a percentile interval of the observations, e.g. 0.95 for the 2.5th to 97.5th percentile.ErrorBar.ci(level)– a bootstrap confidence interval of the estimate: resample the group with replacement, re-estimate, take the percentile interval of those estimates. Needs a seed, whichbarplot()carries with a fixed default.
sd and se are symmetric about the estimate and closed-form;
pi and ci are asymmetric and follow the data’s shape.
Fields
- scale (
Float64):kforsd/se, the confidence level in(0, 1)forpi/ci.
Implemented traits
AnyType, Copyable, Deinitable, ImplicitlyCopyable, Movable
Methods
__init__
fn def __init__(out self, kind: Int, scale: Float64)Args:
- kind (
Int) - scale (
Float64) - self (
Self)
Returns:
Self
none
@staticmethod
fn def none() -> SelfReturns:
Self
sd
@staticmethod
fn def sd(k: Float64 = 1) -> SelfArgs:
- k (
Float64)
Returns:
Self
se
@staticmethod
fn def se(k: Float64 = 1) -> SelfArgs:
- k (
Float64)
Returns:
Self
pi
@staticmethod
fn def pi(level: Float64 = 0.94999999999999996) -> SelfArgs:
- level (
Float64)
Returns:
Self
ci
@staticmethod
fn def ci(level: Float64 = 0.94999999999999996) -> SelfArgs:
- level (
Float64)
Returns:
Self
is_none
fn def is_none(self) -> BoolArgs:
- self (
Self)
Returns:
Bool
is_bootstrap
fn def is_bootstrap(self) -> BoolArgs:
- self (
Self)
Returns:
Bool
label
fn def label(self) -> StringHow the interval was made, for a caption.
Args:
- self (
Self)
Returns:
String