Autocorrelation and Partial Autocorrelation with NaNs

Sample Autocorrelation and Partial Autocorrelation Function (ACF and PACF) on time-series with NaNs

You are now following this Submission

NANAUTOCORR and NANPARCORR calculate the nlag autocorrelation and partial autocorrelation coefficients for a data vector containing NaNs. The MATLAB function CORR is used and allows to exclude couples of data including NaNs. Confidence boundaries for non-significant coefficients are given using Bartlett's formula, with the hypothesis of asymptotic normality. Based on the MATLAB function CORR. Any feedback or suggestion is appreciated.

Cite As

Fabio (2026). Autocorrelation and Partial Autocorrelation with NaNs (https://www.mathworks.com/matlabcentral/fileexchange/43840-autocorrelation-and-partial-autocorrelation-with-nans), MATLAB Central File Exchange. Retrieved .

General Information

MATLAB Release Compatibility

  • Compatible with any release

Platform Compatibility

  • Windows
  • macOS
  • Linux
Version Published Release Notes Action
1.0.0.0