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

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

nheads <- 8 nflips <- 10 exp_results <- profile_exponential_decay_model(nheads, nflips) plot(x=exp_results$preflip_prob, y=exp_results$likelihood, type="l")
#> Error in xy.coords(x, y, xlabel, ylabel, log): 'x' and 'y' lengths differ
best_param <- exp_results$halflife[which.max(exp_results$likelihood, na.rm=TRUE)]
#> Error in which.max(exp_results$likelihood, na.rm = TRUE): unused argument (na.rm = TRUE)
print(best_param)
#> Error in print(best_param): object 'best_param' not found