yaw.core.SampledValue#
- class yaw.core.SampledValue(value: _Tscalar, samples: NDArray[_Tscalar], method: str)[source]#
Bases:
Generic[_Tscalar]Container to hold a scalar value with an empirically estimated uncertainty from resampling.
Supports comparison of the values and samples with
==and!=.Examples
Create a value container with 100 assumed jackknife samples that scatter around zero with a standard deviation of 0.1:
>>> from numpy.random import normal >>> samples = normal(loc=0.0, scale=0.01, size=101) >>> value = yaw.core.SampledValue(0.0, samples, method="jackknife") >>> value SampledValue(value=0, error=0.963, n_samples=100, method='jackknife')
- Parameters:
value – Numerical, scalar value.
samples (
NDArray) – Samples ofvalueobtained from resampling methods.method (
str) – Resampling method used to obtain the data samples, seeResamplingConfigfor available options.
Methods
__init__(value, samples, method)Attributes
Number of samples used for error estimate.
Numerical, scalar value.
Samples of
valueobtained from resampling methods.Resampling method used to obtain the data samples, see
ResamplingConfigfor available options.The uncertainty (standard error) of the value.
- error: _Tscalar#
The uncertainty (standard error) of the value.
- method: str#
Resampling method used to obtain the data samples, see
ResamplingConfigfor available options.
- property n_samples: int#
Number of samples used for error estimate.
- samples: NDArray[_Tscalar]#
Samples of
valueobtained from resampling methods.
- value: _Tscalar#
Numerical, scalar value.