Description Usage Arguments Details Author(s) References Examples

View source: R/check_residuals.R

Test the residuals of the model used for the OCSB test for serial correlation.

1 | ```
check_residuals(x, plot = F)
``` |

`x` |
results of ocsb test |

`plot` |
boolean, should barplot be printed? |

The residuals of the model used for the OCSB test should ideally be white noise. Here the Ljung-Box statistic is calculated and shown for all lags up to 2 times the frequency of the series. Be aware that the Ljung-Box statistic is a 'cumulative test'. For instance, the p-value of the Ljung-Box statistic for lag 3 is based on the null hypothesis, that the autocorrelations of the first three lags are jointly zero.

Daniel Ollech

Box, G. and G. Jenkins (1970). Time Series Analysis: Forecasting and Control. San Francisco: Holden-Day.

Osborn D.R., Chui A.P.L., Smith J., and Birchenhall C.R. (1988). Seasonality and the order of integration for consumption, Oxford Bulletin of Economics and Statistics 50(4):361-377.

1 2 | ```
teststat <- ocsb(ts(rnorm(100, 10,10), frequency=12), nrun=100)
check_residuals(teststat)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.