Description Usage Arguments Details Value References Examples
A function to create the normal conditional (randomized) quantile residuals. The majority of the code and descriptions are taken from Dunsmuir and Scott (2015).
1 | compnormRandPIT(object)
|
object |
an object class "cmp", obtained from a call to |
The function compPredProb
produces the non-randomized probability integral
transform(PIT). It returns estimates of the cumulative predictive probabilities as
upper and lower bounds of a collection of intervals. If the model is correct, a
histogram drawn using these estimated probabilities should resemble a histogram
obtained from a sample from the uniform distribution.
This function aims to produce observations which instead resemble a sample from a normal distribution. Such a sample can then be examined by the usual tools for checking normality, such as histograms and normal Q-Q plots.
For each of the intervals produced by compPredProb
, a random uniform observation
is generated, which is then converted to a normal observation by applying the inverse
standard normal distribution function (using qnorm
). The vector of these values
is returned by the function in the list element rt
. In addition non-random
observations which should appear similar to a sample from a normal distribution
are obtained by applying qnorm
to the mid-points of the predictive distribution
intervals. The vector of these values is returned by the function in the list element
rtMid
.
A list consisting of two elements:
rt |
the normal conditional randomized quantile residuals |
rdMid |
the midpoints of the predictive probability intervals |
Berkowitz, J. (2001). Testing density forecasts, with applications to risk management. Journal of Business \& Economic Statistics, 19, 465–474.
Dunn, P. K. and Smyth, G. K. (1996). Randomized quantile residuals. Journal of Computational and Graphical Statistics, 5, 236–244.
Dunsmuir, W.T.M. and Scott, D.J. (2015). The glarma
Package for Observation-Driven
Time Series Regression of Counts. Journal of Statistical Software,
67, 1–36.
1 2 3 4 | data(takeoverbids)
M.bids <- glm.cmp(numbids ~ leglrest + rearest + finrest + whtknght
+ bidprem + insthold + size + sizesq + regulatn, data=takeoverbids)
compnormRandPIT(M.bids)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.