/// Construct new Hidden MarkovModel with the given transition, observation, and initial
/// state matrices and vectors with probabilities as `f64` values.
Construct new Hidden MarkovModel with the given transition, observation, and initial
state matrices and vectors with probabilities as `f64` values.
Construct new Hidden MarkovModel with the given transition observation and initial state matrices and vectors with probabilities as ` f64 ` values .
pub fn with_float(
            transition: &Array2<f64>,
            observation: &Array2<f64>,
            initial: &Array1<f64>,
            end: Option<&Array1<f64>>,
        ) -> Result<Self> {
            let initial_dim = initial.dim();
            let end_possible = (0..initial_dim).map(|_x| 1.0).collect::<Array1<f64>>();
            let end_un = end.unwrap_or(&end_possible);
            let has_end_state;
            match end {
                Some(_p) => {
                    has_end_state = true;
                }
                None => {
                    has_end_state = false;
                }
            }
            Self::new(
                RefCell::new(transition.map(|x| LogProb::from(Prob(*x)))),
                RefCell::new(observation.map(|x| LogProb::from(Prob(*x)))),
                RefCell::new(initial.map(|x| LogProb::from(Prob(*x)))),
                RefCell::new(end_un.map(|x| LogProb::from(Prob(*x)))),
                has_end_state,
            )
        }
pub fn with_float ( transition : & Array2 < f64 > , observation : & Array2 < f64 > , initial : & Array1 < f64 > , end : Option < & Array1 < f64 > > , ) -> Result < Self > { let initial_dim = initial . dim ( ) ; let end_possible = ( 0 .. initial_dim ) . map ( | _x | 1.0 ) . collect :: < Array1 < f64 > > ( ) ; let end_un = end . unwrap_or ( & end_possible ) ; let has_end_state ; match end { Some ( _p ) => { has_end_state = true ; } None => { has_end_state = false ; } } Self :: new ( RefCell :: new ( transition . map ( | x | LogProb :: from ( Prob ( * x ) ) ) ) , RefCell :: new ( observation . map ( | x | LogProb :: from ( Prob ( * x ) ) ) ) , RefCell :: new ( initial . map ( | x | LogProb :: from ( Prob ( * x ) ) ) ) , RefCell :: new ( end_un . map ( | x | LogProb :: from ( Prob ( * x ) ) ) ) , has_end_state , ) }
Construct new Hidden MarkovModel with the given transition, observation, and initial
state matrices and vectors with probabilities as `f64` values.
Construct new Hidden MarkovModel with the given transition observation and initial state matrices and vectors with probabilities as ` f64 ` values .
transition
&Array2<f64>
observation
&Array2<f64>
initial
&Array1<f64>
end
Option<&Array1<f64>>