mesmer.stats.fit_auto_regression_monthly#
- mesmer.stats.fit_auto_regression_monthly(monthly_data, time_dim='time')#
fit a cyclo-stationary auto-regressive process of lag one (AR(1)) on monthly data. The parameters are estimated for each month and gridpoint separately. This is based on the assumption that e.g. June depends on May differently than July on June. The auto regression is fit along time_dim.
A cyclo-stationary AR(1) process is defined as follows:
\[\mathbf{X}_{t, \tau} = \alpha_{0, \tau} + \alpha_{1, \tau} \mathbf{X}_{t, \tau -1} + \epsilon_{t, \tau}\]where \(\tau \in \{1, \ldots, N\}\) counts the seasons of some seasonal cycle, here the months of a year \((N=12)\) and \(t\) counts the repetitions of this seasonal cycle, here the years. Here \(\epsilon\) is a white noise process, i.e. \(\epsilon \sim N(0, \sigma^2)\). The covariance matrix of the driving white noise process should be estimated on the residuals of the AR(1) process. The residuals are returned here and should be passed to
find_localized_empirical_covariance_monthly
.For more information refer to Storch and Zwiers (1999) Chapter 10.3.8 [1].
- [1] Storch H von, Zwiers FW. Statistical Analysis in Climate Research.
Cambridge University Press; 1999, DOI:10.1017/CBO9780511612336.
- Parameters:
monthly_data (
xr.DataArray
of shape (n_timesteps, n_gridpoints)) – Axr.DataArray
to estimate the auto regression over. Each month has a value.time_dim (str) – Name of the time dimension (dimension along which to fit the auto regression).
- Returns:
obj (
xr.Dataset
) – Dataset containing the estimated parameters of the AR(1) process, theintercept
and theslope
for each month and gridpoint. Additionally, theresiduals
are returned. These are needed for the estimation of the covariance matrix.