reaster {aster}R Documentation

Aster Models with Random Effects

Description

Fits Aster Models with Random Effects using Laplace Approximation.

Usage

reaster(fixed, random, pred, fam, varvar, idvar, root,
    famlist = fam.default(), origin, data, effects, sigma, response)

Arguments

fixed

either a model matrix or a formula specifying response and model matrix. The model matrix for fixed effects.

random

either a model matrix or list of model matrices or a formula or a list of formulas specifying a model matrix or matrices. The model matrix or matrices for random effects. Each model matrix specifies the random effects for one variance component.

pred

an integer vector of length nnode determining the dependence graph of the aster model. pred[j] is the index of the predecessor of the node with index j unless the predecessor is a root node, in which case pred[j] == 0. See details section of aster for further requirements.

fam

an integer vector of length nnode determining the exponential family structure of the aster model. Each element is an index into the vector of family specifications given by the argument famlist.

varvar

a variable whose length is the row dimension of all model matrices that is a factor whose levels are character strings treated as variable names. The number of variable names is nnode. Must be of the form rep(vars, each = nind) where vars is a vector of variable names. Usually found in the data frame data when this is produced by the reshape function.

idvar

a variable whose length is the row dimension of all model matrices. The number of individuals is nind. Must be of the form rep(inds, times = nnode) where inds is a vector of labels for individuals. Usually found in the data frame data when this is produced by the reshape function.

root

a vector whose length is the row dimension of all model matrices. For nodes whose predecessors are root nodes specifies the value of the constant at that root node. Typically the vector having all components equal to one.

famlist

a list of family specifications (see families).

origin

a vector whose length is the row dimension of all model matrices. Distinguished point in parameter space. May be missing, in which case an unspecified default is provided. See details of aster for further explanation.

data

an optional data frame containing the variables in the model. If not found in data, the variables are taken from environment(fixed), typically the environment from which reaster is called. Usually produced by the reshape function. Not needed when model matrices rather than formulas are supplied in fixed and random.

effects

if not missing, a vector specifying starting values for all effects, fixed and random. Length is the sum of the column dimensions of all model matrices. If supplied, the random effects part should be standardized (random effects divided by their standard deviations, like the component c of the output of this function).

sigma

if not missing, a vector specifying starting values for the square roots of the variance components. Length is the number of model matrices for random effects (the length of the list random if a list and one if random is not a list.

response

if not missing, a vector specifying the response. Length is the row dimension of all model matrices. If missing, the response is determined by the response in the formula fixed.

Details

See the help page for the function aster for specification of aster models. This function only fits unconditional aster models (those with default values of the aster function arguments type and origin.type.

The only difference between this function and the aster function is that some effects are treated as random. The unconditional canonical parameter vector of the aster model is treated as an affine function of fixed and random effects

phi = M beta + sigma[1]^2 Z[1] b[1] + … + sigma[k]^2 Z[k] b[k]

where M and the Z[i] are model matrices specified by the arguments fixed and random, where beta is a vector of fixed effects and each b[i] is a vector of random effects that are assumed to be (marginally) normally distributed with mean vector zero and variance matrix sigma[i]^2 times the identity matrix. The vectors of random effects b[i] are not parameters, rather they are latent (unobservable, hypothetical) variables. The square roots of the variance components sigma[i] are parameters as are the components of beta.

This function maximizes an approximation to the likelihood introduced by Breslow and Clayton (1993). See Geyer, et al. (2013) for details.

Value

reaster returns an object of class inheriting from "reaster". An object of class "reaster" is a list containing at least the following components:

obj

The aster object returned by a call to the aster function to fit the fixed effects model.

fixed

the model matrix for fixed effects.

random

the model matrix or matrices for random effects.

dropped

names of columns dropped from the fixed effects matrix.

sigma

approximate MLE for square roots of variance components.

nu

approximate MLE for variance components.

c

penalized likelihood estimates for the c's, which are rescaled random effects.

b

penalized likelihood estimates for the random effects.

alpha

approximate MLE for fixed effects.

zwz

Z %*% W %*% t(Z) where Z is the model matrix for random effects and W is the Hessian matrix of minus the complete data log likelihood with respect to random effects with MLE values of the parameters plugged in.

response

the response vector.

origin

the origin (offset) vector.

iterations

number of iterations of trust region algorithm in each iteration of re-estimating zwz and re-fitting.

counts

number of iterations of Nelder-Mead in initial optimization of approximate missing data log likelihood.

deviance

up to a constant, minus twice the maximized value of the Breslow-Clayton approximation to the log-likelihood. (Note the minus. This is somewhat counterintuitive, but agrees with the convention used by the aster function.)

Calls to reaster.formula return a list also containing:

call

the matched call.

formula

the formulas supplied.

NA Values

It was almost always wrong for aster model data to have NA values. Although theoretically possible for the R formula mini-language to do the right thing for an aster model with NA values in the data, usually it does some wrong thing. Thus, since version 0.8-20, this function and the aster function give errors when used with data having NA values. Users must remove all NA values (or replace them with what they should be, perhaps zero values) “by hand”.

Warning about Negative Binomial

The negative binomial and truncated negative binomial are fundamentally incompatible with random effects. The reason is that the canonical parameter space for a one-parameter negative binomial or truncated negative binomial is the negative half line. Thus the conditional canonical parameter theta for such a node must be negative valued. The aster transform is so complicated that it is unclear what the corresponding constraint on the unconditional canonical parameter phi is, but there is a constraint: its parameter space is not the whole real line. A normal random effect, in contrast, does have support the whole real line. It wants to make parameters that are constrained to have any real number. The code only warns about this situation, because if the random effects do not influence any negative binomial or truncated negative binomial nodes of the graph, then there would be no problem.

Warning about Individual Random Effects

The Breslow-Clayton approximation assumes the complete data log likelihood is approximately quadratic considered as a function of random effects only. This will be the case by the law of large numbers if the number of individuals is much larger than the number of random effects. Thus Geyer, et al. (2013) warn against trying to put a random effect for each individual in the model. If you do that, the code will try to fit the model, but it will take forever and no theory says the results will make any sense.

References

Breslow, N. E., and Clayton, D. G. (1993). Approximate Inference in Generalized Linear Mixed Models. Journal of the American Statistical Association, 88, 9–25. doi: 10.1080/01621459.1993.10594284.

Geyer, C. J., Ridley, C. E., Latta, R. G., Etterson, J. R., and Shaw, R. G. (2012) Aster Models with Random Effects via Penalized Likelihood. Technical Report 692, School of Statistics, University of Minnesota. http://purl.umn.edu/135870.

Geyer, C. J., Ridley, C. E., Latta, R. G., Etterson, J. R., and Shaw, R. G. (2013) Local Adaptation and Genetic Effects on Fitness: Calculations for Exponential Family Models with Random Effects. Annals of Applied Statistics, 7, 1778–1795. doi: 10.1214/13-AOAS653.

Examples

library(aster)
data(radish)
pred <- c(0,1,2)
fam <- c(1,3,2)
rout <- reaster(resp ~ varb + fit : (Site * Region),
    list(block = ~ 0 + fit : Block, pop = ~ 0 + fit : Pop),
    pred, fam, varb, id, root, data = radish)
summary(rout)
summary(rout, stand = FALSE, random = TRUE)

[Package aster version 1.1-2 Index]