Learn R Programming

games (version 1.1.2)

profile.game: Likelihood profiles for fitted strategic models

Description

Calculate profile likelihood to assess convergence of a model.

Usage

"profile"(fitted, which = 1:p, steps = 5, dist = 3, use.se = TRUE, report = TRUE, ...)

Arguments

fitted
a fitted model of class game.
which
integer vector giving the indices of the parameters to be profiled. The default is to use all parameters. Parameters that were held fixed in the original fitting are ignored if selected.
steps
number of steps to take (in each direction) from the original value for each parameter to be profiled.
dist
distance the last step should be from the original parameter value (in terms of standard errors if use.se is TRUE; absolute value otherwise). Should be a numeric vector of length equal to 1 or length(coef(fitted)).
use.se
logical: whether dist refers to standard errors
report
logical: whether to print status bar (for complex models or those with many parameters, profiling can be lengthy)
...
other arguments to be passed to the fitting function (see odemaxLik).

Value

A list of data frames, each containing the estimated coefficients across the profiled values for a particular parameter. The first column of each data frame is the log-likelihood for the given fits. The returned object is of class c("profile.game", "profile").

Details

Likelihood profiling can help determine if a model fit failed to reach a global maximum, which can be an issue (especially for the ultimatum model). The process of profiling is as follows: a parameter selected to be profiled is fixed at certain values spaced around its originally estimated value, while the log-likelihood is maximized with respect to the other parameters in the model. For models with large numbers of observations or parameters, profiling may take a long time, as $p * (2s + 1)$ models will be fit (p: number of parameters; s: number of steps).

The function will issue a warning if a model fit in profiling has a log-likelihood exceeding that of the original model. This means the original fit failed to reach a global maximum, and any inferences based on the fitted model are invalid. If this occurs, refit the model, passing the profile.game output to the fitting function's profile argument (as in the example below). The new fit will use the coefficients from the profile fit with the highest log-likelihood as starting values.

The function is based loosely on profile.glm in the MASS package. However, that function focuses on the calculation of exact confidence intervals for regression coefficients, whereas this one is for diagnosing non-convergence. Future versions of the games package may incorporate the confidence interval functionality as well.

See Also

plot.profile.game for plotting profiled likelihoods

Examples

Run this code
data("student_offers")

## A model that does not converge to global max
f1 <- offer + accept ~ gender1 | gender2
m1 <- ultimatum(f1, maxOffer = 100, data = student_offers, s2 = 1)

p1 <- profile(m1)  ## Issues warning
plot(p1)

## Refit model with better starting values
m2 <- ultimatum(f1, maxOffer = 100, data = student_offers, s2 = 1, profile = p1)
p2 <- profile(m2)
plot(p2)

logLik(m1)
logLik(m2)  ## Improved

Run the code above in your browser using DataLab