negLL_Weibull_counts_matrix: likelihood.R - functions for likelihood calculations...

Description Usage Arguments Value Author(s)

View source: R/likelihood.R

Description

Calculate the negative log-likelihood of the parameters k and lambda given count data. Returns the negative log-likelihood. The data are in the form of a square matrix of dimension (N+1)x(N+1). Will be called by nlm() or similar. This is more for explanation purposes – use negLL_Weibull_counts_df() for real data since it should be faster and is set up to do confidence intervals.

Usage

1

Arguments

p

vector of parameter values c(k, lambda), where k is the shape parameter and lambda is the scale parameter, for which to calculate the negative log-likelihood

h_nr

square matrix of counts of numbers of individuals whose case was reported on day r and who first reported symptoms on day n. r and n start from 0 so h_nr[1, 1] is $h_0, 0$ etc., i.e. h_nr[n+1, r+1] is $h_nr$ in the mathematical derivations. dim(h_nr) is (N+1)x(N+1)

Value

negative log-likelihood of the parameters given the data

Author(s)

Andrew Edwards


andrew-edwards/rightTruncation documentation built on Jan. 18, 2021, 7:43 p.m.