extern crate rand;
use arima::{acf, sim};
use rand::prelude::*;
use rand_distr::{Distribution, Normal};
fn main() {
let mut rng: StdRng = SeedableRng::from_seed([100; 32]);
let normal = Normal::new(10.0, 2.0).unwrap();
let ts = sim::arima_sim(
1000, Some(&[0.7, 0.2]), None, 0, &|mut rng| normal.sample(&mut rng), &mut rng, )
.unwrap();
let ar = acf::ar(&ts, Some(2)).unwrap();
println!("Estimated parameters: {:?}", ar);
}