mod residual_field

module residual_field

GMRF residual intensity on the class graph. GMRF residual on the floor graph.

Nodes are energy classes. Edges are observed hops between classes. The prior precision is the graph Laplacian plus a nugget, so neighbouring floors share a level and disconnected components do not. The likelihood pins each node to its observed e_min.

The residual score of a class is the posterior variance (unknown floor depth). An unassigned point — the residual cell U — scores the prior variance, which is larger than any observed node. That is the LGCP-style “hole” without a mesh on R^{3N} and without R-INLA.

Preferential effort: effort[i] counts full quenches spent on class i. The score is variance / (1 + effort), so a well-sampled uncertain node loses to an empty hole.

Structs and Unions

struct ResidualField

Field on the class graph.

Implementations

impl ResidualField

Functions

fn best_node(&self) -> Option<usize>

Class with the highest residual score, or None if U wins.

fn edge(&mut self, a: usize, b: usize)

Record a hop between classes a and b.

fn new() -> Self

Empty field.

fn observe(&mut self, i: usize, e: f64)

Observe class i at energy e and count one unit of effort.

fn posterior(&self) -> Option<(Array1<f64>, Array1<f64>)>

Posterior mean and variance at each node. Empty if there are no nodes.

fn residual_score(&self) -> f64

Score of the unassigned residual cell U.

fn resize(&mut self, n: usize)

Ensure nodes 0..n exist.

fn score(&self, i: usize) -> f64

Residual score of class i (high = worth a start).