Profile Method for MS Objects
DESCRIPTION:
Returns a list of elements (data frames), one element for each profiled parameter.
USAGE:
profile.ms(fitted, which, npoints, zetamax, delta, trace=F, data)
REQUIRED ARGUMENTS:
- fitted
-
a previously fitted object inheriting from class
"ms"
.
OPTIONAL ARGUMENTS:
- which
-
the subset of the parameters to use for profiling; by default, all parameters
are used.
- npoints
-
the number of steps to take in profiling. The algorithm attempts to
step
npoints
in each direction from the original fit, giving a total
of
2*npoints + 1
new fits per parameter.
- zetamax
-
the maximum absolute change in the objective function.
Default 10.
- delta
-
the vector of initial step sizes for each parameter. Defaults to a relative
change of
.5/npoints
.
- trace
-
should tracing be done during the re-fit. Defaults to
FALSE
, regardless
of the trace control during the original fit.
- data
-
optional data frame for fitting. Only needed if the data was not specified
explicitly in the original fit.
VALUE:
a profile, as described under the generic function; that is, a list
containing a data frame for each profiled parameter.
The data frames have two variables,
zeta
and
par.vals
.
The first is the square-root of the increase in the objective function
from the global fit, signed by the change in the profiled parameter.
The second is the matrix of corresponding profile-minimum parameter
values, optimized over all the other parameters in the model for a fixed
value of the profiled parameter.
EXAMPLES:
param(pingpong, "p") <- 0
attach(pingpong, 1)
D <- winner - loser
p <- sum(winner > loser)/length(winner)
alpha <- log(p/(1 - p))/mean(D)
detach(1, save = "pingpong")
lprob <- function(lp)log(1 + exp(lp)) - lp
fit.alpha <- ms( ~ lprob(D * alpha), pingpong)
profile(fit.alpha)