dcoin_from_probability: Compute probability of observations given a vector of...

Description Usage Arguments Value

View source: R/flipped.R

Description

Compute probability of observations given a vector of probability of heads

Usage

1
2
3
4
5
6
7
8
dcoin_from_probability(
  pheads,
  nheads,
  nflips,
  log = FALSE,
  possibilities = get_possibilities(nheads, nflips),
  diff_value = NULL
)

Arguments

pheads

Vector with the probability of a heads on flip 1, 2, etc.

nheads

Number of heads

nflips

Total number of flips (heads and tails)

log

If TRUE return log transformed probabilities.

possibilities

All possible sequences of flips that lead to the observed number of heads

diff_value

If not NULL, the final likelihood will be abs(likelihood - diff_value) for minimizing a function

Value

The likelihood of the data (or log likelihood if log=TRUE)


bomeara/flipped documentation built on Dec. 19, 2021, 10:47 a.m.