pub struct EmpiricalTableProvider { /* private fields */ }Expand description
Tabular empirical distribution provider (discrete factors + domains).
Implementations§
Source§impl EmpiricalTableProvider
impl EmpiricalTableProvider
Sourcepub fn set_domain(
&mut self,
var: VariableId,
values: impl IntoIterator<Item = Value>,
)
pub fn set_domain( &mut self, var: VariableId, values: impl IntoIterator<Item = Value>, )
Declare discrete domain for a variable.
Sourcepub fn insert_probability(
&mut self,
spec: &FactorSpec<'_>,
assignment: &Assignment,
probability: f64,
) -> Result<(), EvalError>
pub fn insert_probability( &mut self, spec: &FactorSpec<'_>, assignment: &Assignment, probability: f64, ) -> Result<(), EvalError>
Insert a factor probability for the given spec + assignment.
§Errors
Missing bindings for factor variables / conditions.
Trait Implementations§
Source§impl Clone for EmpiricalTableProvider
impl Clone for EmpiricalTableProvider
Source§impl Debug for EmpiricalTableProvider
impl Debug for EmpiricalTableProvider
Source§impl Default for EmpiricalTableProvider
impl Default for EmpiricalTableProvider
Source§fn default() -> EmpiricalTableProvider
fn default() -> EmpiricalTableProvider
Returns the “default value” for a type. Read more
Source§impl DistributionProvider for EmpiricalTableProvider
impl DistributionProvider for EmpiricalTableProvider
Source§fn probability(
&self,
spec: &FactorSpec<'_>,
assignment: &Assignment,
_ctx: &EvalContext,
) -> Result<f64, EvalError>
fn probability( &self, spec: &FactorSpec<'_>, assignment: &Assignment, _ctx: &EvalContext, ) -> Result<f64, EvalError>
Probability / density mass for a factor under an assignment. Read more
Source§fn support(
&self,
vars: &[VariableId],
_ctx: &EvalContext,
) -> Result<Arc<[Arc<[Value]>]>, EvalError>
fn support( &self, vars: &[VariableId], _ctx: &EvalContext, ) -> Result<Arc<[Arc<[Value]>]>, EvalError>
Discrete support for variables (cartesian rows of values aligned to
vars). Read moreSource§fn outcome(
&self,
var: VariableId,
assignment: &Assignment,
_ctx: &EvalContext,
) -> Result<f64, EvalError>
fn outcome( &self, var: VariableId, assignment: &Assignment, _ctx: &EvalContext, ) -> Result<f64, EvalError>
Outcome function value (identity: the bound value of
var). Read moreSource§fn n_draws(&self) -> Option<usize>
fn n_draws(&self) -> Option<usize>
Number of posterior draws, or
None for a single empirical world.Source§fn quadrature(
&self,
_vars: &[VariableId],
_ctx: &EvalContext,
) -> Result<Option<QuadratureNodes>, EvalError>
fn quadrature( &self, _vars: &[VariableId], _ctx: &EvalContext, ) -> Result<Option<QuadratureNodes>, EvalError>
Optional continuous quadrature nodes
(assignment_row, Lebesgue weight) for
crate::ExprNode::IntegralOut. Read moreAuto Trait Implementations§
impl !Freeze for EmpiricalTableProvider
impl RefUnwindSafe for EmpiricalTableProvider
impl Send for EmpiricalTableProvider
impl Sync for EmpiricalTableProvider
impl Unpin for EmpiricalTableProvider
impl UnsafeUnpin for EmpiricalTableProvider
impl UnwindSafe for EmpiricalTableProvider
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
Mutably borrows from an owned value. Read more