class_docstr: Hidden Markov Model with Multivariate Gaussian Emissions trained
  using Variational Inference.
  
  References:
      * https://arxiv.org/abs/1605.08618
      * https://core.ac.uk/reader/10883750
      * https://theses.gla.ac.uk/6941/7/2005McGroryPhD.pdf
  
  Attributes
  ----------
  n_features : int
      Dimensionality of the Gaussian emissions.
  
  monitor_ : ConvergenceMonitor
      Monitor object used to check the convergence of EM.
  
  startprob_prior_ : array, shape (n_components, )
      Prior for the initial state occupation distribution.
  
  startprob_posterior_ : array, shape (n_components, )
      Posterior estimate of the state occupation distribution.
  
  transmat_prior_ : array, shape (n_components, n_components)
      Prior for the matrix of transition probabilities between states.
  
  transmat_posterior_ : array, shape (n_components, n_components)
      Posterior estimate of the transition probabilities between states.
  
  means_prior_: array, shape (n_components, n_features)
      Prior estimates for the mean of each state.
  
  means_posterior_: array, shape (n_components, n_features)
      Posterior estimates for the mean of each state.
  
  beta_prior_: array, shape (n_components, )
      Prior estimate on the scale of the variance over the means.
  
  beta_posterior_: array, shape (n_components, )
      Posterior estimate of the scale of the variance over the means.
  
  covars_ : array
      Covariance parameters for each state.
  
      The shape depends on :attr:`covariance_type`:
  
      * (n_components, )                        if "spherical",
      * (n_components, n_features)              if "diag",
      * (n_components, n_features, n_features)  if "full",
      * (n_features, n_features)                if "tied".
  
  dof_prior_: int / array
      The Degrees Of Freedom prior for each state's Wishart distribution.
      The type depends on :attr:`covariance_type`:
  
      * array, shape (n_components, )  if "full",
      * int                            if "tied".
  
  dof_prior_: int / array
      The Prior on the Degrees Of Freedom
      for each state's Wishart distribution.
      The type depends on :attr:`covariance_type`:
  
      * array, shape (n_components, )  if "full",
      * int                            if "tied".
  
  dof_posterior_: int / array
      The Degrees Of Freedom for each state's Wishart distribution.
      The type depends on :attr:`covariance_type`:
  
      * array, shape (n_components, )  if "full",
      * int                            if "tied".
  
  scale_prior_ : array
      Prior for the Inverse scale parameter for each state's
      Wishart distribution. The wishart distribution is
      the conjugate prior for the covariance.
  
      The shape depends on :attr:`covariance_type`:
  
      * (n_components, )                        if "spherical",
      * (n_components, n_features)              if "diag",
      * (n_components, n_features, n_features)  if "full",
      * (n_features, n_features)                if "tied".
  
  scale_posterior_ : array
      Inverse scale parameter for each state's wishart distribution.
      The wishart distribution is the conjugate prior for the covariance.
  
      The shape depends on :attr:`covariance_type`:
  
      * (n_components, )                        if "spherical",
      * (n_components, n_features)              if "diag",
      * (n_components, n_features, n_features)  if "full",
      * (n_features, n_features)                if "tied".
  
  Examples
  --------
  >>> from hmmlearn.hmm import VariationalGaussianHMM
  >>> VariationalGaussianHMM(n_components=2)  #doctest: +ELLIPSIS
  VariationalGaussianHMM(algorithm='viterbi',...
class_docstr_tok: ["Hidden","Markov","Model","with","Multivariate","Gaussian","Emissions","trained","using","Variational","Inference",".","References",":","*","https",":","\/\/arxiv.org\/abs\/1605.08618","*","https",":","\/\/core.ac.uk\/reader\/10883750","*","https",":","\/\/theses.gla.ac.uk\/6941\/7\/2005McGroryPhD.pdf","Attributes","--","--","--","--","--","n_features",":","int","Dimensionality","of","the","Gaussian","emissions",".","monitor_",":","ConvergenceMonitor","Monitor","object","used","to","check","the","convergence","of","EM",".","startprob_prior_",":","array",",","shape","(","n_components",",",")","Prior","for","the","initial","state","occupation","distribution",".","startprob_posterior_",":","array",",","shape","(","n_components",",",")","Posterior","estimate","of","the","state","occupation","distribution",".","transmat_prior_",":","array",",","shape","(","n_components",",","n_components",")","Prior","for","the","matrix","of","transition","probabilities","between","states",".","transmat_posterior_",":","array",",","shape","(","n_components",",","n_components",")","Posterior","estimate","of","the","transition","probabilities","between","states",".","means_prior_",":","array",",","shape","(","n_components",",","n_features",")","Prior","estimates","for","the","mean","of","each","state",".","means_posterior_",":","array",",","shape","(","n_components",",","n_features",")","Posterior","estimates","for","the","mean","of","each","state",".","beta_prior_",":","array",",","shape","(","n_components",",",")","Prior","estimate","on","the","scale","of","the","variance","over","the","means",".","beta_posterior_",":","array",",","shape","(","n_components",",",")","Posterior","estimate","of","the","scale","of","the","variance","over","the","means",".","covars_",":","array","Covariance","parameters","for","each","state",".","The","shape","depends","on",":","attr",":","`","covariance_type","`",":","*","(","n_components",",",")","if","``","spherical","''",",","*","(","n_components",",","n_features",")","if","``","diag","''",",","*","(","n_components",",","n_features",",","n_features",")","if","``","full","''",",","*","(","n_features",",","n_features",")","if","``","tied","''",".","dof_prior_",":","int","\/","array","The","Degrees","Of","Freedom","prior","for","each","state","'s","Wishart","distribution",".","The","type","depends","on",":","attr",":","`","covariance_type","`",":","*","array",",","shape","(","n_components",",",")","if","``","full","''",",","*","int","if","``","tied","''",".","dof_prior_",":","int","\/","array","The","Prior","on","the","Degrees","Of","Freedom","for","each","state","'s","Wishart","distribution",".","The","type","depends","on",":","attr",":","`","covariance_type","`",":","*","array",",","shape","(","n_components",",",")","if","``","full","''",",","*","int","if","``","tied","''",".","dof_posterior_",":","int","\/","array","The","Degrees","Of","Freedom","for","each","state","'s","Wishart","distribution",".","The","type","depends","on",":","attr",":","`","covariance_type","`",":","*","array",",","shape","(","n_components",",",")","if","``","full","''",",","*","int","if","``","tied","''",".","scale_prior_",":","array","Prior","for","the","Inverse","scale","parameter","for","each","state's","Wishart","distribution",".","The","wishart","distribution","is","the","conjugate","prior","for","the","covariance",".","The","shape","depends","on",":","attr",":","`","covariance_type","`",":","*","(","n_components",",",")","if","``","spherical","''",",","*","(","n_components",",","n_features",")","if","``","diag","''",",","*","(","n_components",",","n_features",",","n_features",")","if","``","full","''",",","*","(","n_features",",","n_features",")","if","``","tied","''",".","scale_posterior_",":","array","Inverse","scale","parameter","for","each","state","'s","wishart","distribution",".","The","wishart","distribution","is","the","conjugate","prior","for","the","covariance",".","The","shape","depends","on",":","attr",":","`","covariance_type","`",":","*","(","n_components",",",")","if","``","spherical","''",",","*","(","n_components",",","n_features",")","if","``","diag","''",",","*","(","n_components",",","n_features",",","n_features",")","if","``","full","''",",","*","(","n_features",",","n_features",")","if","``","tied","''",".","Examples","--","--","--","--",">",">",">","from","hmmlearn.hmm","import","VariationalGaussianHMM",">",">",">","VariationalGaussianHMM","(","n_components=2",")","#","doctest",":","+ELLIPSIS","VariationalGaussianHMM","(","algorithm='viterbi","'",",","..."]
docstr: Parameters
  ----------
  n_components : int
      Number of states.
  
  covariance_type : {"spherical", "diag", "full", "tied"}, optional
      The type of covariance parameters to use:
  
      * "spherical" --- each state uses a single variance value that
        applies to all features (default).
      * "diag" --- each state uses a diagonal covariance matrix.
      * "full" --- each state uses a full (i.e. unrestricted)
        covariance matrix.
      * "tied" --- all states use **the same** full covariance matrix.
  
  startprob_prior : array, shape (n_components, ), optional
      Parameters of the Dirichlet prior distribution for
      :attr:`startprob_`.
  
  transmat_prior : array, shape (n_components, n_components), optional
      Parameters of the Dirichlet prior distribution for each row
      of the transition probabilities :attr:`transmat_`.
  
  means_prior, beta_prior : array, shape (n_components, ), optional
      Mean and precision of the Normal prior distribtion for
      :attr:`means_`.
  
  scale_prior, dof_prior : array, optional
      Parameters of the prior distribution for the covariance matrix
      :attr:`covars_`.
  
      If :attr:`covariance_type` is "spherical" or "diag" the prior is
      the inverse gamma distribution, otherwise --- the inverse Wishart
      distribution.
  
      The shape of the scale_prior array depends on
      :attr:`covariance_type`:
  
      * (n_components, )                        if "spherical",
      * (n_components, n_features)              if "diag",
      * (n_components, n_features, n_features)  if "full",
      * (n_features, n_features)                if "tied".
  
  algorithm : {"viterbi", "map"}, optional
      Decoder algorithm.
  
      - "viterbi": finds the most likely sequence of states, given all
        emissions.
      - "map" (also known as smoothing or forward-backward): finds the
        sequence of the individual most-likely states, given all
        emissions.
  
  random_state: RandomState or an int seed, optional
      A random number generator instance.
  
  n_iter : int, optional
      Maximum number of iterations to perform.
  
  tol : float, optional
      Convergence threshold. EM will stop if the gain in log-likelihood
      is below this value.
  
  verbose : bool, optional
      Whether per-iteration convergence reports are printed to
      :data:`sys.stderr`.  Convergence can also be diagnosed using the
      :attr:`monitor_` attribute.
  
  params, init_params : string, optional
      The parameters that get updated during (``params``) or initialized
      before (``init_params``) the training.  Can contain any combination
      of 's' for startprob, 't' for transmat, 'm' for means, and 'c' for
      covars.  Defaults to all parameters.
  
  implementation : string, optional
      Determines if the forward-backward algorithm is implemented with
      logarithms ("log"), or using scaling ("scaling").  The default is
      to use logarithms for backwards compatability.
docstr_tok: ["Parameters","--","--","--","--","--","n_components",":","int","Number","of","states",".","covariance_type",":","{","``","spherical","''",",","``","diag","''",",","``","full","''",",","``","tied","''","}",",","optional","The","type","of","covariance","parameters","to","use",":","*","``","spherical","''","--","-","each","state","uses","a","single","variance","value","that","applies","to","all","features","(","default",")",".","*","``","diag","''","--","-","each","state","uses","a","diagonal","covariance","matrix",".","*","``","full","''","--","-","each","state","uses","a","full","(","i.e",".","unrestricted",")","covariance","matrix",".","*","``","tied","''","--","-","all","states","use","*","*","the","same","*","*","full","covariance","matrix",".","startprob_prior",":","array",",","shape","(","n_components",",",")",",","optional","Parameters","of","the","Dirichlet","prior","distribution","for",":","attr",":","`","startprob_","`",".","transmat_prior",":","array",",","shape","(","n_components",",","n_components",")",",","optional","Parameters","of","the","Dirichlet","prior","distribution","for","each","row","of","the","transition","probabilities",":","attr",":","`","transmat_","`",".","means_prior",",","beta_prior",":","array",",","shape","(","n_components",",",")",",","optional","Mean","and","precision","of","the","Normal","prior","distribtion","for",":","attr",":","`","means_","`",".","scale_prior",",","dof_prior",":","array",",","optional","Parameters","of","the","prior","distribution","for","the","covariance","matrix",":","attr",":","`","covars_","`",".","If",":","attr",":","`","covariance_type","`","is","``","spherical","''","or","``","diag","''","the","prior","is","the","inverse","gamma","distribution",",","otherwise","--","-","the","inverse","Wishart","distribution",".","The","shape","of","the","scale_prior","array","depends","on",":","attr",":","`","covariance_type","`",":","*","(","n_components",",",")","if","``","spherical","''",",","*","(","n_components",",","n_features",")","if","``","diag","''",",","*","(","n_components",",","n_features",",","n_features",")","if","``","full","''",",","*","(","n_features",",","n_features",")","if","``","tied","''",".","algorithm",":","{","``","viterbi","''",",","``","map","''","}",",","optional","Decoder","algorithm",".","-","``","viterbi","''",":","finds","the","most","likely","sequence","of","states",",","given","all","emissions",".","-","``","map","''","(","also","known","as","smoothing","or","forward-backward",")",":","finds","the","sequence","of","the","individual","most-likely","states",",","given","all","emissions",".","random_state",":","RandomState","or","an","int","seed",",","optional","A","random","number","generator","instance",".","n_iter",":","int",",","optional","Maximum","number","of","iterations","to","perform",".","tol",":","float",",","optional","Convergence","threshold",".","EM","will","stop","if","the","gain","in","log-likelihood","is","below","this","value",".","verbose",":","bool",",","optional","Whether","per-iteration","convergence","reports","are","printed","to",":","data",":","`","sys.stderr","`",".","Convergence","can","also","be","diagnosed","using","the",":","attr",":","`","monitor_","`","attribute",".","params",",","init_params",":","string",",","optional","The","parameters","that","get","updated","during","(","``","params","``",")","or","initialized","before","(","``","init_params","``",")","the","training",".","Can","contain","any","combination","of","'s","'","for","startprob",",","'t","'","for","transmat",",","'m","'","for","means",",","and","'","c","'","for","covars",".","Defaults","to","all","parameters",".","implementation",":","string",",","optional","Determines","if","the","forward-backward","algorithm","is","implemented","with","logarithms","(","``","log","''",")",",","or","using","scaling","(","``","scaling","''",")",".","The","default","is","to","use","logarithms","for","backwards","compatability","."]
code: def __init__(
      self,
      n_components=1,
      covariance_type="full",
      startprob_prior=None,
      transmat_prior=None,
      means_prior=None,
      beta_prior=None,
      dof_prior=None,
      scale_prior=None,
      algorithm="viterbi",
      random_state=None,
      n_iter=100,
      tol=1e-6,
      verbose=False,
      params="stmc",
      init_params="stmc",
      implementation="log",
  ):
      """
      Parameters
      ----------
      n_components : int
          Number of states.
  
      covariance_type : {"spherical", "diag", "full", "tied"}, optional
          The type of covariance parameters to use:
  
          * "spherical" --- each state uses a single variance value that
            applies to all features (default).
          * "diag" --- each state uses a diagonal covariance matrix.
          * "full" --- each state uses a full (i.e. unrestricted)
            covariance matrix.
          * "tied" --- all states use **the same** full covariance matrix.
  
      startprob_prior : array, shape (n_components, ), optional
          Parameters of the Dirichlet prior distribution for
          :attr:`startprob_`.
  
      transmat_prior : array, shape (n_components, n_components), optional
          Parameters of the Dirichlet prior distribution for each row
          of the transition probabilities :attr:`transmat_`.
  
      means_prior, beta_prior : array, shape (n_components, ), optional
          Mean and precision of the Normal prior distribtion for
          :attr:`means_`.
  
      scale_prior, dof_prior : array, optional
          Parameters of the prior distribution for the covariance matrix
          :attr:`covars_`.
  
          If :attr:`covariance_type` is "spherical" or "diag" the prior is
          the inverse gamma distribution, otherwise --- the inverse Wishart
          distribution.
  
          The shape of the scale_prior array depends on
          :attr:`covariance_type`:
  
          * (n_components, )                        if "spherical",
          * (n_components, n_features)              if "diag",
          * (n_components, n_features, n_features)  if "full",
          * (n_features, n_features)                if "tied".
  
      algorithm : {"viterbi", "map"}, optional
          Decoder algorithm.
  
          - "viterbi": finds the most likely sequence of states, given all
            emissions.
          - "map" (also known as smoothing or forward-backward): finds the
            sequence of the individual most-likely states, given all
            emissions.
  
      random_state: RandomState or an int seed, optional
          A random number generator instance.
  
      n_iter : int, optional
          Maximum number of iterations to perform.
  
      tol : float, optional
          Convergence threshold. EM will stop if the gain in log-likelihood
          is below this value.
  
      verbose : bool, optional
          Whether per-iteration convergence reports are printed to
          :data:`sys.stderr`.  Convergence can also be diagnosed using the
          :attr:`monitor_` attribute.
  
      params, init_params : string, optional
          The parameters that get updated during (``params``) or initialized
          before (``init_params``) the training.  Can contain any combination
          of 's' for startprob, 't' for transmat, 'm' for means, and 'c' for
          covars.  Defaults to all parameters.
  
      implementation : string, optional
          Determines if the forward-backward algorithm is implemented with
          logarithms ("log"), or using scaling ("scaling").  The default is
          to use logarithms for backwards compatability.
      """
      super().__init__(
          n_components=n_components,
          startprob_prior=startprob_prior,
          transmat_prior=transmat_prior,
          algorithm=algorithm,
          random_state=random_state,
          n_iter=n_iter,
          tol=tol,
          verbose=verbose,
          params=params,
          init_params=init_params,
          implementation=implementation,
      )
      self.covariance_type = covariance_type
      self.means_prior = means_prior
      self.beta_prior = beta_prior
      self.dof_prior = dof_prior
      self.scale_prior = scale_prior
  
imports: import logging
  import numbers
  import numpy
  from scipy import special
  from sklearn import cluster
  from sklearn.utils import check_random_state
  from .None import _kl_divergence, _utils
  from ._emissions import BaseCategoricalHMM, BaseGaussianHMM
  from .base import VariationalBaseHMM
  from .hmm import COVARIANCE_TYPES
  from .utils import fill_covars
label_desc: Use image node_id 1 to create a new VariationalGaussianHMM object from inherited base classes: BaseGaussianHMM, VariationalBaseHMM with example: obj = VariationalGaussianHMM(n_components, covariance_type, startprob_prior, transmat_prior, means_prior, beta_prior, dof_prior, scale_prior, algorithm, random_state, n_iter, tol, verbose, params, init_params, implementation)