Geometric distribution is to model the random trial number X until a first success, in Bernoulli trial experiments, with constant success rate p. The probability of x can be calculated as
Geometric distribution is a special case of Negative Binomial distribution, which models the X trial is the n success trial.
R programming language provides function dgeom() for geometric probability computation. Next example shows the geometric probabilities for different number of X between 1 and 8 until a success trial in Bernoulli experiments, with success rate p = 0.15 for a single trial.
# create a vector for X series values
xtrial <- seq(1, 8, by = 1)
# Using dgeom() function to calculate probabilities for each value of Xtrial
#probability of x trials until getting a success
probtrial <- dgeom(xtrial, prob = 0.15)
probtrial
#output
[1] 0.12750000 0.10837500 0.09211875 0.07830094 0.06655580 0.05657243
[7] 0.04808656 0.04087358
# Plot probabilities
plot(probtrial)
Click here to download Python Course Source Files !
For online Python training registration, click here ! Pandas provides flexible ways of generating data…
For online Python training registration, click here ! Data frame is the tabular data object…
Click her for course registration ! When a data frame in Python is created via…
We provide affordable online training course(via ZOOM meeting) for Python and R programming at fundamental…