� �g�Uc @` s� d Z d d l m Z m Z m Z m Z d d l m Z m Z m Z m Z d d l m Z m Z d d d � Z d d d � Z d � Z d d d d � Z d S( u4 Copyright 2015 Roger R Labbe Jr. FilterPy library. http://github.com/rlabbe/filterpy Documentation at: https://filterpy.readthedocs.org Supporting book at: https://github.com/rlabbe/Kalman-and-Bayesian-Filters-in-Python This is licensed under an MIT license. See the readme.MD file for more information. i ( t absolute_importt divisiont print_functiont unicode_literals( t arrayt zerost vstackt eye( t expmt invg �?c C` s� | d k s | d k s t � | d k rm t d | d d | d g d | d | d g g d t �} nb t d | d d | d d | d g d | d | d | g d | d | d g g d t �} | | S( u� Returns the Q matrix for the Discrete Constant White Noise Model. dim may be either 2 or 3, dt is the time step, and sigma is the variance in the noise. Q is computed as the G * G^T * variance, where G is the process noise per time step. In other words, G = [[.5dt^2][dt]]^T for the constant velocity model. **Paramaeters** dim : int (2 or 3) dimension for Q, where the final dimension is (dim x dim) dt : float, default=1.0 time step in whatever units your filter is using for time. i.e. the amount of time between innovations var : float, default=1.0 variance in the noise i i g �?i g �?t dtypei ( t AssertionErrorR t float( t dimt dtt vart Q( ( s# ./filterpy/common/discretization.pyt Q_discrete_white_noise s ''#c C` s� | d k s | d k s t � | d k rc t | d d | d d g | d d | g g � } nv t | d d | d d | d d g | d d | d d | d d g | d d | d d | g g d t �} | | S( u Returns the Q matrix for the Discretized Continuous White Noise Model. dim may be either 2 or 3, dt is the time step, and sigma is the variance in the noise. **Paramaeters** dim : int (2 or 3) dimension for Q, where the final dimension is (dim x dim) dt : float, default=1.0 time step in whatever units your filter is using for time. i.e. the amount of time between innovations spectral_density : float, default=1.0 spectral density for the continuous process i i i i i i i R ( R R R ( R R t spectral_densityR ( ( s# ./filterpy/common/discretization.pyt Q_continuous_white_noise<