Description Usage Arguments Details Value Warning See Also Examples
This function enables the visual analysis of the confidence sets generated by the likelihood function by creating a sample of targeted parameters from a confidence distribution.
1 |
model |
model of the targeted analysis. Current available models are: Gaussian Regression, Poisson Regression, Logistic Regression, Negative Binomial Regression and Gamma Regression (both inverse and log). |
y |
response variables |
fit |
basic statistics after fitting the model by R. Most of the model fits are available in GLM family. If the model cannot be fitted automatically, user must provide at least the list of response variable, design(X) matrix, maximum likelihood estimators, maximum log-likelihood value, and the inference function. |
target |
should the generated sample be based on confidence level |
targetvalue |
the numerical confidence level/ratio. This quantity can be a vector. |
cov |
the covariance matrix of the model. System will use the default covariance matrix, unless given by user. |
B |
number of rays to be generated. |
max_B |
maximum number of rays to be generated for each parameter. Default value is 1000. |
... |
further arguments to be passed down. |
The method generates a sample of parameters from a confidence distribution, which is designed so that its probabilities on the parameters are equal to the asymptotic coverage probabilities of the targeted confidence sets.
For certain models, the covariance matrix, cov
includes the mean square error of the model. For instance, Gaussian Regression. These models will have different covariance matrices, which contains only the MLE.
The number of rays generated is equal to the number of samples generated under one confidence level/ratio.
MLE |
the maximum likelihood estimators of the model |
diagnosis |
how many times does the ray generated intersects the boundary. They are categorized as “0”, “1”, “2” and “>2”. Each confidence level is displayed separately. |
boundary.sample |
the generated samples by boundary sampling method |
WaldBoundary.sample |
Wald boundary samples |
ray.z |
the randomly generated multivariate normal values |
numWald.interval |
1-dimensional numerical Wald intervals transformed from p-dimension for each desired |
simLik.interval |
1-dimensional simulated confidence intervals transformed from p-dimension for each desired |
convnumWald |
convergence diagnosis: 95% numerical Wald intervals for each parameter |
convsimuWald |
convergence diagnosis: simulated confidence intervals for each parameter |
If target
is defined to be "customized", critical values (cvalue) has to be specified by the user. It can be done by boundary(...,target="customized",cvalue=cvalue)
. This argument is optional, so it can be ignored when target
is not "customized".
independent
for independent sampling method.
Mgaussian
for gaussian regression.
Mpoisson
for log-linear regression.
Mlogistic
for logistic regression.
Mgamma
for gamma regression.
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 29 30 31 | library(MASS)
data(data.poisson)
Device <- data.poisson$Device
DataPlan <- data.poisson$DataPlan
y <- data.poisson$y
fit <- glm(y ~ (Device+DataPlan), family=poisson)
target <- "level"
targetvalue <- c(0.5,0.9) # targeted confidence level
out_b <- boundary("Mpoisson",y,fit,target,targetvalue,B=1000) # Simulation with desired number of rays
out_b <- boundary("Mpoisson",y,fit,target,targetvalue) # Simulation without defining B
out_b$diag # out_b$diag is equivalent to out_b$diagnosis
out_b$bound[1:20,] # out_b$bound is equivalent to out_b$boundary.sample
out_b$num # out_b$num is equivalent to out_b$numWald.interval
out_b$sim # out_b$sim is equivalent to out_b$simWald.interval
out_b$convnum # out_b$convnum is equivalent to out_b$convnumWald
out_b$convsim # out_b$convsim is equivalent to out_b$convsimWald
## Visualization
par(mfrow=c(2,2))
plot(out_b$bound[,7]~out_b$bound[,6],
xlab=expression(beta[1]),ylab=expression(beta[2]),cex=0.5)
points(out_b$MLE[2],out_b$MLE[3],pch=16,col="red",cex=1.5)
plot(out_b$bound[,6]~out_b$bound[,5],
xlab=expression(beta[0]),ylab=expression(beta[1]),cex=0.5)
points(out_b$MLE[1],out_b$MLE[2],pch=16,col="red",cex=1.5)
plot(out_b$bound[,7]~out_b$bound[,5],
xlab=expression(beta[0]),ylab=expression(beta[2]),cex=0.5)
points(out_b$MLE[1],out_b$MLE[3],pch=16,col="red",cex=1.5)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.