bernoulli.trial: Execute a (series of) Bernoulli trial(s)

Description Usage Arguments References Examples

View source: R/statistics.R

Description

This function allows one to calculate the probability of having r structures out of n, orientated towards a target with probability p.

Usage

1
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

1
2
3
# probability of having at least 10 out of 30 structures
# aligned to targets covering 20% of the horizon
bernoulli.trial(30, 0.2, 10)

skyscapeR documentation built on Oct. 30, 2021, 1:06 a.m.