OptBayesExptNoiseParam class¶
- class optbayesexpt.obe_noiseparam.OptBayesExptNoiseParameter(measurement_model, setting_values, parameter_samples, constants, noise_parameter_index=None, **kwargs)[source]¶
Bases:
OptBayesExpt
OptBayesExpt adding measurement uncertainty as an unknown parameter.
OptBayesExptNoiseParameter is designed for cases where the experimental uncertainty / standard deviation of the measurement noise is an unknown. The standard deviation of the measurement noise is included as one of the parameters. The methods rely on several assumptions:
The noise in measurement data is well-described by additive, normally-distributed (Gaussian) noise.
The noise is independent of settings and other parameters.
- Arguments:
measurement_model (function) – A function accepting (settings, parameters, constants) arguments and returning model values of experiment outputs. See the
model_function
arg ofOptBayesExpt
.setting_values (tuple of arrays) – Arrays of allowed values for each setting. See the
setting_values
arg ofOptBayesExpt
.parameter_samples (tuple of arrays) – random draws of each model parameter representing the prior probability distribution. See the
parameter_samples
arg ofOptBayesExpt
. One of the parameter_sample arrays must be the standard deviation of the measurement noise, idendified by thenoise_parameter_index
arg.constants (tuple) – settings or parameters that are assumed constant. See the
constants
arg ofOptBayesExpt
.noise_parameter_index (int or tuple) – identifies which of the arrays in the
paramter_samples
input are uncertainty parameters. For multi-channel measurements, the tuple identifies uncertainty parameters corresponding to measurement channels. In cases where channels have the same noise characteristics, indices may be repeated in the tuple.**kwargs – Keyword arguments passed to the parent classes.
Attributes:
- enforce_parameter_constraints()[source]¶
Detects and nullifies disallowed parameter values
Constrains the noise parameter to be positive. Negative uncertainties lead to negative likelihoods, negative particle weights and other abominations. Overwrites the
OptBayesExpt
stub method.
- likelihood(y_model, measurement_record)[source]¶
Calculates the likelihood of a measurement result.
For each parameter combination, estimate the probability of obtaining the results provided in
measurement_result
.Under these assumptions, and model values \(y_{model}\) as a function of parameters, the likelihood is a Gaussian function proportional to \(\sigma^{-1} \exp [-(y_{model} - y_{meas})^2 / (2 \sigma^2)]\).
- Parameters:
y_model (
ndarray
) –model_function()
results evaluated for all parameters.measurement_record (
tuple
) –The measurement conditions and results, supplied by the user to
update_pdf()
. The first two elements ofmeasurement_record
are:settings (tuple)
measurement value (float or tuple)
further entries in the measurement_record are ignored.
- Returns:
an array of probabilities corresponding to the parameters in
self.allparameters
.
- noise_parameter_index¶
Stores the noise_parameter_index argument
- Type:
int