Skip to main content

gam_problem/
block_role.rs

1use serde::{Deserialize, Serialize};
2
3/// Role of a coefficient block within a multi-parameter model.
4#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
5pub enum BlockRole {
6    /// Single-parameter GAM (standard GLM/GAM mean model).
7    Mean,
8    /// Location parameter in GAMLSS / survival location-scale.
9    Location,
10    /// Scale (log-sigma) parameter in GAMLSS / survival location-scale.
11    Scale,
12    /// Time/baseline hazard block in survival models.
13    Time,
14    /// Threshold block in survival models.
15    Threshold,
16    /// Link-wiggle correction block.
17    LinkWiggle,
18}
19
20impl BlockRole {
21    #[inline]
22    pub const fn name(self) -> &'static str {
23        match self {
24            Self::Mean => "mean",
25            Self::Location => "location",
26            Self::Scale => "scale",
27            Self::Time => "time",
28            Self::Threshold => "threshold",
29            Self::LinkWiggle => "link-wiggle",
30        }
31    }
32}