How do I do I simple linear regression using your framework? Your operations are not clear… It fails on taking an inverse and cal of the betas . XtX and XtY are correct.
let x: Vec<f64> = vec![1.0,1.0,1.0,1.0,1.0,3.0,1.0,5.0,2.0,4.0,5.0,4.0,6.0,4.0,6.0];
let y: Vec<f64> = vec![3.0,1.0,8.0,3.0,5.0];
let X = DMatrix::from_iterator(
5,
3,
x
.iter()
.cloned(),
);
let mut Y = DMatrix::from_iterator(
5,
1,
y
.iter()
.cloned(),
);
let XX = &X.transpose()*&X;
let XY = &X.transpose()*&Y;
let XX_inv = &XX.try_inverse();
let beta = &XX_inv*&XY;
error[E0369]: binary operation *
cannot be applied to type &std::option::Option<na::Matrix<f64, na::Dynamic, na::Dynamic, na::VecStorage<f64, na::Dynamic, na::Dynamic>>>
–> src/arima_estimation.rs:101:16

101  let beta = XX_inv*XY;
 ^^^^^^^^^

= note: an implementation of std::ops::Mul
might be missing for &std::option::Option<na::Matrix<f64, na::Dynamic, na::Dynamic, na::VecStorage<f64, na::Dynamic, na::Dynamic>>>