elisa.plot.data#

Data classes for plotting.

class PlotData(name: str, result: FitResult, seed: int)[source]#

Bases: ABC

Base class for data used in plotting.

Attributes

ce_model

Point estimate of the folded source model.

back_counts

back_errors

back_ratio

ce_data

ce_errors

channel

channel_emax

channel_emean

channel_emid

channel_emin

channel_errors

channel_width

has_comps

ndata

net_counts

net_errors

params_dist

photon_egrid

spec_counts

spec_errors

Methods

ce_model_ci([cl])

Confidence/Credible intervals of the folded source model.

pit()

Probability integral transform.

residuals(rtype, seed, random_quantile, mle)

Residuals between the data and the fitted models.

residuals_ci(rtype, cl, seed, ...)

Confidence/Credible intervals of the residuals.

residuals_sim(rtype, seed, random_quantile)

Residuals bootstrap/ppc samples.

unfolded_model

property channel: ndarray#
property channel_emin: ndarray#
property channel_emax: ndarray#
property channel_emid: ndarray#
property channel_width: ndarray#
property channel_emean: ndarray#
property channel_errors: ndarray#
property photon_egrid: ndarray#
property spec_counts: ndarray | Array#
property spec_errors: ndarray | Array#
property back_ratio: float | ndarray | Array#
property back_counts: ndarray | Array | None#
property back_errors: ndarray | Array | None#
property net_counts: ndarray | Array#
property net_errors: ndarray | Array#
property ndata: int#
property ce_data: ndarray | Array#
property ce_errors: ndarray | Array#
abstract property ce_model: ndarray | Array#

Point estimate of the folded source model.

abstractmethod ce_model_ci(cl: float = 0.683) ndarray | Array | None[source]#

Confidence/Credible intervals of the folded source model.

property has_comps: bool#
property params_dist: dict[str, ndarray | Array] | None#
abstractmethod unfolded_model(mtype: Literal['ne', 'ene', 'eene'], egrid: ndarray | Array, params: dict, comps: bool, cl: float | ndarray | Array | None = None) ndarray | Array | dict[source]#
abstractmethod pit() tuple[source]#

Probability integral transform.

abstractmethod residuals(rtype: Literal['rd', 'rp', 'rq'], seed: int | None, random_quantile: bool, mle: bool) ndarray | Array | tuple[ndarray | Array, bool | ndarray | Array, bool | ndarray | Array][source]#

Residuals between the data and the fitted models.

abstractmethod residuals_sim(rtype: Literal['rd', 'rp', 'rq'], seed: int | None, random_quantile: bool) ndarray | Array | None[source]#

Residuals bootstrap/ppc samples.

abstractmethod residuals_ci(rtype: Literal['rd', 'rp', 'rq'], cl: float, seed: int | None, random_quantile: bool, with_sign: bool) ndarray | Array | None[source]#

Confidence/Credible intervals of the residuals.

class MLEPlotData(name: str, result: FitResult, seed: int)[source]#

Bases: PlotData

Attributes

ce_model

Point estimate of the folded source model.

sign

Sign of the difference between the data and the fitted models.

back_counts

back_errors

back_ratio

boot

ce_data

ce_errors

channel

channel_emax

channel_emean

channel_emid

channel_emin

channel_errors

channel_width

has_comps

ndata

net_counts

net_errors

params_dist

params_mle

photon_egrid

spec_counts

spec_errors

Methods

ce_model_ci([cl])

Confidence/Credible intervals of the folded source model.

deviance(rtype)

MLE and bootstrap deviance.

model(on_off, mtype)

Point estimate or bootstrap models of the on/off measurement.

pit()

Probability integral transform.

residuals(rtype[, seed, random_quantile, mle])

Residuals between the data and the fitted models.

residuals_ci(rtype[, cl, seed, ...])

Confidence/Credible intervals of the residuals.

residuals_sim(rtype[, seed, random_quantile])

Residuals bootstrap/ppc samples.

deviance_residuals_boot

deviance_residuals_mle

get_data_boot

get_model_boot

get_model_mle

pearson_residuals_boot

pearson_residuals_mle

quantile_residuals_mle

unfolded_model

result: MLEResult#
property boot: BootstrapResult#
property params_mle: dict[str, ndarray | Array]#
get_model_mle(name: str) ndarray | Array[source]#
get_model_boot(name: str) ndarray | Array | None[source]#
get_data_boot(name: str) ndarray | Array | None[source]#
property ce_model: ndarray | Array#

Point estimate of the folded source model.

ce_model_ci(cl: float = 0.683) ndarray | Array | None[source]#

Confidence/Credible intervals of the folded source model.

unfolded_model(mtype: Literal['ne', 'ene', 'eene'], egrid: ndarray | Array | None, params: dict | None, comps: bool, cl: float | ndarray | Array | None = None) tuple[ndarray | Array | dict, ndarray | Array | dict | None][source]#
property sign: dict[str, ndarray | Array | None]#

Sign of the difference between the data and the fitted models.

model(on_off: Literal['on', 'off'], mtype: Literal['mle', 'boot']) ndarray | Array | None[source]#

Point estimate or bootstrap models of the on/off measurement.

deviance(rtype: Literal['mle', 'boot']) ndarray | Array | None[source]#

