tolfind.boxcox {boxcoxmix} | R Documentation |
Grid search over tol for NPPML estimation of random effect and variance component models
Description
A grid search over the parameter tol
, to set the initial values of
the EM algorithm.
Usage
tolfind.boxcox(
formula,
groups = 1,
data,
K = 3,
lambda = 1,
EMdev.change = 1e-04,
plot.opt = 2,
s = 15,
steps = 500,
find.in.range = c(0, 1.5),
start = "gq",
verbose = FALSE,
noformat = FALSE,
...
)
Arguments
formula |
a formula describing the transformed response and the fixed effect model (e.g. y ~ x). |
groups |
the random effects. To fit overdispersion models , set |
data |
a data frame containing variables used in the fixed and random effect models. |
K |
the number of mass points. |
lambda |
a transformation parameter, setting |
EMdev.change |
a small scalar, with default 0.0001, used to determine when to stop EM algorithm. |
plot.opt |
Set |
s |
number of points in the grid search of |
steps |
maximum number of iterations for the EM algorithm. |
find.in.range |
search in a range of |
start |
a description of the initial values to be used in the fitted model, Quantile-based version "quantile" or Gaussian Quadrature "gq" can be set. |
verbose |
If set to FALSE, no printed output on progress. |
noformat |
Set |
... |
extra arguments will be ignored. |
Details
A grid search over tol
can be performed using tolfind.boxcox()
function, which works for np.boxcoxmix()
to find the
optimal solution.
Value
List with class boxcoxmix
containing:
MinDisparity |
the minimum disparity found. |
Mintol |
the
value of |
AllDisparities |
a vector containing all disparities calculated on the grid. |
Alltol |
list of |
AllEMconverged |
1 is TRUE, means the EM algorithm converged. |
aic |
the Akaike information criterion of the fitted regression model. |
bic |
the Bayesian information criterion of the fitted regression model. |
Author(s)
Amani Almohaimeed and Jochen Einbeck
See Also
Examples
# The Pennsylvanian Hospital Stay Data
data(hosp, package = "npmlreg")
test1 <- tolfind.boxcox(duration ~ age , data = hosp, K = 2, lambda = 0,
find.in.range = c(0, 2), s = 10, start = "gq")
# Minimal Disparity: 137.8368 at tol= 2
# Minimal Disparity with EM converged: 137.8368 at tol= 2
# Effect of Phenylbiguanide on Blood Pressure
data(PBG, package = "nlme")
test2 <- tolfind.boxcox(deltaBP ~ dose , groups = PBG$Rabbit, find.in.range = c(0, 2),
data = PBG, K = 2, lambda = -1, s = 15, start = "quantile", plot.opt = 0)
test2$Mintol
# [1] 1.6
test2$MinDisparity
# [1] 449.5876