Esempio n. 1
0
 def __init__(self, x, y):
     x = marray(x, copy=False, subok=True, dtype=float_, order='F').ravel()
     y = marray(y, copy=False, subok=True, dtype=float_, order='F').ravel()
     if x.size != y.size:
         msg = "Incompatible size between observations (%s) and response (%s)!" 
         raise ValueError(msg % (x.size, y.size))
     idx = x.argsort()
     self._x = x[idx]
     self._y = y[idx]
     self._mask = mask_or(self._x._mask, self._y._mask, 
                          copy=False, small_mask=False)
Esempio n. 2
0
 def __init__(self, n):
     self._seasonal = marray(nempty((n,), float_))
     self._trend = marray(nempty((n,), float_))
     self._weights = marray(nempty((n,), float_))
     self._residuals = marray(nempty((n,), float_))
Esempio n. 3
0
 def __init__(self, y):
     self.y = marray(y, subok=True, copy=False).ravel()
     self._mask = self.y._mask
     if self._mask.any():
         raise ValueError("Masked arrays should be filled first!")
     self.y_eff = self.y.compressed()
Esempio n. 4
0
 def __init__(self, n):
     self._fval = marray(nempty((n,), dtype=float_, order='F'))
     self._rw = marray(nempty((n,), dtype=float_, order='F'))
     self._fres = marray(nempty((n,), dtype=float_, order='F'))
Esempio n. 5
0
#####---------------------------------------------------------------------------
#--- --- Loess ---
#####---------------------------------------------------------------------------
loess = _mloess.loess
loess_anova = _mloess.anova

################################################################################
if __name__ == '__main__':
    from maskedarray.testutils import assert_almost_equal
    from maskedarray import masked_values
    from numpy import fromiter
    import os
    
    if 1:
        NOx = marray([4.818, 2.849, 3.275, 4.691, 4.255, 5.064, 2.118, 4.602,
                      2.286, 0.970, 3.965, 5.344, 3.834, 1.990, 5.199, 5.283,
                      -9999, -9999, 3.752, 0.537, 1.640, 5.055, 4.937, 1.561])
        NOx = maskedarray.masked_values(NOx, -9999)
        E = marray([0.831, 1.045, 1.021, 0.970, 0.825, 0.891, 0.71, 0.801,
                    1.074, 1.148, 1.000, 0.928, 0.767, 0.701, 0.807, 0.902,
                    -9999, -9999, 0.997, 1.224, 1.089, 0.973, 0.980, 0.665])
        gas_fit_E = numpy.array([0.665, 0.949, 1.224])
        newdata = numpy.array([0.6650000, 0.7581667, 0.8513333, 0.9445000,
                               1.0376667, 1.1308333, 1.2240000])
        coverage = 0.99

        rfile = open(os.path.join('tests','gas_result'), 'r')
        results = []
        for i in range(8):
            rfile.readline()
            z = fromiter((float(v) for v in rfile.readline().rstrip().split()),