class_docstr: A Factor that performs an ordinary least-squares regression predicting the
  columns of a given Factor from either the columns of another
  Factor/BoundColumn or a slice/single column of data.
  
  Parameters
  ----------
  dependent : zipline.pipeline.Factor
      The factor whose columns are the predicted/dependent variable of each
      regression with `independent`.
  independent : zipline.pipeline.slice.Slice or zipline.pipeline.Factor
      The factor/slice whose columns are the predictor/independent variable
      of each regression with `dependent`. If `independent` is a Factor,
      regressions are computed asset-wise.
  regression_length : int
      Length of the lookback window over which to compute each regression.
  mask : zipline.pipeline.Filter, optional
      A Filter describing which assets (columns) of `dependent` should be
      regressed against `independent` each day.
  
  See Also
  --------
  :func:`scipy.stats.linregress`
  :meth:`Factor.linear_regression`
  :class:`zipline.pipeline.factors.RollingLinearRegressionOfReturns`
  
  Notes
  -----
  Most users should call Factor.linear_regression rather than directly
  construct an instance of this class.
class_docstr_tok: ["A","Factor","that","performs","an","ordinary","least-squares","regression","predicting","the","columns","of","a","given","Factor","from","either","the","columns","of","another","Factor\/BoundColumn","or","a","slice\/single","column","of","data",".","Parameters","--","--","--","--","--","dependent",":","zipline.pipeline.Factor","The","factor","whose","columns","are","the","predicted\/dependent","variable","of","each","regression","with","`","independent","`",".","independent",":","zipline.pipeline.slice.Slice","or","zipline.pipeline.Factor","The","factor\/slice","whose","columns","are","the","predictor\/independent","variable","of","each","regression","with","`","dependent","`",".","If","`","independent","`","is","a","Factor",",","regressions","are","computed","asset-wise",".","regression_length",":","int","Length","of","the","lookback","window","over","which","to","compute","each","regression",".","mask",":","zipline.pipeline.Filter",",","optional","A","Filter","describing","which","assets","(","columns",")","of","`","dependent","`","should","be","regressed","against","`","independent","`","each","day",".","See","Also","--","--","--","--",":","func",":","`","scipy.stats.linregress","`",":","meth",":","`","Factor.linear_regression","`",":","class",":","`","zipline.pipeline.factors.RollingLinearRegressionOfReturns","`","Notes","--","--","-","Most","users","should","call","Factor.linear_regression","rather","than","directly","construct","an","instance","of","this","class","."]
code: def compute(self, today, assets, out, dependent, independent):
      alpha = out.alpha
      beta = out.beta
      r_value = out.r_value
      p_value = out.p_value
      stderr = out.stderr
  
      def regress(y, x):
          regr_results = linregress(y=y, x=x)
          # `linregress` returns its results in the following order:
          # slope, intercept, r-value, p-value, stderr
          alpha[i] = regr_results[1]
          beta[i] = regr_results[0]
          r_value[i] = regr_results[2]
          p_value[i] = regr_results[3]
          stderr[i] = regr_results[4]
  
      # If `independent` is a Slice or single column of data, broadcast it
      # out to the same shape as `dependent`, then compute column-wise. This
      # is efficient because each column of the broadcasted array only refers
      # to a single memory location.
      independent = broadcast_arrays(independent, dependent)[0]
      for i in range(len(out)):
          regress(y=dependent[:, i], x=independent[:, i])
  
imports: from numexpr import evaluate
  import numpy
  from numpy import broadcast_arrays
  from scipy.stats import linregress, spearmanr
  from zipline.assets import Asset
  from zipline.errors import IncompatibleTerms
  from zipline.pipeline.factors import CustomFactor
  from zipline.pipeline.filters import SingleAsset
  from zipline.pipeline.mixins import StandardOutputs
  from zipline.pipeline.sentinels import NotSpecified
  from zipline.pipeline.term import AssetExists
  from zipline.utils.input_validation import expect_bounded, expect_dtypes, expect_types
  from zipline.utils.math_utils import nanmean
  from zipline.utils.numpy_utils import float64_dtype, int64_dtype
  from .basic import Returns
label_desc: Use image node_id 2 for calling the RollingLinearRegression obj's underlying member method code with example usage: obj.compute(today, assets, out, dependent, independent) without return types