Expand description
Experimental optional typed formula/builder layer for compiling user model
specifications into typed gamlss-core models.
gamlss-formula is a boundary layer: it reads user data through
DataView, fits term metadata once, materializes predictor designs, and
returns a BuiltModel artifact. Optimizers, fitting loops, diagnostics,
dataframe ownership, and string formula parsing are intentionally outside
this crate.
This crate is not the primary API of the project. The current primary path is
the lower-level typed API in gamlss-core, gamlss-family, gamlss-spline,
and gamlss-transform. gamlss-formula is an experimental convenience layer
for curated high-level workflows and is not expected to cover every
distribution, link, or parameterization available in the lower-level crates.
§Example
use gamlss_core::Objective;
use gamlss_formula::prelude::*;
let data = TestData {
y: vec![0.0, 1.0, 2.0],
x: vec![0.0, 1.0, 2.0],
};
let y = col::<f64>("y");
let x = col::<f64>("x");
let mut built = normal()
.response(y)
.mu(intercept() + linear(x))
.sigma(intercept())
.build(&data)?;
let theta = vec![0.0, 0.5, -0.2];
assert!(built.model_mut().value(&theta)?.is_finite());Modules§
- prelude
- Common imports for the typed formula layer.
Structs§
- Beta
Spec - Typed beta model specification.
- Built
Model - Compiled formula artifact.
- Category
- Marker type for categorical columns.
- Col
- Typed reference to a named input column.
- CyclicP
Spline Term - Cyclic P-spline term options.
- Formula
Penalty - Formula-local segment penalty representation.
- Formula
Predictor Block - Formula predictor composed from a dense linear design, optional row offsets, and nonlinear monotone spline segments.
- Fourier
Term - Fourier term options.
- Gamma
Spec - Typed gamma model specification.
- Inverse
Gaussian Spec - Typed inverse Gaussian model specification.
- LogNormal
Spec - Typed log-normal model specification.
- Model
Schema - Schema for a built formula model.
- Model
Spec - Entry point namespace for typed model specifications.
- Monotone
Term - Hard-monotone I-spline term options.
- Normal
Spec - Typed normal model specification.
- PSpline
Term - Open-uniform P-spline term options.
- Parameter
Terms - Metadata for all terms belonging to one distribution parameter.
- Prediction
Design - Reusable prediction design compiled from fitted term metadata.
- Response
Schema - Response metadata.
- TensorP
Spline Term - Tensor-product P-spline term options.
- Term
Expr - Pre-data term expression for one parameter predictor.
- Weibull
Spec - Typed Weibull model specification.
Enums§
- BoolCol
- Boolean column storage returned by
DataView. - CatCol
- Categorical column storage returned by
DataView. - Fitted
Term - Fitted term metadata reusable for prediction.
- Formula
Error - Errors returned by the typed formula/builder layer.
- Numeric
Col - Numeric column storage returned by
DataView. - Numeric
Response - Response storage used by compiled formula models.
- Term
Spec - Pre-data term specification.
Traits§
- Data
View - Read-only data access contract for the formula layer.
Functions§
- beta
- Creates a beta model spec.
- col
- Creates a typed column reference.
- cyclic_
pspline - Creates a cyclic P-spline term expression with default options.
- factor
- Creates a categorical factor term expression.
- fourier
- Creates a Fourier term expression with default options.
- gamma
- Creates a gamma model spec.
- indicator
- Creates a boolean indicator term expression.
- interaction
- Creates a numeric product interaction term expression.
- intercept
- Creates an intercept term expression.
- inverse_
gaussian - Creates an inverse Gaussian model spec.
- linear
- Creates a linear term expression.
- log_
normal - Creates a log-normal model spec.
- monotone
- Creates a hard-monotone I-spline term expression with default options.
- no_
intercept - Creates an explicit empty term expression without an intercept.
- normal
- Creates a normal model spec.
- offset
- Creates a numeric offset term expression.
- pspline
- Creates an open-uniform P-spline term expression with default options.
- tensor_
pspline - Creates a tensor-product P-spline term expression with default options.
- weibull
- Creates a Weibull model spec.
Type Aliases§
- Beta
Blocks - Blocks for a beta formula model.
- Built
Beta - Built beta formula model.
- Built
Gamma - Built gamma formula model.
- Built
Inverse Gaussian - Built inverse Gaussian formula model.
- Built
LogNormal - Built log-normal formula model.
- Built
Normal - Built normal formula model.
- Built
Weibull - Built Weibull formula model.
- Compiled
Beta - Compiled beta formula model.
- Compiled
Gamma - Compiled gamma formula model.
- Compiled
Inverse Gaussian - Compiled inverse Gaussian formula model.
- Compiled
LogNormal - Compiled log-normal formula model.
- Compiled
Normal - Compiled normal formula model.
- Compiled
Weibull - Compiled Weibull formula model.
- Formula
Block - Formula block type used by supported family specs.
- Gamma
Blocks - Blocks for a gamma formula model.
- Inverse
Gaussian Blocks - Blocks for an inverse Gaussian formula model.
- LogNormal
Blocks - Blocks for a log-normal formula model.
- Normal
Blocks - Blocks for a normal formula model.
- Weibull
Blocks - Blocks for a Weibull formula model.