gamma_logl: A function to calculate the log-likelihood of Gamma model

View source: R/gamma_logl.R

gamma_loglR Documentation

A function to calculate the log-likelihood of Gamma model

Description

A function to calculate the log-likelihood of Gamma model

Usage

gamma_logl(param, x)

Arguments

param

parameters of Gamma model

x

input data for Gamma model

Value

returns the value of negative log-likelihood of the Gamma model

Examples

set.seed(42)
data <-  rgamma(30,3,0.01)

# set some parameters
par_hat <- c(2.7626793657057762, 0.0094307059277139432) # estimated parameters
param <- log(par_hat) # input parameters for logl function

# calculate log-likelihood
result <- marp::gamma_logl(param, data)

# print result
cat("-logl = ", result, "\n")


marp documentation built on Aug. 11, 2022, 5:10 p.m.