Statistics Functions

pyleoclim.Stats.simpleStats(y, axis=None)

Computes simple statistics

Computes the mean, median, min, max, standard deviation, and interquartile range of a numpy array y.

Args:

y (array): A Numpy array axis (int, typle of ints): Optional. Axis or Axes along which the means

are computed, the default is to compute the mean of the flattened array. If a tuple of ints, performed over multiple axes

Returns:

The mean, median, min, max, standard deviation and IQR by columns

pyleoclim.Stats.corrsig(y1, y2, nsim=1000, method='isospectral', alpha=0.05)
Estimates the significance of correlations between non IID time series by 3 independent methods:
  1. ‘ttest’: T-test where d.o.f are corrected for the effect of serial correlation

  2. ‘isopersistent’: AR(1) modeling of x and y.

3) ‘isospectral’: phase randomization of original inputs. (default) The T-test is parametric test, hence cheap but usually wrong except in idyllic circumstances. The others are non-parametric, but their computational requirements scales with nsim.

Args:

y1, y2 (array)- vector of (real) numbers of identical length, no NaNs allowed nsim (int)- the number of simulations [1000] method (str)- methods 1-3 above [‘isospectral’] alpha (float)- significance level for critical value estimation [0.05]

Returns:

r (real): correlation between x and y

signif (int): true if significant; false otherwise

p (real): Fraction of time series with higher correlation coefficents than observed (approximates the p-value).

Note that signif = True if and only if p <= alpha.