pastas.stats.tests.diagnostics ============================== .. py:function:: pastas.stats.tests.diagnostics(series: pandas.Series, alpha: float = 0.05, nparam: int = 0, lags: int = 15, stats: tuple = (), float_fmt: str = '{0:.2f}') -> pandas.DataFrame Methods to compute various diagnostics checks for a time series. :param series: Time series to compute the diagnostics for. :type series: pandas.Series :param alpha: significance level to use for the hypothesis testing. :type alpha: float, optional :param nparam: Number of parameters of the noisemodel. :type nparam: int, optional :param lags: Maximum number of lags (in days) to compute the autocorrelation tests for. :type lags: int, optional :param stats: Tuple with the diagnostic checks to perform. Not implemented yet. :type stats: tuple, optional :param float_fmt: String to use for formatting the floats in the returned DataFrame. :type float_fmt: str :returns: **df** -- DataFrame with the information for the diagnostics checks. The final column in this DataFrame report if the Null-Hypothesis is rejected. If H0 is not rejected (=False) the data is in agreement with one of the properties of white noise (e.g., normally distributed). :rtype: Pandas.DataFrame .. rubric:: Notes Different tests are computed depending on the regularity of the time step of the provided time series. pd.infer_freq is used to determined if the time steps are regular. .. rubric:: Examples >>> data = pd.Series(index=pd.date_range(start=0, periods=1000, freq="D"), >>> data=np.random.rand(1000)) >>> ps.stats.diagnostics(data) Out[0]: Checks Statistic P-value Reject H0 Shapiroo Normality 1.00 0.86 False D'Agostino Normality 1.18 0.56 False Runs test Autocorr. -0.76 0.45 False Durbin-Watson Autocorr. 2.02 nan False Ljung-Box Autocorr. 5.67 1.00 False In this example, the Null-hypothesis is not rejected and the data may be assumed to be white noise. .. !! processed by numpydoc !!