code: def least_squares_parameters(n):
      """An order 1 least squared filter can be computed by a g-h filter
      by varying g and h over time according to the formulas below, where
      the first measurement is at n=0, the second is at n=1, and so on:
  
      .. math::
  
          h_n = \\frac{6}{(n+2)(n+1)}
  
          g_n = \\frac{2(2n+1)}{(n+2)(n+1)}
  
      Parameters
      ----------
  
      n : int
          the nth measurement, starting at 0 (i.e. first measurement has n==0)
  
      Returns
      -------
  
      (g,h)  : (float, float)
          g and h parameters for this time step for the least-squares filter
  
      Examples
      --------
  
      .. code-block:: Python
  
          from filterpy.gh import GHFilter, least_squares_parameters
  
          lsf = GHFilter (0, 0, 1, 0, 0)
          z = 10
          for i in range(10):
              g,h = least_squares_parameters(i)
              lsf.update(z, g, h)
  
      """
      den = (n + 2) * (n + 1)
  
      g = (2 * (2 * n + 1)) / den
      h = 6 / den
      return (g, h)
  
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 2 for calling a global function with example usage: least_squares_parameters(n) and returns: g,  h