Description Usage Arguments Details Value Author(s) References See Also Examples
This function computes the tangent exponential model approximation for higher order likelihood inference about a scalar interest parameter of a parametric model. The function creates an object of class fr
.
1 2 |
psi |
A scalar value for the interest parameter. If |
nlogL |
A function to compute the negative log likelihood for the model of interest. It is a function of three quantities: |
phi |
A function to compute the canonical parameter of a local exponential family approximation to the density of interest. It requires values of the parameter |
make.V |
A function to compute |
th.init |
Initial value(s) of the parameter |
data |
Data frame or other object containing the data. |
tol |
Tolerance used for numerical differentiation of |
n.psi |
Number of values of |
The function computes quantities used for higher order likelihood approximations, which are intended to provide highly accurate inferences on scalar parameters in parametric statistical models. The key aspect is maximisation of the likelihood over a grid of values of the interest parameter psi
, and computation of likelihood modifications based on local exponential family approximation to the density. If n is the sample size, then the resulting inferences should be accurate to order n^(-3/2) in continuous models and to order n^(-1) in discrete models, and in many cases they are very close to exact results. The approximations rely on numerical computation of observed information matrices and of derivatives, and may fail in certain cases. The confidence intervals themselves and useful plots are produced using the functions summary
and plot
. For technical background and further details, see Sections 2.4 and 8.4.2 of the book cited below, which has many further references.
normal |
The MLE of the interest parameter, and its standard error |
th.hat |
MLEs of parameters ( |
th.hat.se |
Standard errors of MLEs, based on observed information |
th.rest |
Restricted MLEs ( |
r |
Values of likelihood root corresponding to |
psi |
Values of interest parameter |
q |
Values of likelihood modification |
rstar |
Values of modified likelihood root |
Anthony Davison <Anthony.Davison@epfl.ch> Alex-Antoine Fortin <alex@fortin.bio>
Brazzale, A. R., Davison, A. C. and Reid, N. (2007). Applied Asymptotics: Case Studies in Small-Sample Statistics. Cambridge University Press, Cambridge.
See also http://statwww.epfl.ch/AA.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | # Cost data example from Section 3.5 of "Applied Asymptotics"
cost <- data.frame(
f = factor( c(rep(1,13), rep(2,18)) ),
y = c( 30,172,210,212,335,489,651,1263,1294,1875,2213,2998,
4935,121,172,201,214,228,261,278,279,351,561,622,
694,848,853,1086,1110,1243,2543 ) )
nlogL <- function(psi, lam, data) {
s1 <- exp(lam[2])
m2 <- lam[1]
s2 <- exp(lam[3])
m1 <- psi + m2 + s2^2/2 - s1^2/2
-sum( dnorm(log(data$y), mean=ifelse(data$f==1, m1, m2),
sd=ifelse(data$f==1, s1, s2), log=TRUE) )
}
phi <- function(th, V, data) {
psi <- th[1]
lam <- th[-1]
s1 <- exp(lam[2])
m2 <- lam[1]
s2 <- exp(lam[3])
m1 <- psi + m2 + s2^2/2 - s1^2/2
c( m1/s1^2, 1/s1^2, m2/s2^2, 1/s2^2 )
}
make.V <- function(th, data) NULL
cost.lnorm.rat <- tem(psi = NULL, nlogL = nlogL, phi = phi,
make.V = make.V, th.init = c(0, 5, 2, 5), data = cost)
plot(cost.lnorm.rat, psi = 0, all = TRUE)
summary(cost.lnorm.rat)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.