profile_exponential_decay_model: Computes the likelihood for a range of values using an...

Description Usage Arguments Value Examples

View source: R/flipped.R

Description

Computes the likelihood for a range of values using an exponential coin model

Usage

1
2
3
4
5
6
7
profile_exponential_decay_model(
  nheads,
  nflips,
  param_range = c(0, nflips * 10),
  number_of_steps = 1000,
  log = FALSE
)

Arguments

nflips

Total number of flips (heads and tails)

param_range

Range of parameters to try

number_of_steps

How many values of the parameter to try

Value

vector of likelihoods

Examples

1
2
3
4
5
6
nheads <- 8
nflips <- 10
exp_results <- profile_exponential_decay_model(nheads, nflips)
plot(x=exp_results$preflip_prob, y=exp_results$likelihood, type="l")
best_param <- exp_results$halflife[which.max(exp_results$likelihood, na.rm=TRUE)]
print(best_param)

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