gammafit: Estimation of parameters of the Gamma distribution

Description Usage Arguments Value Author(s) Examples

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)

Example output

Loading required package: dfoptim
Loading required package: survival
Loading required package: copula
$par
[1]  2.955982 80.985866

$value
[1] 121.8305

$feval
[1] 68

$restarts
[1] 0

$convergence
[1] 0

$message
[1] "Successful convergence"

BivarP documentation built on May 2, 2019, 6:08 a.m.