# gluonts.nursery.spliced_binned_pareto.spliced_binned_pareto module¶

class gluonts.nursery.spliced_binned_pareto.spliced_binned_pareto.Binned(bins_lower_bound: float, bins_upper_bound: float, nbins: int = 100, smoothing_indicator: Optional[str] = 'cheap', validate_args=None)[source]

Bases: torch.nn.modules.module.Module

Binned univariate distribution designed as an nn.Module

Parameters
• bins_lower_bound (The lower bound of the bin edges) –

• bins_upper_bound (The upper bound of the bin edges) –

• nbins (The number of equidistance bins to allocate between bins_lower_bound and bins_upper_bound. Default value is 100.) –

• smoothing_indicator (The method of smoothing to perform on the bin probabilities) –

bins_cdf()[source]
bins_prob()[source]
cdf(x)[source]

Cumulative density tensor for a tensor of datapoints x.

cdf_binned_components(xx, idx=0, cum_density=tensor([0.]))[source]

Cumulative density given bins for one datapoint xx, where cum_density is the cdf up to bin_edges idx which must be lower than xx

cdf_components(xx, idx=0, cum_density=tensor([0.]))[source]

Cumulative density for one datapoint xx, where cum_density is the cdf up to bin_edges idx which must be lower than xx

forward(x)[source]

Takes input x as new logits

icdf(values)[source]

Inverse cdf of a tensor of quantile values

inverse_binned_cdf(value)[source]

Inverse binned cdf of a single quantile value

inverse_cdf(value)[source]

Inverse cdf of a single percentile value

log_binned_p(xx)[source]

Log probability for one datapoint.

log_bins_prob()[source]
log_p(xx)[source]

Log probability for one datapoint xx.

log_prob(x)[source]

Log probability for a tensor of datapoints x.

to_device(device)[source]

Moves members to a specified torch.device

training = None
class gluonts.nursery.spliced_binned_pareto.spliced_binned_pareto.SplicedBinnedPareto(bins_lower_bound: float, bins_upper_bound: float, nbins: int = 100, percentile_gen_pareto: torch.Tensor = tensor(0.0500), validate_args=None)[source]

Spliced Binned-Pareto univariate distribution.

Parameters
• bins_lower_bound (The lower bound of the bin edges) –

• bins_upper_bound (The upper bound of the bin edges) –

• nbins (The number of equidistance bins to allocate between bins_lower_bound and bins_upper_bound. Default value is 100.) –

• percentile_gen_pareto (The percentile of the distribution that is each tail. Default value is 0.05. NB: This symmetric percentile can still represent asymmetric upper and lower tails.) –

cdf_components(xx, idx=0, cum_density=tensor([0.]))[source]

Cumulative density for one datapoint xx, where cum_density is the cdf up to bin_edges idx which must be lower than xx

forward(x)[source]

Takes input x as the new parameters to specify the bin probabilities: logits for the base distribution, and xi and beta for each tail distribution.

inverse_cdf(value)[source]

Inverse cdf of a single percentile value

log_p(xx, for_training=True)[source]
Parameters
• xx (one datapoint) –

• for_training (boolean to indicate a return of the log-probability, or of the loss (which is an adjusted log-probability)) –

to_device(device)[source]

Moves members to a specified torch.device

training = None