def __new__(cls, base_factor, target, correlation_length, mask=NotSpecified): if target.ndim == 2 and base_factor.mask is not target.mask: raise IncompatibleTerms(term_1=base_factor, term_2=target) return super(_RollingCorrelation, cls).__new__( cls, inputs=[base_factor, target], window_length=correlation_length, mask=mask, )
def __new__(cls, dependent, independent, regression_length, mask=NotSpecified): if independent.ndim == 2 and dependent.mask is not independent.mask: raise IncompatibleTerms(term_1=dependent, term_2=independent) return super(RollingLinearRegression, cls).__new__( cls, inputs=[dependent, independent], window_length=regression_length, mask=mask, )