Learn R Programming

likelihoodExplore (version 0.1.0)

likgeom: Geometric Log Likelihood Function

Description

The log likelihood of a geometric density with data, x, prob parameter.

Usage

likgeom(x, prob, log = TRUE)

Arguments

x

vector of quantiles representing the number of failures in a sequence of Bernoulli trials before success occurs.

prob

probability of success in each trial. 0 < prob <= 1.

log

logical; if TRUE, probabilities p are given as log(p).

Value

A numeric scalar for the log likelihood of the geometric density given the data where prob can be held constant or if vector were given vector will be returned.

Details

The log likelihood is the log of a function of parameters given the data.

Examples

Run this code
# NOT RUN {
likgeom(x = rgeom(n = 2, prob = .4),
        prob = .4)
# }

Run the code above in your browser using DataLab