docstr: Generates sigma points and weights according to Van der Merwe's
  2004 dissertation[1]. It parametizes the sigma points using
  alpha, beta, kappa terms, and is the version seen in most publications.
  
  Unless you know better, this should be your default choice.
  
  Parameters
  ----------
  
  n : int
      Dimensionality of the state. 2n+1 weights will be generated.
  
  alpha : float
      Determins the spread of the sigma points around the mean.
      Usually a small positive value (1e-3) according to [3].
  
  beta : float
      Incorporates prior knowledge of the distribution of the mean. For
      Gaussian x beta=2 is optimal, according to [3].
  
  kappa : float, default=0.0
      Secondary scaling parameter usually set to 0 according to [4],
      or to 3-n according to [5].
  
  sqrt_method : function(ndarray), default=scipy.linalg.cholesky
      Defines how we compute the square root of a matrix, which has
      no unique answer. Cholesky is the default choice due to its
      speed. Typically your alternative choice will be
      scipy.linalg.sqrtm. Different choices affect how the sigma points
      are arranged relative to the eigenvectors of the covariance matrix.
      Usually this will not matter to you; if so the default cholesky()
      yields maximal performance. As of van der Merwe's dissertation of
      2004 [6] this was not a well reseached area so I have no advice
      to give you.
  
      If your method returns a triangular matrix it must be upper
      triangular. Do not use numpy.linalg.cholesky - for historical
      reasons it returns a lower triangular matrix. The SciPy version
      does the right thing.
  
  subtract : callable (x, y), optional
      Function that computes the difference between x and y.
      You will have to supply this if your state variable cannot support
      subtraction, such as angles (359-1 degreees is 2, not 358). x and y
      are state vectors, not scalars.
  
  References
  ----------
  
  .. [1] R. Van der Merwe "Sigma-Point Kalman Filters for Probabilitic
         Inference in Dynamic State-Space Models" (Doctoral dissertation)
docstr_tok: ["Generates","sigma","points","and","weights","according","to","Van","der","Merwe's","2004","dissertation","[","1","]",".","It","parametizes","the","sigma","points","using","alpha",",","beta",",","kappa","terms",",","and","is","the","version","seen","in","most","publications",".","Unless","you","know","better",",","this","should","be","your","default","choice",".","Parameters","--","--","--","--","--","n",":","int","Dimensionality","of","the","state",".","2n+1","weights","will","be","generated",".","alpha",":","float","Determins","the","spread","of","the","sigma","points","around","the","mean",".","Usually","a","small","positive","value","(","1e-3",")","according","to","[","3","]",".","beta",":","float","Incorporates","prior","knowledge","of","the","distribution","of","the","mean",".","For","Gaussian","x","beta=2","is","optimal",",","according","to","[","3","]",".","kappa",":","float",",","default=0.0","Secondary","scaling","parameter","usually","set","to","0","according","to","[","4","]",",","or","to","3-n","according","to","[","5","]",".","sqrt_method",":","function","(","ndarray",")",",","default=scipy.linalg.cholesky","Defines","how","we","compute","the","square","root","of","a","matrix",",","which","has","no","unique","answer",".","Cholesky","is","the","default","choice","due","to","its","speed",".","Typically","your","alternative","choice","will","be","scipy.linalg.sqrtm",".","Different","choices","affect","how","the","sigma","points","are","arranged","relative","to","the","eigenvectors","of","the","covariance","matrix",".","Usually","this","will","not","matter","to","you",";","if","so","the","default","cholesky","(",")","yields","maximal","performance",".","As","of","van","der","Merwe","'s","dissertation","of","2004","[","6","]","this","was","not","a","well","reseached","area","so","I","have","no","advice","to","give","you",".","If","your","method","returns","a","triangular","matrix","it","must","be","upper","triangular",".","Do","not","use","numpy.linalg.cholesky","-","for","historical","reasons","it","returns","a","lower","triangular","matrix",".","The","SciPy","version","does","the","right","thing",".","subtract",":","callable","(","x",",","y",")",",","optional","Function","that","computes","the","difference","between","x","and","y",".","You","will","have","to","supply","this","if","your","state","variable","can","not","support","subtraction",",","such","as","angles","(","359-1","degreees","is","2",",","not","358",")",".","x","and","y","are","state","vectors",",","not","scalars",".","References","--","--","--","--","--","..","[","1","]","R.","Van","der","Merwe","``","Sigma-Point","Kalman","Filters","for","Probabilitic","Inference","in","Dynamic","State-Space","Models","''","(","Doctoral","dissertation",")"]
code: def __init__(
      self, n, alpha, beta, kappa, sqrt_method=None, subtract=None
  ):
      """Generates sigma points and weights according to Van der Merwe's
      2004 dissertation[1]. It parametizes the sigma points using
      alpha, beta, kappa terms, and is the version seen in most publications.
  
      Unless you know better, this should be your default choice.
  
      Parameters
      ----------
  
      n : int
          Dimensionality of the state. 2n+1 weights will be generated.
  
      alpha : float
          Determins the spread of the sigma points around the mean.
          Usually a small positive value (1e-3) according to [3].
  
      beta : float
          Incorporates prior knowledge of the distribution of the mean. For
          Gaussian x beta=2 is optimal, according to [3].
  
      kappa : float, default=0.0
          Secondary scaling parameter usually set to 0 according to [4],
          or to 3-n according to [5].
  
      sqrt_method : function(ndarray), default=scipy.linalg.cholesky
          Defines how we compute the square root of a matrix, which has
          no unique answer. Cholesky is the default choice due to its
          speed. Typically your alternative choice will be
          scipy.linalg.sqrtm. Different choices affect how the sigma points
          are arranged relative to the eigenvectors of the covariance matrix.
          Usually this will not matter to you; if so the default cholesky()
          yields maximal performance. As of van der Merwe's dissertation of
          2004 [6] this was not a well reseached area so I have no advice
          to give you.
  
          If your method returns a triangular matrix it must be upper
          triangular. Do not use numpy.linalg.cholesky - for historical
          reasons it returns a lower triangular matrix. The SciPy version
          does the right thing.
  
      subtract : callable (x, y), optional
          Function that computes the difference between x and y.
          You will have to supply this if your state variable cannot support
          subtraction, such as angles (359-1 degreees is 2, not 358). x and y
          are state vectors, not scalars.
  
      References
      ----------
  
      .. [1] R. Van der Merwe "Sigma-Point Kalman Filters for Probabilitic
             Inference in Dynamic State-Space Models" (Doctoral dissertation)
  
      """
  
      self.n = n
      self.alpha = alpha
      self.beta = beta
      self.kappa = kappa
      if sqrt_method is None:
          self.sqrt = cholesky
      else:
          self.sqrt = sqrt_method
  
      if subtract is None:
          self.subtract = np.subtract
      else:
          self.subtract = subtract
  
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import matplotlib.pyplot
  import numpy.random
  from numpy.random import randn
  from numpy import asarray
  import numpy
  from filterpy.kalman import UnscentedKalmanFilter
  from filterpy.kalman import unscented_transform, MerweScaledSigmaPoints, JulierSigmaPoints, SimplexSigmaPoints
  from filterpy.common import Q_discrete_white_noise
  import filterpy.stats
  from math import cos, sin
  from filterpy.kalman import UnscentedKalmanFilter2
label_desc: Use image node_id 1 to create a new MerweScaledSigmaPoints2 object from inherited base classes: object with example: obj = MerweScaledSigmaPoints2(n, alpha, beta, kappa, sqrt_method, subtract)