Learn R Programming

marp (version 0.1.0)

gamma_logl: 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)

Value

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

Arguments

param

parameters of Gamma model

x

input data for Gamma model

Examples

Run this code
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")

Run the code above in your browser using DataLab