Computes cross-section(s) of a multi-dimensional likelihood surface
slice(x, dim=1, ...)
sliceOld(fitted, which = 1:p, maxsteps = 100,
alpha = 0.01, zmax = sqrt(qchisq(1 - alpha/2, p)),
del = zmax/5, trace = FALSE,
tol.newmin=0.001, ...)
slice1D(params,fun,nt=101,lower=-Inf,
upper=Inf,verbose=TRUE, tranges=NULL,
fun_args = NULL,
...)
slice2D(params,fun,nt=31,lower=-Inf,
upper=Inf,
cutoff=10,verbose=TRUE,
tranges=NULL,
...)
slicetrans(params, params2, fun, extend=0.1, nt=401,
lower=-Inf, upper=Inf)
An object of class slice
with
a list of individual parameter (or parameter-pair) slices, each of which is a data frame with elements
name of the first variable
(for 2D slices) name of the second variable
parameter values
(for 2D slices) parameter values
slice values
a list (?) of the ranges for each parameter
vector of baseline parameter values
1 or 2
sliceOld returns instead a list with elements profile and summary (see profile.mle2)
a fitted model object of some sort
dimensionality of slices (1 or 2)
a named vector of baseline parameter values
a vector of parameter values
an objective function
additional arguments to pass to fun
(integer) number of slice-steps to take
lower bound(s) (stub?)
upper bound(s) (stub?)
maximum increase in objective function to allow when computing ranges
(numeric) fraction by which to extend range beyond specified points
print verbose output?
A fitted maximum likelihood model of class “mle2”
a numeric or character vector describing which parameters to profile (default is to profile all parameters)
maximum number of steps to take looking for an upper value of the negative log-likelihood
maximum (two-sided) likelihood ratio test confidence level to find
maximum value of signed square root of deviance difference to find (default value corresponds to a 2-tailed chi-squared test at level alpha)
step size for profiling
(logical) produce tracing output?
tolerance for diagnosing a new minimum below the minimum deviance estimated in initial fit is found
a two-column matrix giving lower and upper bounds for each parameter
additional arguments (not used)
Ben Bolker
Slices provide a lighter-weight way to explore likelihood surfaces than profiles, since they vary a single parameter rather than optimizing over all but one or two parameters.
is a generic method
creates one-dimensional slices, by default of all parameters of a model
creates two-dimensional slices, by default of all pairs of parameters in a model. In each panel the closed point represents the parameters given (typically the MLEs), while the open point represents the observed minimum value within the 2D slice. If everything has gone according to plan, these points should coincide (at least up to grid precision).
creates a slice along a transect between two specified
points in parameter space (see calcslice
in the emdbook
package)
x <- 0:10
y <- c(26, 17, 13, 12, 20, 5, 9, 8, 5, 4, 8)
d <- data.frame(x,y)
fit1 <- mle2(y~dpois(lambda=exp(lymax)/(1+x/exp(lhalf))),
start=list(lymax=0,lhalf=0),
data=d)
s1 <- bbmle::slice(fit1,verbose=FALSE)
s2 <- bbmle::slice(fit1,dim=2,verbose=FALSE)
require(lattice)
plot(s1)
plot(s2)
## 'transect' slice, from best-fit values to another point
st <- bbmle::slice(fit1,params2=c(5,0.5))
plot(st)
Run the code above in your browser using DataLab