Distribution index · Data likelihood · Parameters and priors
RMC.BestFit.Models.UnivariateDistribution turns one of the fifteen Numerics families into an IModel. The Numerics object supplies
The default constructor creates a Log-Pearson Type III family. Other constructors accept a DataFrame plus either a UnivariateDistributionType or an existing Numerics.Distributions.UnivariateDistributionBase. In a stationary model, the fitted vector follows Distribution.GetParameters order exactly. One ConstantTrend holds each family parameter. In a nonstationary model, the vector is the concatenation of every trend's coefficients in family-parameter order.
The authoritative family order is listed in the distribution index. In particular, LnNormal coefficients are natural-space moments, LogNormal and LogPearsonTypeIII coefficients are base-10 log moments, and GEV/GPD shape signs are opposite the common Coles convention.
Let
Here
The scalar data log likelihood is the logarithm of (UNI.1). Impossible support, nonpositive interval probability, invalid distribution parameters, or any non-finite contribution returns negative infinity. The posterior target is
Here
For parameter
The model clones trends, assigns the candidate coefficient slices, predicts every natural distribution parameter, validates the resulting Numerics family, and evaluates that observation. Exact, uncertain, and interval records retain their explicit indexes. Perception-period counts are expanded into index-level pseudo-observations using FullTimeSeries; below events are assigned from the beginning and above events from the end after explicit records are removed. That deterministic chronology assumption is a documented limitation when parameters vary within a period.
SetDefaultParameters passes exact sample values to the selected Numerics GetParameterConstraints implementation. Returned initial, lower, and upper arrays initialize each constant coefficient and its default uniform prior. These are data-dependent numerical working bounds—not the family's mathematical support and not evidence-based prior limits. Nonstationary slope bounds are scaled using the record index range.
ModelParameter stores value, bounds, fixed state, and prior; it does not itself transform coordinates. Scale positivity is maintained by bounds and distribution validation. UseDefaultFlatPriors, UseJeffreysRuleForScale, EnableQuantilePriors, and QuantilePriors alter the prior target as detailed in the prior chapter.
Unusable samples produce an initialization validation diagnostic while preserving editable parameters and priors. A later valid sample clears that diagnostic. Initialization does not invent missing data or relax parameter support.
For stationary models, pointwise output contains one item for each exact, uncertain, or interval record and one aggregate item per threshold period. For nonstationary models, threshold components follow the expanded index sequence. PointwiseDataLogLikelihoodComponents attaches type, value, count, and name metadata. The values sum to the scalar data log likelihood for a finite state and feed WAIC, PSIS-LOO, and influence diagnostics. Comparing models with different pointwise partitions is not valid.
GenerateRandomValues simulates through the selected Numerics family after parameters are assigned. Simulation represents the latent fitted random variable; it does not automatically recreate historical thresholds, measurement error, missingness, or censoring. Validate checks data/model state and returns messages; analysis classes perform lifecycle validation before estimation.
Failure modes include insufficient exact data for default constraints, parameter-dependent support excluding observations, degenerate scales, weak tail-shape identification, incompatible nonstationary predictions, multimodal likelihoods, and overconfident extrapolation. An optimizer result or apparently converged chain does not establish family adequacy.
private static global::RMC.BestFit.Models.DataFrame CreateMixedDataFrame()
{
var threshold = new ThresholdData(1900, 1949, 1000.0)
{
NumberAbove = 3
};
return new global::RMC.BestFit.Models.DataFrame
{
ExactSeries = new ExactSeries(new[]
{
new ExactData(1950, 1210.0),
new ExactData(1951, 1675.0)
}),
UncertainSeries = new UncertainSeries(new[]
{
new UncertainData(1890, new Normal(1550.0, 180.0))
}),
IntervalSeries = new IntervalSeries(new[]
{
new IntervalData(1880, 1100.0, 1300.0, 1500.0)
}),
ThresholdSeries = new ThresholdSeries(new[] { threshold })
};
}This fixture demonstrates valid production data types. Full estimation belongs to an analysis workflow, not a direct call to an estimator on a Numerics distribution.
Primary implementation symbols are UnivariateDistribution, UnivariateDistributionModelBase, DataFrame, ModelParameter, and the selected Numerics distribution class. The compile-checked fixture guards the current construction API. Numerical validation claims remain family-specific and are linked from each chapter; numerical verification is never inferred from compilation alone.
[1] S. Coles, An Introduction to Statistical Modeling of Extreme Values. Springer, 2001.
[2] A. Gelman et al., Bayesian Data Analysis, 3rd ed. CRC Press, 2013.