def calc_ar_neff(phi, n=1):
    """Calculate number of effective, i.e. independent samples
    for a given lag-one autocorrelation

    Parameters
    ----------
    phi : float
        Lag-one autocorrelation parameter
    n :
        Number of datapoints in the time series

    Returns
    -------
    neff : float
        Number of independent observations


    Reference
    ---------
    .. Wilks, D.S., 2006, Statistical methods in the atmospheric sciences,
       Elsevier, 2nd Edition, Chapter 5, p. 144
    """
    neff = n * (1 - phi) / (1 + phi)
    return neff