bernoulli.trial {skyscapeR} | R Documentation |
Execute a (series of) Bernoulli trial(s)
Description
This function allows one to calculate the probability of having r structures out of n, orientated towards a target with probability p.
Usage
bernoulli.trial(n, p, r, type = "tail")
Arguments
n |
Total number of structures |
p |
Probability of target (e.g. ratio of azimuths) |
r |
Number of structures orientated towards target (hits) |
type |
(Optional) Type of probability to output. Possibilities are: (a) single in which case the result of a single Bernoulli trial is reported; or (b) tail in which case it calculates Bernoulli trials for all hit values between 1 and (r-1) and then outputs 1 minus the calculated probability. The latter is effectively a p-value. Default is tail |
References
Ruggles, C (1999) Astronomy in Prehistoric Britain and Ireland. Yale University Press.
Examples
# probability of having at least 10 out of 30 structures
# aligned to targets covering 20% of the horizon
bernoulli.trial(30, 0.2, 10)
[Package skyscapeR version 1.0.0 Index]