pub struct GaussianProcess<K>
where K: Kernel,
{ pub kernel: K, pub noise_model: NoiseModel, /* private fields */ }

Fields§

§kernel: K

Covariance Kernel

§noise_model: NoiseModel

Noise Model

Implementations§

source§

impl<K> GaussianProcess<K>
where K: Kernel,

source

pub fn train( kernel: K, x_train: DMatrix<f64>, y_train: DVector<f64>, noise_model: NoiseModel ) -> Result<Self, GaussianProcessError>

Train a Gaussian Process on the given data points

§Arguments
  • kernel - Kernel to use to determine covariance
  • x_train - Values to use for input into f
  • y_train - Known values for f(x)
  • noise_model - Noise model to use for fitting
source

pub fn k_inv(&self) -> &DMatrix<f64>

Return the inverse of K.

source

pub fn k_chol(&self) -> &Cholesky<f64, Dyn>

Return the Cholesky decomposition of K

source

pub fn kernel(&self) -> &K

Return the kernel being used in this GP

Trait Implementations§

source§

impl<K> Clone for GaussianProcess<K>
where K: Kernel + Clone,

source§

fn clone(&self) -> GaussianProcess<K>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<K> Debug for GaussianProcess<K>
where K: Kernel + Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de, K> Deserialize<'de> for GaussianProcess<K>
where K: Kernel + Deserialize<'de>,

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl<K> RandomProcess<f64> for GaussianProcess<K>
where K: Kernel,

§

type Index = Matrix<f64, Dyn, Const<1>, VecStorage<f64, Dyn, Const<1>>>

Type of the indexing set.
§

type SampleFunction = GaussianProcessPrediction<K>

Type of the sample function, aka trajectory of the process.
§

type Error = GaussianProcessError

Error from
source§

fn sample_function(&self, indicies: &[Self::Index]) -> Self::SampleFunction

Create a sample function at the indices given.
source§

fn ln_m(&self) -> f64

Compute the log marginal likelihood
source§

fn ln_m_with_params( &self, parameter: &DVector<f64> ) -> Result<(f64, DVector<f64>), GaussianProcessError>

Compute the log marginal likelihood with an different set of parameters and compute the gradient.
source§

fn parameters(&self) -> DVector<f64>

Get the parameters
source§

fn set_parameters( self, parameters: &DVector<f64> ) -> Result<Self, GaussianProcessError>

Set with the given parameters
source§

impl<K> RandomProcessMle<f64> for GaussianProcess<K>
where K: Kernel,

§

type Solver = LBFGS<MoreThuenteLineSearch<Matrix<f64, Dyn, Const<1>, VecStorage<f64, Dyn, Const<1>>>, Matrix<f64, Dyn, Const<1>, VecStorage<f64, Dyn, Const<1>>>, f64>, Matrix<f64, Dyn, Const<1>, VecStorage<f64, Dyn, Const<1>>>, Matrix<f64, Dyn, Const<1>, VecStorage<f64, Dyn, Const<1>>>, f64>

Error type from Optimization errors
source§

fn generate_solver() -> Self::Solver

Generator for optimizer
source§

fn random_params<R: Rng>(&self, rng: &mut R) -> DVector<f64>

Create random parameters for this Process
source§

fn optimize<R: Rng>( self, max_iters: u64, random_reinits: usize, rng: &mut R ) -> Result<Self, Error>

Run the optimization Read more
source§

impl<K> Serialize for GaussianProcess<K>
where K: Kernel + Serialize,

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

§

impl<K> Freeze for GaussianProcess<K>
where K: Freeze,

§

impl<K> RefUnwindSafe for GaussianProcess<K>
where K: RefUnwindSafe,

§

impl<K> Send for GaussianProcess<K>
where K: Send,

§

impl<K> Sync for GaussianProcess<K>
where K: Sync,

§

impl<K> Unpin for GaussianProcess<K>
where K: Unpin,

§

impl<K> UnwindSafe for GaussianProcess<K>
where K: UnwindSafe,

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> 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> Same for T

§

type Output = T

Should always be Self
source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

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>,

§

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<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

source§

impl<T> DeserializeOwnedAlias for T

source§

impl<T> SendAlias for T

source§

impl<T> SendSyncUnwindSafe for T
where T: Send + Sync + UnwindSafe + ?Sized,

source§

impl<T> SerializeAlias for T
where T: Serialize,

source§

impl<T> SyncAlias for T