EVOLUTION-MANAGER
Edit File: box.test.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Box-Pierce and Ljung-Box Tests</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for Box.test {stats}"><tr><td>Box.test {stats}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Box-Pierce and Ljung-Box Tests</h2> <h3>Description</h3> <p>Compute the Box–Pierce or Ljung–Box test statistic for examining the null hypothesis of independence in a given time series. These are sometimes known as ‘portmanteau’ tests. </p> <h3>Usage</h3> <pre> Box.test(x, lag = 1, type = c("Box-Pierce", "Ljung-Box"), fitdf = 0) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>x</code></td> <td> <p>a numeric vector or univariate time series.</p> </td></tr> <tr valign="top"><td><code>lag</code></td> <td> <p>the statistic will be based on <code>lag</code> autocorrelation coefficients.</p> </td></tr> <tr valign="top"><td><code>type</code></td> <td> <p>test to be performed: partial matching is used.</p> </td></tr> <tr valign="top"><td><code>fitdf</code></td> <td> <p>number of degrees of freedom to be subtracted if <code>x</code> is a series of residuals.</p> </td></tr> </table> <h3>Details</h3> <p>These tests are sometimes applied to the residuals from an <code>ARMA(p, q)</code> fit, in which case the references suggest a better approximation to the null-hypothesis distribution is obtained by setting <code>fitdf = p+q</code>, provided of course that <code>lag > fitdf</code>. </p> <h3>Value</h3> <p>A list with class <code>"htest"</code> containing the following components: </p> <table summary="R valueblock"> <tr valign="top"><td><code>statistic</code></td> <td> <p>the value of the test statistic.</p> </td></tr> <tr valign="top"><td><code>parameter</code></td> <td> <p>the degrees of freedom of the approximate chi-squared distribution of the test statistic (taking <code>fitdf</code> into account).</p> </td></tr> <tr valign="top"><td><code>p.value</code></td> <td> <p>the p-value of the test.</p> </td></tr> <tr valign="top"><td><code>method</code></td> <td> <p>a character string indicating which type of test was performed.</p> </td></tr> <tr valign="top"><td><code>data.name</code></td> <td> <p>a character string giving the name of the data.</p> </td></tr> </table> <h3>Note</h3> <p>Missing values are not handled. </p> <h3>Author(s)</h3> <p>A. Trapletti</p> <h3>References</h3> <p>Box, G. E. P. and Pierce, D. A. (1970), Distribution of residual correlations in autoregressive-integrated moving average time series models. <em>Journal of the American Statistical Association</em>, <b>65</b>, 1509–1526. doi: <a href="https://doi.org/10.2307/2284333">10.2307/2284333</a>. </p> <p>Ljung, G. M. and Box, G. E. P. (1978), On a measure of lack of fit in time series models. <em>Biometrika</em>, <b>65</b>, 297–303. doi: <a href="https://doi.org/10.2307/2335207">10.2307/2335207</a>. </p> <p>Harvey, A. C. (1993) <em>Time Series Models</em>. 2nd Edition, Harvester Wheatsheaf, NY, pp. 44, 45. </p> <h3>Examples</h3> <pre> x <- rnorm (100) Box.test (x, lag = 1) Box.test (x, lag = 1, type = "Ljung") </pre> <hr /><div style="text-align: center;">[Package <em>stats</em> version 3.6.0 <a href="00Index.html">Index</a>]</div> </body></html>