Implement more and more logic.

This commit is contained in:
2020-02-16 12:32:14 +01:00
parent dd5667d82c
commit fd249da405
5 changed files with 287 additions and 16 deletions

View File

@@ -1,3 +1,5 @@
use ndarray::prelude::*;
use super::Kernel;
pub struct Constant {
@@ -10,4 +12,28 @@ impl Constant {
}
}
impl Kernel for Constant {}
impl Kernel for Constant {
fn k_diag(&self, ts: &[f64]) -> Array1<f64> {
Array1::ones(ts.len()) * self.var
}
fn order(&self) -> usize {
1
}
fn state_mean(&self, t: f64) -> Array1<f64> {
Array1::zeros(1)
}
fn state_cov(&self, t: f64) -> Array2<f64> {
array![[1.0]] * self.var
}
fn measurement_vector(&self) -> Array1<f64> {
array![1.0]
}
fn transition(&self, t0: f64, t1: f64) -> Array2<f64> {
todo!();
}
}