class_docstr: Implements the g-h-k filter.
  
  Parameters
  ----------
  
  x : 1D np.array or scalar
      Initial value for the filter state. Each value can be a scalar
      or a np.array.
  
      You can use a scalar for x0. If order > 0, then 0.0 is assumed
      for the higher order terms.
  
      x[0] is the value being tracked
      x[1] is the first derivative (for order 1 and 2 filters)
      x[2] is the second derivative (for order 2 filters)
  
  dx : 1D np.array or scalar
      Initial value for the derivative of the filter state.
  
  ddx : 1D np.array or scalar
      Initial value for the second derivative of the filter state.
  
  dt : scalar
      time step
  
  g : float
      filter g gain parameter.
  
  h : float
      filter h gain parameter.
  
  k : float
      filter k gain parameter.
  
  
  
  Attributes
  ----------
  x : 1D np.array or scalar
      filter state
  
  dx : 1D np.array or scalar
     derivative of the filter state.
  
  ddx : 1D np.array or scalar
     second derivative of the filter state.
  
  x_prediction : 1D np.array or scalar
      predicted filter state
  
  dx_prediction : 1D np.array or scalar
     predicted derivative of the filter state.
  
  ddx_prediction : 1D np.array or scalar
     second predicted derivative of the filter state.
  
  dt : scalar
      time step
  
  g : float
      filter g gain parameter.
  
  h : float
      filter h gain parameter.
  
  k : float
      filter k gain parameter.
  
  y : np.array, or scalar
      residual (difference between measurement and prior)
  
  z : np.array, or scalar
      measurement passed into update()
  
  References
  ----------
  
  Brookner, "Tracking and Kalman Filters Made Easy". John Wiley and
  Sons, 1998.
class_docstr_tok: ["Implements","the","g-h-k","filter",".","Parameters","--","--","--","--","--","x",":","1D","np.array","or","scalar","Initial","value","for","the","filter","state",".","Each","value","can","be","a","scalar","or","a","np.array",".","You","can","use","a","scalar","for","x0",".","If","order",">","0",",","then","0.0","is","assumed","for","the","higher","order","terms",".","x","[","0","]","is","the","value","being","tracked","x","[","1","]","is","the","first","derivative","(","for","order","1","and","2","filters",")","x","[","2","]","is","the","second","derivative","(","for","order","2","filters",")","dx",":","1D","np.array","or","scalar","Initial","value","for","the","derivative","of","the","filter","state",".","ddx",":","1D","np.array","or","scalar","Initial","value","for","the","second","derivative","of","the","filter","state",".","dt",":","scalar","time","step","g",":","float","filter","g","gain","parameter",".","h",":","float","filter","h","gain","parameter",".","k",":","float","filter","k","gain","parameter",".","Attributes","--","--","--","--","--","x",":","1D","np.array","or","scalar","filter","state","dx",":","1D","np.array","or","scalar","derivative","of","the","filter","state",".","ddx",":","1D","np.array","or","scalar","second","derivative","of","the","filter","state",".","x_prediction",":","1D","np.array","or","scalar","predicted","filter","state","dx_prediction",":","1D","np.array","or","scalar","predicted","derivative","of","the","filter","state",".","ddx_prediction",":","1D","np.array","or","scalar","second","predicted","derivative","of","the","filter","state",".","dt",":","scalar","time","step","g",":","float","filter","g","gain","parameter",".","h",":","float","filter","h","gain","parameter",".","k",":","float","filter","k","gain","parameter",".","y",":","np.array",",","or","scalar","residual","(","difference","between","measurement","and","prior",")","z",":","np.array",",","or","scalar","measurement","passed","into","update","(",")","References","--","--","--","--","--","Brookner",",","``","Tracking","and","Kalman","Filters","Made","Easy","''",".","John","Wiley","and","Sons",",","1998","."]
docstr: Returns the Variance Reduction Factor for x of the prediction
  step of the filter.
  
  This implements the equation
  
  .. math::
      VRF(\hat{x}_{n+1,n}) = \\frac{VAR(\hat{x}_{n+1,n})}{\sigma^2_x}
  
  References
  ----------
  
  Asquith and Woods, "Total Error Minimization in First
  and Second Order Prediction Filters" Report No RE-TR-70-17, U.S.
  Army Missle Command. Redstone Arsenal, Al. November 24, 1970.
docstr_tok: ["Returns","the","Variance","Reduction","Factor","for","x","of","the","prediction","step","of","the","filter",".","This","implements","the","equation","..","math",":",":","VRF","(","\\hat","{","x","}","_","{","n+1",",","n","}",")","=","\\\\frac","{","VAR","(","\\hat","{","x","}","_","{","n+1",",","n","}",")","}","{","\\sigma^2_x","}","References","--","--","--","--","--","Asquith","and","Woods",",","``","Total","Error","Minimization","in","First","and","Second","Order","Prediction","Filters","''","Report","No","RE-TR-70-17",",","U.S.","Army","Missle","Command",".","Redstone","Arsenal",",","Al",".","November","24",",","1970","."]
code: def VRF_prediction(self):
      r"""
      Returns the Variance Reduction Factor for x of the prediction
      step of the filter.
  
      This implements the equation
  
      .. math::
          VRF(\hat{x}_{n+1,n}) = \\frac{VAR(\hat{x}_{n+1,n})}{\sigma^2_x}
  
      References
      ----------
  
      Asquith and Woods, "Total Error Minimization in First
      and Second Order Prediction Filters" Report No RE-TR-70-17, U.S.
      Army Missle Command. Redstone Arsenal, Al. November 24, 1970.
      """
  
      g = self.g
      h = self.h
      k = self.k
      gh2 = 2 * g + h
      return (g * k * (gh2 - 4) + h * (g * gh2 + 2 * h)) / (
          2 * k - (g * (h + k) * (gh2 - 4))
      )
  
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import numpy
  from numpy import dot
  from filterpy.common import pretty_str
label_desc: Use image node_id 4 for calling the GHKFilter obj's underlying member method code with example usage: obj.VRF_prediction() and returns: unknown