MLE and bootstrap deviance.

pit() tuple[ndarray | Array, ndarray | Array][source]#

Probability integral transform.

residuals(rtype: Literal['rd', 'rp', 'rq'], seed: int | None = None, random_quantile: bool = True, mle: bool = True) ndarray | Array | tuple[ndarray | Array, bool | ndarray | Array, bool | ndarray | Array][source]#

Residuals between the data and the fitted models.

residuals_sim(rtype: Literal['rd', 'rp', 'rq'], seed: int | None = None, random_quantile: bool = True) ndarray | Array | None[source]#

Residuals bootstrap/ppc samples.

residuals_ci(rtype: Literal['rd', 'rp', 'rq'], cl: float = 0.683, seed: int | None = None, random_quantile: bool = True, with_sign: bool = False) ndarray | Array | None[source]#

Confidence/Credible intervals of the residuals.

deviance_residuals_mle() ndarray | Array[source]#
deviance_residuals_boot() ndarray | Array | None[source]#
pearson_residuals_mle() ndarray | Array[source]#
pearson_residuals_boot() ndarray | Array | None[source]#
quantile_residuals_mle(seed: int, random: bool) tuple[ndarray | Array, ndarray | Array | bool, ndarray | Array | bool][source]#
class PosteriorPlotData(name: str, result: FitResult, seed: int)[source]#

Bases: PlotData

Attributes

ce_model

Point estimate of the folded source model.

sign

Sign of the difference between the data and the fitted models.

back_counts

back_errors

back_ratio

ce_data

ce_errors

channel

channel_emax

channel_emean

channel_emid

channel_emin

channel_errors

channel_width

has_comps

ndata

net_counts

net_errors

params

params_dist

photon_egrid

ppc

spec_counts

spec_errors

Methods

ce_model_ci([cl])

Confidence/Credible intervals of the folded source model.

deviance(rtype)

Median, MLE, and ppc deviance.

pit()

Probability integral transform.

residuals(rtype[, seed, random_quantile, mle])

Residuals between the data and the fitted models.

residuals_ci(rtype[, cl, seed, ...])

Confidence/Credible intervals of the residuals.

residuals_sim(rtype[, seed, random_quantile])

Residuals bootstrap/ppc samples.

deviance_residuals_loo

deviance_residuals_median

deviance_residuals_mle

deviance_residuals_ppc

get_model_loo

get_model_median

get_model_mle

get_model_posterior

get_model_ppc

model

pearson_residuals_loo

pearson_residuals_median

pearson_residuals_mle

pearson_residuals_ppc

quantile_residuals

unfolded_model

result: PosteriorResult#
property params: dict[str, ndarray | Array]#
property ppc: PPCResult | None#
get_model_median(name: str) ndarray | Array[source]#
get_model_loo(name: str) ndarray | Array[source]#
get_model_posterior(name: str) DataArray[source]#
get_model_ppc(name: str) ndarray | Array | None[source]#
get_model_mle(name: str) ndarray | Array | None[source]#
property ce_model: ndarray | Array#

Point estimate of the folded source model.

ce_model_ci(cl: float = 0.683) ndarray | Array[source]#

Confidence/Credible intervals of the folded source model.

unfolded_model(mtype: Literal['ne', 'ene', 'eene'], egrid: ndarray | Array | None, params: dict | None, comps: bool, cl: float | ndarray | Array | None = None) tuple[ndarray | Array | dict, ndarray | Array | dict | None][source]#
property sign: dict[str, ndarray | Array | None]#

Sign of the difference between the data and the fitted models.

model(on_off: Literal['on', 'off'], mtype: Literal['posterior', 'loo', 'median', 'mle', 'ppc']) ndarray | Array | None[source]#
deviance(rtype: Literal['posterior', 'loo', 'mle', 'ppc']) DataArray | None[source]#

Median, MLE, and ppc deviance.

pit() tuple[source]#

Probability integral transform.

residuals(rtype: Literal['rd', 'rp', 'rq'], seed: int | None = None, random_quantile: bool = True, mle: bool = False) ndarray | Array | tuple[ndarray | Array, bool | ndarray | Array, bool | ndarray | Array][source]#

Residuals between the data and the fitted models.

residuals_sim(rtype: Literal['rd', 'rp', 'rq'], seed: int | None = None, random_quantile: bool = True) ndarray | Array | None[source]#

Residuals bootstrap/ppc samples.

residuals_ci(rtype: Literal['rd', 'rp', 'rq'], cl: float = 0.683, seed: int | None = None, random_quantile: bool = True, with_sign: bool = False) ndarray | Array | None[source]#

Confidence/Credible intervals of the residuals.

deviance_residuals_loo() ndarray | Array[source]#
deviance_residuals_median() ndarray | Array[source]#
deviance_residuals_mle() ndarray | Array[source]#
deviance_residuals_ppc() ndarray | Array | None[source]#
pearson_residuals_loo() ndarray | Array[source]#
pearson_residuals_median() ndarray | Array[source]#
pearson_residuals_mle() ndarray | Array[source]#
pearson_residuals_ppc() ndarray | Array | None[source]#
quantile_residuals(seed: int, random: bool) tuple[ndarray | Array, ndarray | Array | bool, ndarray | Array | bool][source]#