Skip to main content

stats_claw/likelihood/
types.rs

1//! Plain-data parameter structs for the library's statistical constructs.
2//!
3//! Each struct carries only the parameters (and any descriptive string fields)
4//! that identify a construct; all numerics live in the behaviour traits and
5//! inherent methods implemented for these types in the sibling modules. The
6//! structs derive `Default` so callers build them with struct-update syntax and
7//! set only the fields they care about.
8//!
9//! This file is produced mechanically by the `carve` tool from the source
10//! project; edit the carve inputs rather than this file.
11
12/// Likelihood for success counts under a binomial model.
13#[derive(Debug, Clone, Default)]
14pub struct BinomialLikelihood {
15    /// Number of trials.
16    pub number_of_trials: i64,
17    /// Unique name identifying a likelihood function.
18    pub function_name: String,
19    /// Free-text description.
20    pub description: String,
21    /// Mathematical formula.
22    pub formula: String,
23}
24
25/// Likelihood for categorical outcomes.
26#[derive(Debug, Clone, Default)]
27pub struct CategoricalLikelihood {
28    /// Number of categories.
29    pub number_of_categories: i64,
30    /// Unique name identifying a likelihood function.
31    pub function_name: String,
32    /// Free-text description.
33    pub description: String,
34    /// Mathematical formula.
35    pub formula: String,
36}
37
38/// Likelihood for waiting-time data under an exponential model.
39#[derive(Debug, Clone, Default)]
40pub struct ExponentialLikelihood {
41    /// Unique name identifying a likelihood function.
42    pub function_name: String,
43    /// Free-text description.
44    pub description: String,
45    /// Mathematical formula.
46    pub formula: String,
47}
48
49/// General maximum-likelihood estimation procedure.
50#[derive(Debug, Clone, Default)]
51pub struct MaximumLikelihood {
52    /// Estimation method.
53    pub estimation_method: String,
54    /// Convergence tolerance.
55    pub convergence_tolerance: f64,
56    /// Unique name identifying a likelihood function.
57    pub function_name: String,
58    /// Free-text description.
59    pub description: String,
60    /// Mathematical formula.
61    pub formula: String,
62}
63
64/// Likelihood for data under a normal model.
65#[derive(Debug, Clone, Default)]
66pub struct NormalLikelihood {
67    /// Whether the mean is parameterized.
68    pub mean_parameterized: bool,
69    /// Whether the variance is parameterized.
70    pub variance_parameterized: bool,
71    /// Unique name identifying a likelihood function.
72    pub function_name: String,
73    /// Free-text description.
74    pub description: String,
75    /// Mathematical formula.
76    pub formula: String,
77}
78
79/// Likelihood for count data under a Poisson model.
80#[derive(Debug, Clone, Default)]
81pub struct PoissonLikelihood {
82    /// Unique name identifying a likelihood function.
83    pub function_name: String,
84    /// Free-text description.
85    pub description: String,
86    /// Mathematical formula.
87    pub formula: String,
88}