games (version 1.0-1)

profile.game: Likelihood profiles for fitted strategic models

Description

Calculate profile likelihood to assess convergence of a model.

Usage

## S3 method for class 'game':
profile(fitted, which=1:p, steps=5, dist=3, 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
number of standard errors the last step should be from the original parameter value.
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 maxLik).

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 \times (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 DataCamp Workspace