mle_poisson: mle_poisson

Description Usage Arguments Value Examples

View source: R/mle_poisson.R

Description

mle_poisson

Usage

1

Arguments

df

data.frame object, containing at least column named 'x' containing non-negative integer values.

Value

MLE of Poisson distribution parameter L, assuming df$x ~ poisson(L).

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
# Generate example data:
set.seed(31)
L = 5

# Number of experiments, i.e. rows in df:
numexps = 10

# Filling df with pseudo data; note the requisite column 'x':
df = data.frame('x' = rpois(numexps, L))

# Generating maximum likelihood estimate (MLE) solution for L:
L_fit = mle_poisson(df = df)

# Compare fitted values to known values:
cbind(L, L_fit)

alexandercoulter/DHBayes documentation built on Dec. 19, 2021, 12:29 a.m.