bernoulli.trial()
Scientific results for this function.
Exact and upper-tail probabilities agreed with independent binomial calculations for the tested counts up to 1,000, including zero hits. S03 results.
Define a hit and the per-structure chance of a hit before counting the orientations. A single-count probability answers how often exactly that count arises; the upper tail answers how often a count at least that large arises.
The binomial model assumes independent structures with the same
target probability p. The upper-tail probability is a one-sided
p-value under this model. Calculations use stats::dbinom and
stats::pbinom, avoiding factorial overflow and subtraction from 1.
At least zero hits has probability 1. With zero structures, zero hits has
probability 1 for either type. Inputs are scalar; invalid inputs error.
Method references
Ruggles, C (1999) Astronomy in Prehistoric Britain and Ireland. Yale University Press.
Interpretation and limits. The binomial formulation requires a defensible success probability and trial structure. Repeated structures at the same location may not act as independent trials. Delimit the target window before counting successes.
Implementation arguments, return value and documented modes
| Argument | Formal default | Behaviour in this interface |
|---|---|---|
n |
— | Total number of structures: a single finite nonnegative integer. |
p |
— | Target probability: a single finite number between 0 and 1. |
r |
— | Number of hits: a single finite integer between 0 and n. |
type |
"tail" |
Either |
Return value
A numeric probability between 0 and 1.
Implementation. R/statistics.R. Full function help · Null models and significance outline