pub struct GaussianLocationScaleFamily {
pub y: Array1<f64>,
pub weights: Array1<f64>,
pub mu_design: Option<DesignMatrix>,
pub log_sigma_design: Option<DesignMatrix>,
pub policy: ResourcePolicy,
pub cached_row_scalars: RwLock<Option<(Array1<f64>, Array1<f64>, Arc<GaussianJointRowScalars>)>>,
}Fields§
§y: Array1<f64>§weights: Array1<f64>§mu_design: Option<DesignMatrix>§log_sigma_design: Option<DesignMatrix>§policy: ResourcePolicyResource policy threaded into PsiDesignMap construction (and any other
per-call materialization decision) made during exact-Newton joint psi
derivative evaluation. Defaults to ResourcePolicy::default_library()
when the family is built without an explicit policy.
cached_row_scalars: RwLock<Option<(Array1<f64>, Array1<f64>, Arc<GaussianJointRowScalars>)>>Cached per-observation row scalars keyed by the FULL (η_μ, η_logσ)
predictor pair the scalars were computed at. The row scalars are a
deterministic function of (η_μ, η_logσ) (plus the fixed y/weights),
so a hit is only valid when both eta vectors match bit-for-bit element by
element — a lossy 3-point fingerprint could collide two genuinely
different predictors and serve STALE scalars, so the key is the whole
vectors. The compare is O(n), far cheaper than the O(n) transcendental
recompute it guards, and is hit K+ times per REML gradient/Hessian
evaluation under the same predictors.
Implementations§
Source§impl GaussianLocationScaleFamily
impl GaussianLocationScaleFamily
pub const BLOCK_MU: usize = 0
pub const BLOCK_LOG_SIGMA: usize = 1
pub fn parameternames() -> &'static [&'static str]
pub fn parameter_links() -> &'static [ParameterLink]
pub fn metadata() -> FamilyMetadata
Sourcepub fn block_effective_jacobian(
specs: &[ParameterBlockSpec],
block_idx: usize,
) -> Result<Box<dyn BlockEffectiveJacobian>, String>
pub fn block_effective_jacobian( specs: &[ParameterBlockSpec], block_idx: usize, ) -> Result<Box<dyn BlockEffectiveJacobian>, String>
Build the BlockEffectiveJacobian for block block_idx given the
realised block specs. Returns an AdditiveBlockJacobian encoding the
linear map η_r[i] = X_r[i,:] · β_r:
- block 0 (mu): output 0 = design rows, output 1 = zeros
- block 1 (log_sigma): output 0 = zeros, output 1 = design rows
Trait Implementations§
Source§impl Clone for GaussianLocationScaleFamily
impl Clone for GaussianLocationScaleFamily
Source§impl CustomFamily for GaussianLocationScaleFamily
impl CustomFamily for GaussianLocationScaleFamily
Source§fn exact_newton_joint_hessian_beta_dependent(&self) -> bool
fn exact_newton_joint_hessian_beta_dependent(&self) -> bool
The Gaussian location-scale joint Hessian depends on β because the cross-block (μ,log σ) and (log σ,log σ) blocks contain the residual r = y − μ (via the row scalars m = r·w and n = r²·w), which changes when β_μ moves. The (μ,μ) block weight w = 1/σ² also depends on β_{log σ}. This override is essential for correct M_j[u] drift corrections when ψ hyperparameters move the design matrices.
Source§fn outer_seed_config(&self, n_params: usize) -> SeedConfig
fn outer_seed_config(&self, n_params: usize) -> SeedConfig
Gaussian location-scale carries a NON-profiled second (log-σ) linear predictor, so — unlike an ordinary Gaussian GAM whose scalar dispersion is profiled out analytically — its smoothing-parameter selection exhibits the same capped-screening over-smoothing bias as a GLM block: the capped inner-iteration screening proxy ranks an over-smoothed scale seed cheapest (its coefficients collapse into the penalty null space and the proxy looks converged), so the log-σ smooth is flattened toward a constant σ, the 1/σ² IRLS weights go wrong, and the weight-coupled mean degrades too.
The default trait config classifies this as the generic
GeneralizedLinear profile (seed_budget=1, capped screening, a seed grid
reaching only ρ≈−2, and the parsimonious — smoothing-biased — keep-best),
every part of which pushes the scale toward over-smoothing. The spatial
(Matérn/GP) location-scale path already classifies the family as
GaussianLocationScale; this override extends that same correct
classification to the NON-spatial (thin-plate / P-spline) rho-only path,
which is the one a s(x, bs='tp') location-scale fit actually takes. The
GaussianLocationScale profile reuses Gaussian’s flexible seed grid (which
reaches the low-λ scale basin) and Gaussian’s lowest-cost keep-best (no
smoothing-biased tie-break), while still taking the interior-extreme seed
promotion so the flexible basin is actually full-solved. The budget mirrors
the spatial exact_joint_seed_config(Gaussian) (max_seeds=4, seed_budget=2).
Source§fn output_channel_assignment(
&self,
specs: &[ParameterBlockSpec],
) -> Option<Vec<usize>>
fn output_channel_assignment( &self, specs: &[ParameterBlockSpec], ) -> Option<Vec<usize>>
Two independent linear predictors: block 0 → μ channel, block 1 → log σ
channel. Declaring the channel topology lets fit_custom_family route
the identifiability audit channel-aware even when a caller builds the
blocks by hand (without build_location_scale_block’s callbacks), so a
shared μ/log-σ covariate basis is recognised as block-diagonal rather
than mistaken for cross-block intercept aliases (#558).
Source§fn log_likelihood_only_with_options(
&self,
block_states: &[ParameterBlockState],
options: &BlockwiseFitOptions,
) -> Result<f64, String>
fn log_likelihood_only_with_options( &self, block_states: &[ParameterBlockState], options: &BlockwiseFitOptions, ) -> Result<f64, String>
Outer-only log-likelihood with optional row subsample.
When options.outer_score_subsample is Some, only the sampled rows
contribute; each row’s per-row log-likelihood term is multiplied by
WeightedOuterRow.weight, the Horvitz–Thompson inverse-inclusion
factor 1/π_i (uniform or stratified sampling both supported), so the
partial sum is an unbiased estimator of the full-data log-likelihood.
When None, this returns the full-data log_likelihood_only. Inner
PIRLS line searches never install the subsample option, so they
continue to score the exact full-data log-likelihood.
Source§fn joint_jeffreys_term_required(&self) -> bool
fn joint_jeffreys_term_required(&self) -> bool
The Gaussian location-scale likelihood has no separation /
under-identification regime that the full-span Jeffreys curvature H_Φ
is meant to regularize: with the soft floor σ ≥ b > 0 the per-row
Fisher information diag(a/σ², 2κ²a) is bounded and O(n) on every
identified direction at every working point, so the well-conditioned-H
Jeffreys gate smooth-steps H_Φ to ~0 — yet the matching score ∇Φ
kept leaking a phantom penalized-stationarity residual into the inner
joint-Newton (a nonzero |∇L − Sβ| paired with a numerically null H_Φ
and a full-rank H_pen), so the KKT certificate refused every iterate
and the outer REML rejected all seeds — aborting heteroscedastic
location-scale fits (#684–#688). This is the same opt-out
TransformationNormalFamily takes for the same structural reason
(continuous response, O(n) Fisher information everywhere); it removes
the phantom residual and drops the per-cycle O(n·p²) Jeffreys
directional-derivative overhead.
Source§fn exact_newton_joint_psi_workspace_with_options(
&self,
block_states: &[ParameterBlockState],
specs: &[ParameterBlockSpec],
derivative_blocks: &[Vec<CustomFamilyBlockPsiDerivative>],
options: &BlockwiseFitOptions,
) -> Result<Option<Arc<dyn ExactNewtonJointPsiWorkspace>>, String>
fn exact_newton_joint_psi_workspace_with_options( &self, block_states: &[ParameterBlockState], specs: &[ParameterBlockSpec], derivative_blocks: &[Vec<CustomFamilyBlockPsiDerivative>], options: &BlockwiseFitOptions, ) -> Result<Option<Arc<dyn ExactNewtonJointPsiWorkspace>>, String>
Outer-aware joint ψ workspace with optional row subsample.
When options.outer_score_subsample is None, this is byte-identical
to exact_newton_joint_psi_workspace. When Some, the subsample is
stored in the workspace and forwarded into every per-row weight array
produced by gaussian_joint_psi_firstweights,
gaussian_joint_psisecondweights, and
gaussian_joint_psi_mixed_driftweights: each sampled row’s
contribution is multiplied by WeightedOuterRow.weight = 1/π_i and
non-sampled rows are zeroed. Every downstream assembly
(gaussian_joint_psi*_fromweights, weighted_crossprod_psi_maps,
xt_diag_*_dense,
build_two_block_custom_family_joint_psi_operator_from_actions) is
row-linear in these arrays via Xᵀ diag(W) Y, so the resulting
second-order ψ Hessian and ψ-Hessian directional derivative are
unbiased Horvitz–Thompson estimators of the full-data quantities.
Inner-PIRLS and final-covariance paths never install the option.
Source§fn exact_newton_joint_hessian_workspace_with_options(
&self,
block_states: &[ParameterBlockState],
specs: &[ParameterBlockSpec],
options: &BlockwiseFitOptions,
) -> Result<Option<Arc<dyn ExactNewtonJointHessianWorkspace>>, String>
fn exact_newton_joint_hessian_workspace_with_options( &self, block_states: &[ParameterBlockState], specs: &[ParameterBlockSpec], options: &BlockwiseFitOptions, ) -> Result<Option<Arc<dyn ExactNewtonJointHessianWorkspace>>, String>
Outer-aware joint-Hessian workspace with optional row subsample.
When options.outer_score_subsample is None, this is byte-identical
to exact_newton_joint_hessian_workspace. When Some, the precomputed
per-row coefficient arrays (coeff_mm, coeff_ml, coeff_ll) — which
every downstream assembly (hessian_dense, hessian_matvec,
hessian_diagonal) consumes row-linearly via Xᵀ diag(W) X — are
replaced by a Horvitz–Thompson mask: each sampled row’s coefficient is
multiplied by WeightedOuterRow.weight (the inverse-inclusion factor
1/π_i; uniform or stratified sampling both supported), and non-sampled
rows are zeroed. The resulting joint Hessian is an unbiased estimator
of the full-data joint Hessian. Inner PIRLS never installs the option,
so the inner solve continues to consume the exact full-data Hessian.
Source§fn outer_derivative_subsample_capable(&self) -> bool
fn outer_derivative_subsample_capable(&self) -> bool
Outer-derivative policy: declare HT-subsample capability.
GaussianLocationScaleFamily overrides
log_likelihood_only_with_options,
exact_newton_joint_hessian_workspace_with_options, and
exact_newton_joint_psi_workspace_with_options to consume
options.outer_score_subsample with per-row Horvitz–Thompson weights
(each sampled row’s contribution is multiplied by
WeightedOuterRow.weight = 1/π_i; non-sampled rows are zeroed),
yielding unbiased estimators of the full-data log-likelihood, joint
Hessian, and second-order ψ Hessian / ψ-Hessian directional
derivative. The ψ-workspace masking happens inside
apply_ht_mask_first, apply_ht_mask_second, and
apply_ht_mask_mixed on the GaussianJointPsi{First,Second, MixedDrift}Weights per-row arrays, immediately after the row-scalar
reductions and before the row-linear weighted_crossprod_psi_maps /
xt_diag_*_dense assemblies, so the masked outputs remain unbiased.
First-order ψ terms remain full-data exact (= trivially unbiased), so
the total outer score is still unbiased. Inner-PIRLS and final-
covariance paths never install the option, so they continue to
consume the exact full-data quantities.
Source§fn coefficient_hessian_cost(&self, specs: &[ParameterBlockSpec]) -> u64
fn coefficient_hessian_cost(&self, specs: &[ParameterBlockSpec]) -> u64
Source§fn evaluate(
&self,
block_states: &[ParameterBlockState],
) -> Result<FamilyEvaluation, String>
fn evaluate( &self, block_states: &[ParameterBlockState], ) -> Result<FamilyEvaluation, String>
Source§fn log_likelihood_only(
&self,
block_states: &[ParameterBlockState],
) -> Result<f64, String>
fn log_likelihood_only( &self, block_states: &[ParameterBlockState], ) -> Result<f64, String>
Source§fn exact_newton_joint_hessian(
&self,
block_states: &[ParameterBlockState],
) -> Result<Option<Array2<f64>>, String>
fn exact_newton_joint_hessian( &self, block_states: &[ParameterBlockState], ) -> Result<Option<Array2<f64>>, String>
Source§fn has_explicit_joint_hessian(&self) -> bool
fn has_explicit_joint_hessian(&self) -> bool
exact_newton_joint_hessian
(or its _with_specs variant) that returns the true coupled joint
Hessian rather than the trait’s block-diagonal default. Read moreSource§fn exact_newton_joint_hessian_directional_derivative(
&self,
block_states: &[ParameterBlockState],
d_beta_flat: &Array1<f64>,
) -> Result<Option<Array2<f64>>, String>
fn exact_newton_joint_hessian_directional_derivative( &self, block_states: &[ParameterBlockState], d_beta_flat: &Array1<f64>, ) -> Result<Option<Array2<f64>>, String>
Source§fn exact_newton_joint_hessiansecond_directional_derivative(
&self,
block_states: &[ParameterBlockState],
d_beta_u_flat: &Array1<f64>,
d_betav_flat: &Array1<f64>,
) -> Result<Option<Array2<f64>>, String>
fn exact_newton_joint_hessiansecond_directional_derivative( &self, block_states: &[ParameterBlockState], d_beta_u_flat: &Array1<f64>, d_betav_flat: &Array1<f64>, ) -> Result<Option<Array2<f64>>, String>
Source§fn diagonalworking_weights_directional_derivative(
&self,
block_states: &[ParameterBlockState],
block_idx: usize,
d_eta: &Array1<f64>,
) -> Result<Option<Array1<f64>>, String>
fn diagonalworking_weights_directional_derivative( &self, block_states: &[ParameterBlockState], block_idx: usize, d_eta: &Array1<f64>, ) -> Result<Option<Array1<f64>>, String>
d_eta for BlockWorkingSet::Diagonal. Read moreSource§fn exact_newton_joint_hessian_with_specs(
&self,
block_states: &[ParameterBlockState],
specs: &[ParameterBlockSpec],
) -> Result<Option<Array2<f64>>, String>
fn exact_newton_joint_hessian_with_specs( &self, block_states: &[ParameterBlockState], specs: &[ParameterBlockSpec], ) -> Result<Option<Array2<f64>>, String>
Source§fn exact_newton_joint_hessian_directional_derivative_with_specs(
&self,
block_states: &[ParameterBlockState],
specs: &[ParameterBlockSpec],
d_beta_flat: &Array1<f64>,
) -> Result<Option<Array2<f64>>, String>
fn exact_newton_joint_hessian_directional_derivative_with_specs( &self, block_states: &[ParameterBlockState], specs: &[ParameterBlockSpec], d_beta_flat: &Array1<f64>, ) -> Result<Option<Array2<f64>>, String>
Source§fn exact_newton_joint_hessian_second_directional_derivative_with_specs(
&self,
block_states: &[ParameterBlockState],
specs: &[ParameterBlockSpec],
d_beta_u_flat: &Array1<f64>,
d_betav_flat: &Array1<f64>,
) -> Result<Option<Array2<f64>>, String>
fn exact_newton_joint_hessian_second_directional_derivative_with_specs( &self, block_states: &[ParameterBlockState], specs: &[ParameterBlockSpec], d_beta_u_flat: &Array1<f64>, d_betav_flat: &Array1<f64>, ) -> Result<Option<Array2<f64>>, String>
Source§fn exact_newton_joint_psi_terms(
&self,
block_states: &[ParameterBlockState],
specs: &[ParameterBlockSpec],
derivative_blocks: &[Vec<CustomFamilyBlockPsiDerivative>],
psi_index: usize,
) -> Result<Option<ExactNewtonJointPsiTerms>, String>
fn exact_newton_joint_psi_terms( &self, block_states: &[ParameterBlockState], specs: &[ParameterBlockSpec], derivative_blocks: &[Vec<CustomFamilyBlockPsiDerivative>], psi_index: usize, ) -> Result<Option<ExactNewtonJointPsiTerms>, String>
Source§fn exact_newton_joint_psisecond_order_terms(
&self,
block_states: &[ParameterBlockState],
specs: &[ParameterBlockSpec],
derivative_blocks: &[Vec<CustomFamilyBlockPsiDerivative>],
psi_i: usize,
psi_j: usize,
) -> Result<Option<ExactNewtonJointPsiSecondOrderTerms>, String>
fn exact_newton_joint_psisecond_order_terms( &self, block_states: &[ParameterBlockState], specs: &[ParameterBlockSpec], derivative_blocks: &[Vec<CustomFamilyBlockPsiDerivative>], psi_i: usize, psi_j: usize, ) -> Result<Option<ExactNewtonJointPsiSecondOrderTerms>, String>
Source§fn exact_newton_joint_psihessian_directional_derivative(
&self,
block_states: &[ParameterBlockState],
specs: &[ParameterBlockSpec],
derivative_blocks: &[Vec<CustomFamilyBlockPsiDerivative>],
psi_index: usize,
d_beta_flat: &Array1<f64>,
) -> Result<Option<Array2<f64>>, String>
fn exact_newton_joint_psihessian_directional_derivative( &self, block_states: &[ParameterBlockState], specs: &[ParameterBlockSpec], derivative_blocks: &[Vec<CustomFamilyBlockPsiDerivative>], psi_index: usize, d_beta_flat: &Array1<f64>, ) -> Result<Option<Array2<f64>>, String>
Source§fn exact_newton_joint_psi_workspace(
&self,
block_states: &[ParameterBlockState],
specs: &[ParameterBlockSpec],
derivative_blocks: &[Vec<CustomFamilyBlockPsiDerivative>],
) -> Result<Option<Arc<dyn ExactNewtonJointPsiWorkspace>>, String>
fn exact_newton_joint_psi_workspace( &self, block_states: &[ParameterBlockState], specs: &[ParameterBlockSpec], derivative_blocks: &[Vec<CustomFamilyBlockPsiDerivative>], ) -> Result<Option<Arc<dyn ExactNewtonJointPsiWorkspace>>, String>
Source§fn exact_newton_joint_hessian_workspace(
&self,
block_states: &[ParameterBlockState],
specs: &[ParameterBlockSpec],
) -> Result<Option<Arc<dyn ExactNewtonJointHessianWorkspace>>, String>
fn exact_newton_joint_hessian_workspace( &self, block_states: &[ParameterBlockState], specs: &[ParameterBlockSpec], ) -> Result<Option<Arc<dyn ExactNewtonJointHessianWorkspace>>, String>
Source§fn inner_coefficient_hessian_hvp_available(
&self,
specs: &[ParameterBlockSpec],
) -> bool
fn inner_coefficient_hessian_hvp_available( &self, specs: &[ParameterBlockSpec], ) -> bool
Source§fn persistent_warm_start_fingerprint(
&self,
specs: &[ParameterBlockSpec],
options: &BlockwiseFitOptions,
) -> Option<String>
fn persistent_warm_start_fingerprint( &self, specs: &[ParameterBlockSpec], options: &BlockwiseFitOptions, ) -> Option<String>
Source§fn supports_log_likelihood_early_exit(&self) -> bool
fn supports_log_likelihood_early_exit(&self) -> bool
log_likelihood_only_with_options can use
BlockwiseFitOptions::early_exit_threshold to reject line-search trials
without computing the full log-likelihood.Source§fn exact_newton_outerobjective(&self) -> ExactNewtonOuterObjective
fn exact_newton_outerobjective(&self) -> ExactNewtonOuterObjective
Source§fn use_projected_penalty_logdet(&self) -> bool
fn use_projected_penalty_logdet(&self) -> bool
½ log|H + Sλ| and its analytic
trace gradient ½ tr((H+Sλ)⁺ ∂Sλ) are evaluated over the FULL
identifiable subspace range(H + Sλ) (mgcv’s generalized determinant,
gam#752) rather than the penalty-range subspace range(Sλ). Read moreSource§fn coefficient_gradient_cost(&self, specs: &[ParameterBlockSpec]) -> u64
fn coefficient_gradient_cost(&self, specs: &[ParameterBlockSpec]) -> u64
Source§fn exact_outer_derivative_order(
&self,
specs: &[ParameterBlockSpec],
_: &BlockwiseFitOptions,
) -> ExactOuterDerivativeOrder
fn exact_outer_derivative_order( &self, specs: &[ParameterBlockSpec], _: &BlockwiseFitOptions, ) -> ExactOuterDerivativeOrder
Source§fn outer_derivative_policy(
&self,
specs: &[ParameterBlockSpec],
psi_dim: usize,
options: &BlockwiseFitOptions,
) -> OuterDerivativePolicy
fn outer_derivative_policy( &self, specs: &[ParameterBlockSpec], psi_dim: usize, options: &BlockwiseFitOptions, ) -> OuterDerivativePolicy
Source§fn requires_joint_outer_hyper_path(&self) -> bool
fn requires_joint_outer_hyper_path(&self) -> bool
Source§fn block_geometry(
&self,
_: &[ParameterBlockState],
spec: &ParameterBlockSpec,
) -> Result<(DesignMatrix, ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>), String>
fn block_geometry( &self, _: &[ParameterBlockState], spec: &ParameterBlockSpec, ) -> Result<(DesignMatrix, ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>), String>
Source§fn block_geometry_is_dynamic(&self) -> bool
fn block_geometry_is_dynamic(&self) -> bool
block_geometry(...) can change with the current block state. Read moreSource§fn block_geometry_directional_derivative(
&self,
_: &[ParameterBlockState],
_: usize,
block_spec: &ParameterBlockSpec,
arr: &ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>,
) -> Result<Option<BlockGeometryDirectionalDerivative>, String>
fn block_geometry_directional_derivative( &self, _: &[ParameterBlockState], _: usize, block_spec: &ParameterBlockSpec, arr: &ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>, ) -> Result<Option<BlockGeometryDirectionalDerivative>, String>
Source§fn post_update_block_beta(
&self,
_: &[ParameterBlockState],
_: usize,
block_spec: &ParameterBlockSpec,
beta: ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>,
) -> Result<ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>, String>
fn post_update_block_beta( &self, _: &[ParameterBlockState], _: usize, block_spec: &ParameterBlockSpec, beta: ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>, ) -> Result<ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>, String>
Source§fn max_feasible_step_size(
&self,
_: &[ParameterBlockState],
_: usize,
arr: &ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>,
) -> Result<Option<f64>, String>
fn max_feasible_step_size( &self, _: &[ParameterBlockState], _: usize, arr: &ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>, ) -> Result<Option<f64>, String>
Source§fn joint_trust_metric_block_floor(
&self,
_: &[ParameterBlockState],
_: &[ParameterBlockSpec],
) -> Result<Option<ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>>, String>
fn joint_trust_metric_block_floor( &self, _: &[ParameterBlockState], _: &[ParameterBlockSpec], ) -> Result<Option<ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>>, String>
D. Read moreSource§fn block_linear_constraints(
&self,
_: &[ParameterBlockState],
_: usize,
block_spec: &ParameterBlockSpec,
) -> Result<Option<LinearInequalityConstraints>, String>
fn block_linear_constraints( &self, _: &[ParameterBlockState], _: usize, block_spec: &ParameterBlockSpec, ) -> Result<Option<LinearInequalityConstraints>, String>
A * beta_block >= b.Source§fn exact_newton_hessian_directional_derivative(
&self,
_: &[ParameterBlockState],
_: usize,
arr: &ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>,
) -> Result<Option<ArrayBase<OwnedRepr<f64>, Dim<[usize; 2]>>>, String>
fn exact_newton_hessian_directional_derivative( &self, _: &[ParameterBlockState], _: usize, arr: &ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>, ) -> Result<Option<ArrayBase<OwnedRepr<f64>, Dim<[usize; 2]>>>, String>
Source§fn exact_newton_hessian_second_directional_derivative(
&self,
_: &[ParameterBlockState],
_: usize,
arr: &ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>,
arr2: &ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>,
) -> Result<Option<ArrayBase<OwnedRepr<f64>, Dim<[usize; 2]>>>, String>
fn exact_newton_hessian_second_directional_derivative( &self, _: &[ParameterBlockState], _: usize, arr: &ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>, arr2: &ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>, ) -> Result<Option<ArrayBase<OwnedRepr<f64>, Dim<[usize; 2]>>>, String>
Source§fn exact_newton_joint_gradient_evaluation(
&self,
_: &[ParameterBlockState],
_: &[ParameterBlockSpec],
) -> Result<Option<ExactNewtonJointGradientEvaluation>, String>
fn exact_newton_joint_gradient_evaluation( &self, _: &[ParameterBlockState], _: &[ParameterBlockSpec], ) -> Result<Option<ExactNewtonJointGradientEvaluation>, String>
Source§fn exact_newton_joint_loglik_gradient(
&self,
_: &[ParameterBlockState],
) -> Result<Option<ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>>, String>
fn exact_newton_joint_loglik_gradient( &self, _: &[ParameterBlockState], ) -> Result<Option<ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>>, String>
g = nabla l(theta)
assembled from the SAME single source of truth as
Self::exact_newton_joint_hessian (e.g. a per-row jet-tower kernel), so
the damped Newton H delta = g is solved on a consistent (objective,
gradient, Hessian) triple. The default returns None, leaving the caller
on its legacy hand-assembled gradient.Source§fn batched_outer_gradient_terms(
&self,
block_states: &[ParameterBlockState],
specs: &[ParameterBlockSpec],
derivative_blocks: &[Vec<CustomFamilyBlockPsiDerivative>],
rho: &ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>,
options: &BlockwiseFitOptions,
hessian_workspace: Option<Arc<dyn ExactNewtonJointHessianWorkspace>>,
) -> Result<Option<BatchedOuterGradientTerms>, String>
fn batched_outer_gradient_terms( &self, block_states: &[ParameterBlockState], specs: &[ParameterBlockSpec], derivative_blocks: &[Vec<CustomFamilyBlockPsiDerivative>], rho: &ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>, options: &BlockwiseFitOptions, hessian_workspace: Option<Arc<dyn ExactNewtonJointHessianWorkspace>>, ) -> Result<Option<BatchedOuterGradientTerms>, String>
Source§fn batched_outer_hessian_terms(
&self,
block_states: &[ParameterBlockState],
specs: &[ParameterBlockSpec],
derivative_blocks: &[Vec<CustomFamilyBlockPsiDerivative>],
rho: &ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>,
hessian_workspace: Option<Arc<dyn ExactNewtonJointHessianWorkspace>>,
) -> Result<Option<BatchedOuterHessianTerms>, String>
fn batched_outer_hessian_terms( &self, block_states: &[ParameterBlockState], specs: &[ParameterBlockSpec], derivative_blocks: &[Vec<CustomFamilyBlockPsiDerivative>], rho: &ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>, hessian_workspace: Option<Arc<dyn ExactNewtonJointHessianWorkspace>>, ) -> Result<Option<BatchedOuterHessianTerms>, String>
fn inner_joint_workspace_gradient_available( &self, specs: &[ParameterBlockSpec], ) -> bool
Source§fn prefers_matrix_free_inner_joint(
&self,
specs: &[ParameterBlockSpec],
_: &[ParameterBlockState],
) -> bool
fn prefers_matrix_free_inner_joint( &self, specs: &[ParameterBlockSpec], _: &[ParameterBlockState], ) -> bool
use_joint_matrix_free_path heuristic. Read morefn inner_joint_workspace_log_likelihood_available( &self, specs: &[ParameterBlockSpec], ) -> bool
Source§fn outer_hyper_hessian_hvp_available(
&self,
specs: &[ParameterBlockSpec],
) -> bool
fn outer_hyper_hessian_hvp_available( &self, specs: &[ParameterBlockSpec], ) -> bool
Source§fn outer_hyper_hessian_dense_available(
&self,
specs: &[ParameterBlockSpec],
) -> bool
fn outer_hyper_hessian_dense_available( &self, specs: &[ParameterBlockSpec], ) -> bool
Source§fn outer_hyper_hessian_operator(
&self,
specs: &[ParameterBlockSpec],
) -> Option<Arc<dyn OuterHessianOperator>>
fn outer_hyper_hessian_operator( &self, specs: &[ParameterBlockSpec], ) -> Option<Arc<dyn OuterHessianOperator>>
Source§fn joint_hessian_is_structurally_coupled(
&self,
block_states: &[ParameterBlockState],
) -> Result<bool, String>
fn joint_hessian_is_structurally_coupled( &self, block_states: &[ParameterBlockState], ) -> Result<bool, String>
_with_specs joint dispatch
gates: is the family’s exact_newton_joint_hessian a genuinely coupled
matrix (nonzero off-diagonal blocks), as opposed to the trait’s
block-diagonal default? This is the marker-free signal that lets the
engine trust a coupled multi-block family that overrode the joint
Hessian without hand-setting has_explicit_joint_hessian(). Returns
false when no joint Hessian is available or it is block-diagonal.Source§fn likelihood_blocks_uncoupled(&self) -> bool
fn likelihood_blocks_uncoupled(&self) -> bool
∂²L/∂β_a∂β_b = 0 for every pair of
distinct blocks a ≠ b. Default false (assume coupling, the safe
answer); families whose blocks share no η/W coupling override to
true to opt into the default working-set joint-Hessian assembly for
multi-block specs.Source§fn joint_penalty_specs(&self) -> Result<Vec<JointPenaltySpec>, String>
fn joint_penalty_specs(&self) -> Result<Vec<JointPenaltySpec>, String>
Σ_b p_b_raw. Read moreSource§fn joint_jeffreys_information_with_specs(
&self,
block_states: &[ParameterBlockState],
specs: &[ParameterBlockSpec],
) -> Result<Option<ArrayBase<OwnedRepr<f64>, Dim<[usize; 2]>>>, String>
fn joint_jeffreys_information_with_specs( &self, block_states: &[ParameterBlockState], specs: &[ParameterBlockSpec], ) -> Result<Option<ArrayBase<OwnedRepr<f64>, Dim<[usize; 2]>>>, String>
Source§fn joint_jeffreys_information_directional_derivative_with_specs(
&self,
block_states: &[ParameterBlockState],
specs: &[ParameterBlockSpec],
d_beta_flat: &ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>,
) -> Result<Option<ArrayBase<OwnedRepr<f64>, Dim<[usize; 2]>>>, String>
fn joint_jeffreys_information_directional_derivative_with_specs( &self, block_states: &[ParameterBlockState], specs: &[ParameterBlockSpec], d_beta_flat: &ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>, ) -> Result<Option<ArrayBase<OwnedRepr<f64>, Dim<[usize; 2]>>>, String>
Self::joint_jeffreys_information_with_specs.Source§fn joint_jeffreys_information_directional_derivative_all_axes_with_specs(
&self,
block_states: &[ParameterBlockState],
specs: &[ParameterBlockSpec],
) -> Result<Option<Vec<ArrayBase<OwnedRepr<f64>, Dim<[usize; 2]>>>>, String>where
Self: Sync,
fn joint_jeffreys_information_directional_derivative_all_axes_with_specs(
&self,
block_states: &[ParameterBlockState],
specs: &[ParameterBlockSpec],
) -> Result<Option<Vec<ArrayBase<OwnedRepr<f64>, Dim<[usize; 2]>>>>, String>where
Self: Sync,
Self::joint_jeffreys_information_with_specs: with the direction
sweeping every canonical axis e_a, return the p dense matrices
{Hdot[e_a]}_{a=0..p}. Read moreSource§fn joint_jeffreys_information_second_directional_derivative_with_specs(
&self,
block_states: &[ParameterBlockState],
specs: &[ParameterBlockSpec],
d_beta_u_flat: &ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>,
d_betav_flat: &ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>,
) -> Result<Option<ArrayBase<OwnedRepr<f64>, Dim<[usize; 2]>>>, String>
fn joint_jeffreys_information_second_directional_derivative_with_specs( &self, block_states: &[ParameterBlockState], specs: &[ParameterBlockSpec], d_beta_u_flat: &ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>, d_betav_flat: &ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>, ) -> Result<Option<ArrayBase<OwnedRepr<f64>, Dim<[usize; 2]>>>, String>
Self::joint_jeffreys_information_with_specs.Source§fn joint_jeffreys_information_second_directional_all_axes_with_specs(
&self,
block_states: &[ParameterBlockState],
specs: &[ParameterBlockSpec],
d_beta_u_flat: &ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>,
) -> Result<Option<Vec<ArrayBase<OwnedRepr<f64>, Dim<[usize; 2]>>>>, String>
fn joint_jeffreys_information_second_directional_all_axes_with_specs( &self, block_states: &[ParameterBlockState], specs: &[ParameterBlockSpec], d_beta_u_flat: &ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>, ) -> Result<Option<Vec<ArrayBase<OwnedRepr<f64>, Dim<[usize; 2]>>>>, String>
Self::joint_jeffreys_information_with_specs: with d_beta_u fixed and
the second direction sweeping every canonical axis e_a, return the p
dense matrices {H²dot[d_beta_u, e_a]}_{a=0..p}. Read moreSource§fn exact_newton_joint_contracted_trace_hessian(
&self,
block_states: &[ParameterBlockState],
specs: &[ParameterBlockSpec],
weight: &ArrayBase<OwnedRepr<f64>, Dim<[usize; 2]>>,
) -> Result<Option<ArrayBase<OwnedRepr<f64>, Dim<[usize; 2]>>>, String>
fn exact_newton_joint_contracted_trace_hessian( &self, block_states: &[ParameterBlockState], specs: &[ParameterBlockSpec], weight: &ArrayBase<OwnedRepr<f64>, Dim<[usize; 2]>>, ) -> Result<Option<ArrayBase<OwnedRepr<f64>, Dim<[usize; 2]>>>, String>
Source§fn joint_jeffreys_information_contracted_trace_hessian_with_specs(
&self,
block_states: &[ParameterBlockState],
specs: &[ParameterBlockSpec],
weight: &ArrayBase<OwnedRepr<f64>, Dim<[usize; 2]>>,
) -> Result<Option<ArrayBase<OwnedRepr<f64>, Dim<[usize; 2]>>>, String>
fn joint_jeffreys_information_contracted_trace_hessian_with_specs( &self, block_states: &[ParameterBlockState], specs: &[ParameterBlockSpec], weight: &ArrayBase<OwnedRepr<f64>, Dim<[usize; 2]>>, ) -> Result<Option<ArrayBase<OwnedRepr<f64>, Dim<[usize; 2]>>>, String>
Self::joint_jeffreys_information_with_specs: Read moreSource§fn joint_jeffreys_information_contracted_trace_hessian_available(&self) -> bool
fn joint_jeffreys_information_contracted_trace_hessian_available(&self) -> bool
Self::joint_jeffreys_information_contracted_trace_hessian_with_specs
can supply the wide-p Jeffreys completion without the pairwise H''
fallback. Default false preserves the historical width cap exactly.Source§fn joint_jeffreys_information_matches_observed_hessian(&self) -> bool
fn joint_jeffreys_information_matches_observed_hessian(&self) -> bool
Self::joint_jeffreys_information_with_specs is the SAME
object as the observed joint Newton Hessian
(exact_newton_joint_hessian_with_specs). Read moreSource§fn levenberg_on_ill_conditioning(&self) -> bool
fn levenberg_on_ill_conditioning(&self) -> bool
μ on a FULL-RANK-but-ILL-CONDITIONED
penalized Hessian (cond > COND_NEWTON_SAFETY), not only on a
rank-deficient one (nullity > 0). Default false (binary / AFT /
others byte-identical). Survival marginal-slope overrides to true
(#808: full-rank but cond ≈ 5.8e6; the self-vanishing μ shapes only the
trajectory, so the converged β is unbiased and the log-slope target is
preserved). Survival-local by trait override so the shared spectral-range
solver stays byte-identical for every other family — in particular AFT
(survival_location_scale), whose intercept-only-scale fits can be
high-cond and which a shared (unconditional) gate would regress (#735/#736).Source§fn outer_default_trustworthy_for_joint_hessian(
&self,
specs: &[ParameterBlockSpec],
) -> bool
fn outer_default_trustworthy_for_joint_hessian( &self, specs: &[ParameterBlockSpec], ) -> bool
_with_specs defaults trust the
inner-fit’s block-diagonal-from-blocks output for this family? Read moreSource§fn exact_newton_outer_curvature(
&self,
_: &[ParameterBlockState],
) -> Result<Option<ExactNewtonOuterCurvature>, String>
fn exact_newton_outer_curvature( &self, _: &[ParameterBlockState], ) -> Result<Option<ExactNewtonOuterCurvature>, String>
Source§fn exact_newton_outer_curvature_directional_derivative(
&self,
block_states: &[ParameterBlockState],
d_beta_flat: &ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>,
) -> Result<Option<ArrayBase<OwnedRepr<f64>, Dim<[usize; 2]>>>, String>
fn exact_newton_outer_curvature_directional_derivative( &self, block_states: &[ParameterBlockState], d_beta_flat: &ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>, ) -> Result<Option<ArrayBase<OwnedRepr<f64>, Dim<[usize; 2]>>>, String>
exact_newton_outer_curvature.Source§fn exact_newton_outer_curvature_directional_derivative_with_specs(
&self,
block_states: &[ParameterBlockState],
_: &[ParameterBlockSpec],
d_beta_flat: &ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>,
) -> Result<Option<ArrayBase<OwnedRepr<f64>, Dim<[usize; 2]>>>, String>
fn exact_newton_outer_curvature_directional_derivative_with_specs( &self, block_states: &[ParameterBlockState], _: &[ParameterBlockSpec], d_beta_flat: &ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>, ) -> Result<Option<ArrayBase<OwnedRepr<f64>, Dim<[usize; 2]>>>, String>
exact_newton_outer_curvature_directional_derivative.Source§fn exact_newton_outer_curvature_second_directional_derivative(
&self,
block_states: &[ParameterBlockState],
d_beta_u_flat: &ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>,
d_beta_v_flat: &ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>,
) -> Result<Option<ArrayBase<OwnedRepr<f64>, Dim<[usize; 2]>>>, String>
fn exact_newton_outer_curvature_second_directional_derivative( &self, block_states: &[ParameterBlockState], d_beta_u_flat: &ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>, d_beta_v_flat: &ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>, ) -> Result<Option<ArrayBase<OwnedRepr<f64>, Dim<[usize; 2]>>>, String>
exact_newton_outer_curvature.Source§fn exact_newton_outer_curvature_second_directional_derivative_with_specs(
&self,
block_states: &[ParameterBlockState],
_: &[ParameterBlockSpec],
d_beta_u_flat: &ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>,
d_beta_v_flat: &ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>,
) -> Result<Option<ArrayBase<OwnedRepr<f64>, Dim<[usize; 2]>>>, String>
fn exact_newton_outer_curvature_second_directional_derivative_with_specs( &self, block_states: &[ParameterBlockState], _: &[ParameterBlockSpec], d_beta_u_flat: &ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>, d_beta_v_flat: &ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>, ) -> Result<Option<ArrayBase<OwnedRepr<f64>, Dim<[usize; 2]>>>, String>
exact_newton_outer_curvature_second_directional_derivative.Source§fn joint_outer_hyper_surrogate_hessian_with_specs(
&self,
block_states: &[ParameterBlockState],
specs: &[ParameterBlockSpec],
) -> Result<Option<ArrayBase<OwnedRepr<f64>, Dim<[usize; 2]>>>, String>
fn joint_outer_hyper_surrogate_hessian_with_specs( &self, block_states: &[ParameterBlockState], specs: &[ParameterBlockSpec], ) -> Result<Option<ArrayBase<OwnedRepr<f64>, Dim<[usize; 2]>>>, String>
Source§fn joint_outer_hyper_surrogate_hessian_directional_derivative_with_specs(
&self,
block_states: &[ParameterBlockState],
specs: &[ParameterBlockSpec],
d_beta_flat: &ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>,
) -> Result<Option<ArrayBase<OwnedRepr<f64>, Dim<[usize; 2]>>>, String>
fn joint_outer_hyper_surrogate_hessian_directional_derivative_with_specs( &self, block_states: &[ParameterBlockState], specs: &[ParameterBlockSpec], d_beta_flat: &ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>, ) -> Result<Option<ArrayBase<OwnedRepr<f64>, Dim<[usize; 2]>>>, String>
Source§fn joint_outer_hyper_surrogate_hessian_second_directional_derivative_with_specs(
&self,
block_states: &[ParameterBlockState],
specs: &[ParameterBlockSpec],
d_beta_u_flat: &ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>,
d_betav_flat: &ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>,
) -> Result<Option<ArrayBase<OwnedRepr<f64>, Dim<[usize; 2]>>>, String>
fn joint_outer_hyper_surrogate_hessian_second_directional_derivative_with_specs( &self, block_states: &[ParameterBlockState], specs: &[ParameterBlockSpec], d_beta_u_flat: &ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>, d_betav_flat: &ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>, ) -> Result<Option<ArrayBase<OwnedRepr<f64>, Dim<[usize; 2]>>>, String>
Source§fn diagonalworking_weights_second_directional_derivative(
&self,
_: &[ParameterBlockState],
_: usize,
arr: &ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>,
arr2: &ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>,
) -> Result<Option<ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>>, String>
fn diagonalworking_weights_second_directional_derivative( &self, _: &[ParameterBlockState], _: usize, arr: &ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>, arr2: &ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>, ) -> Result<Option<ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>>, String>
Source§fn exact_newton_joint_psi_workspace_for_first_order_terms(&self) -> bool
fn exact_newton_joint_psi_workspace_for_first_order_terms(&self) -> bool
Source§fn pseudo_logdet_mode(&self) -> PseudoLogdetMode
fn pseudo_logdet_mode(&self) -> PseudoLogdetMode
Source§impl CustomFamilyGenerative for GaussianLocationScaleFamily
impl CustomFamilyGenerative for GaussianLocationScaleFamily
fn generativespec( &self, block_states: &[ParameterBlockState], ) -> Result<GenerativeSpec, String>
Auto Trait Implementations§
impl !Freeze for GaussianLocationScaleFamily
impl !RefUnwindSafe for GaussianLocationScaleFamily
impl !UnwindSafe for GaussianLocationScaleFamily
impl Send for GaussianLocationScaleFamily
impl Sync for GaussianLocationScaleFamily
impl Unpin for GaussianLocationScaleFamily
impl UnsafeUnpin for GaussianLocationScaleFamily
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T, U> Imply<T> for U
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.