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) –
- cdf_binned_components(xx, idx=0, cum_density=tensor([0.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.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
- training: bool#
- 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.05), validate_args=None)[source]#
Bases:
gluonts.nursery.spliced_binned_pareto.spliced_binned_pareto.Binned
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.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.
- 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)) –
- training: bool#