Skip to main content

MclmcChain

Struct MclmcChain 

Source
pub struct MclmcChain<M, R, A, T>
where M: Math, R: Rng, T: Transformation<M>, A: AdaptStrategy<M, Hamiltonian = TransformedHamiltonian<M, T>>,
{ /* private fields */ }
Expand description

Single-chain MCLMC sampler.

Implementations§

Source§

impl<M, R, A, T> MclmcChain<M, R, A, T>
where M: Math, R: Rng, T: Transformation<M>, A: AdaptStrategy<M, Hamiltonian = TransformedHamiltonian<M, T>>,

Source

pub fn new( math: M, hamiltonian: TransformedHamiltonian<M, T>, adapt: A, rng: R, chain: u64, subsample_frequency: f64, dynamic_step_size: bool, trajectory_kind: MclmcTrajectoryKind, switch_draw: u64, max_energy_error: f64, stats_options: StatOptions<M, A>, ) -> Self

Trait Implementations§

Source§

impl<M, R, A, T> Chain<M> for MclmcChain<M, R, A, T>
where M: Math, R: Rng, T: Transformation<M>, A: AdaptStrategy<M, Hamiltonian = TransformedHamiltonian<M, T>>,

Source§

type AdaptStrategy = A

Source§

fn set_position(&mut self, position: &[f64]) -> Result<()>

Initialize the sampler to a position. This should be called before calling draw. Read more
Source§

fn draw(&mut self) -> Result<(Box<[f64]>, Progress)>

Draw a new sample and return the position and some diagnosic information.
Source§

fn dim(&self) -> usize

The dimensionality of the posterior.
Source§

fn expanded_draw( &mut self, ) -> Result<(Box<[f64]>, M::ExpandedVector, Self::Stats, Progress)>

Source§

fn math(&self) -> Ref<'_, M>

Source§

impl<M, R, A, T> SamplerStats<M> for MclmcChain<M, R, A, T>
where M: Math, R: Rng, T: Transformation<M>, A: AdaptStrategy<M, Hamiltonian = TransformedHamiltonian<M, T>>,

Source§

type Stats = MclmcStats<StatsDims, <TransformedHamiltonian<M, T> as SamplerStats<M>>::Stats, <A as SamplerStats<M>>::Stats, <TransformedPoint<M> as SamplerStats<M>>::Stats>

Source§

type StatsOptions = StatOptions<M, A>

Source§

fn extract_stats( &self, math: &mut M, options: Self::StatsOptions, ) -> Self::Stats

Auto Trait Implementations§

§

impl<M, R, A, T> !Freeze for MclmcChain<M, R, A, T>

§

impl<M, R, A, T> !RefUnwindSafe for MclmcChain<M, R, A, T>

§

impl<M, R, A, T> !Send for MclmcChain<M, R, A, T>

§

impl<M, R, A, T> !Sync for MclmcChain<M, R, A, T>

§

impl<M, R, A, T> Unpin for MclmcChain<M, R, A, T>
where <A as AdaptStrategy<M>>::Collector: Unpin, A: Unpin, R: Unpin, <M as Math>::Vector: Unpin, T: Unpin, <A as SamplerStats<M>>::StatsOptions: Unpin, <T as SamplerStats<M>>::StatsOptions: Unpin, M: Unpin,

§

impl<M, R, A, T> UnsafeUnpin for MclmcChain<M, R, A, T>
where <A as AdaptStrategy<M>>::Collector: UnsafeUnpin, A: UnsafeUnpin, R: UnsafeUnpin, <M as Math>::Vector: UnsafeUnpin, T: UnsafeUnpin, <A as SamplerStats<M>>::StatsOptions: UnsafeUnpin, <T as SamplerStats<M>>::StatsOptions: UnsafeUnpin, M: UnsafeUnpin,

§

impl<M, R, A, T> !UnwindSafe for MclmcChain<M, R, A, T>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> ByRef<T> for T

Source§

fn by_ref(&self) -> &T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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 more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T, U> Imply<T> for U
where T: ?Sized, U: ?Sized,