Learn R Programming

gRc (version 0.5.1)

fit-main: Fit rcox model

Description

This is a general function for fitting RCOX models (i.e.\ RCON and RCOR models) using different estimation algorithms.

Usage

# S3 method for rcox
fit(
  object,
  Kstart = object$Kstart,
  method = object$method,
  control = object$control,
  details = object$details,
  trace = object$trace,
  returnModel = TRUE,
  ...
)

matching(object, control = object$control, trace = object$trace)

ipm(object, K0, control = object$control, trace = object$trace)

scoring( object, K0, control = object$control, maxit = control$maxouter, trace = object$trace )

Value

An RCOX model object.

Arguments

object

An RCOX model object (an object of class 'rcox')

Kstart

An initial value for the concentration matrix.

method

The specific estimation method. Can be either "scoring", (a modified Fisher scoring algorithm), "ipm" (iterative partial maximization), "matching" (score matching) or "user" (currently not used).

control

A list controlling the fitting algorithms. See the 'details' section.

details

The amount of details printed on the screen. 0 means no details at all.

trace

Controls various diagnostics print outs. A debugging feature not intended for the user.

returnModel

If TRUE the model object m is returned with fitting info added to it. If FALSE only the fitting info is returned.

...

Additional arguments; currently not used.

K0

Initial value for concentration matrix.

maxit

Maximum number of iterations.

Author

Søren Højsgaard, sorenh@math.aau.dk

Details

The fitted parameters etc. can be extracted using 'fitInfo(m)'. The control argument is a list with named entries. Most important are the entries 'maxouter' and 'maxinner' (which both defaults to 25) for controlling the estimation algorithms. For other components please refer to the code.

See Also

rcox, update.rcox

Examples

Run this code

data(math)
gm  = ~al:an:st
vcc = list(~me + st, ~ve + an, ~al)
ecc = list(~me:ve + me:al, ~ve:al + al:st)

m1 <- rcox(gm=gm, vcc=vcc, ecc=ecc, data=math, fit=FALSE)

fit(m1, method="matching")
fit(m1, method="scoring")
fit(m1, method="ipm")

Run the code above in your browser using DataLab