class_docstr: Ornstein-Uhlenbeck
  
  :math::
    dx_t&=\lambda(\mu - x_t)dt+\sigma dW_t
  
  mean reverting process
  
  
  
  TODO: move exact higher up in class hierarchy
class_docstr_tok: ["Ornstein-Uhlenbeck",":","math",":",":","dx_t","&","=\\lambda","(","\\mu","-","x_t",")","dt+\\sigma","dW_t","mean","reverting","process","TODO",":","move","exact","higher","up","in","class","hierarchy"]
docstr: assumes data is 1d, univariate time series
  formula from sitmo
docstr_tok: ["assumes","data","is","1d",",","univariate","time","series","formula","from","sitmo"]
code: def fitls(self, data, dt):
      """assumes data is 1d, univariate time series
      formula from sitmo
      """
      # brute force, no parameter estimation errors
      nobs = len(data) - 1
      exog = np.column_stack((np.ones(nobs), data[:-1]))
      parest, res, rank, sing = np.linalg.lstsq(
          exog, data[1:], rcond=-1
      )
      const, slope = parest
      errvar = res / (nobs - 2.0)
      lambd = -np.log(slope) / dt
      sigma = np.sqrt(
          -errvar * 2.0 * np.log(slope) / (1 - slope**2) / dt
      )
      mu = const / (1 - slope)
      return mu, lambd, sigma
  
imports: import numpy
  from scipy import stats, signal
  import matplotlib.pyplot
label_desc: Use image node_id 7 for calling the OUprocess obj's underlying member method code with example usage: obj.fitls(data, dt) and returns: mu,  lambd,  sigma