'Test white noise assumption. Sample (Y) autocorrelations are compared
with the standard :math:`2 / \sqrt{T}` bounds.
Parameters
plot : boolean, default True
Plot autocorrelations with 2 / sqrt(T) bounds'

def test_whiteness(self, nlags=10, plot=True, linewidth=8):

    acorrs = self.sample_acorr(nlags)
    bound = (2 / np.sqrt(self.nobs))
    if (np.abs(acorrs) > bound).any():
        print(('FAIL:    Some    autocorrelations    exceed    %.4f    bound.    See    plot' % bound))
    else:
        print(('PASS:    No    autocorrelations    exceed    %.4f    bound' % bound))
    if plot:
        fig = plotting.plot_full_acorr(acorrs[1:], xlabel=np.arange(1, (nlags + 1)), err_bound=bound, linewidth=linewidth)
        fig.suptitle('ACF    plots    with    $2    /    \\sqrt{T}$    bounds    for    testing    whiteness    assumption')
