gammafit: Estimation of parameters of the Gamma distribution

Description Usage Arguments Value Author(s) Examples

View source: R/gammafit.R

Description

Likelihood estimation of parameters of the Gamma distribution. Data can be right censored.

Usage

1
gammafit(time, event)

Arguments

time

numeric vector. For right censored data, this is the follow up time.

event

status indicator vector, 0=alive, 1=dead.

Value

A list with the following components:

par

best estimate of parameter vector c(shape, scale)

value

value of the likelihood at termination.

feval

number of times the likelihood was evaluated.

restarts

number of times the algorithm had to be restarted when it stagnated.

convergence

an integer code indicating type of convergence. 0 indicates successful convergence. Positive integer codes indicate failure to converge.

message

a text message indicating the type of convergence or failure.

Author(s)

Josef Brejcha

Examples

1
2
3
4
n <- 30
t <- rgamma(n, shape=2, scale=100)
ev <- round(runif(n), 0)
gammafit(t, ev)

BivarP documentation built on May 29, 2017, 7:13 p.m.