fpval {fracdist} | R Documentation |
Calculate P-values for Fractional Unit Root and Cointegration Tests
Description
fpval
calculates P-values for a particular value of the observed
statistic and a set of intermediate calculations
that are output from other functions in the fracdist
package.
Usage
fpval(npts = 9, iq, stat, probs, bedf, ginv)
Arguments
npts |
An integer number of points for local approximation
of the EDF near the observed value of |
iq |
An integer scalar rank parameter for the test, from 1 through 12. This is often the difference in cointegration rank. |
stat |
A numeric scalar value of the test statistic. |
probs |
A numeric vector of probabilities over which an approximating empirical distribution function is obtained, taken from precalculated tables. |
bedf |
A numeric vector of quantiles of numerical distribution for specified
value of fractional integration order |
ginv |
A numeric vector of quantiles of the approximating chi-squared distribution. |
Value
A numeric scalar P-value.
References
James G. MacKinnon and Morten Ørregaard Nielsen, "Numerical Distribution Functions of Fractional Unit Root and Cointegration Tests," Journal of Applied Econometrics, Vol. 29, No. 1, 2014, pp.161-171.
See Also
fracdist_pvalues
for the calculation of P-values including any
intermediate calculations.
Examples
frtab <- get_fracdist_tab(iq = 3, iscon = 0)
bval <- unique(frtab[, 'bbb'])
probs <- unique(frtab[, 'probs'])
bedf <- rep(NA, length(probs))
for (i in 1:length(probs)) {
estcrit <- frtab[frtab[, 'probs'] == probs[i], 'xndf']
bedf[i] <- blocal(nb = 31, bb = 0.75, estcrit, bval)
}
fpval(npts = 9, iq = 3, stat = 3.84, probs, bedf, ginv = qchisq(probs, df = 3^2))