In: Statistics and Probability
How to do the following in R:
Write a function that will generate and return a random sample
of size n from the twoparameter exponential distribution Exp(λ,ν)
for arbitrary n, λ, and ν. Note that the pdf of X ∼ Exp(λ,ν) is
f(x) = λe−λ(x−ν),x ≥ ν and λ > 0,ν > 0. Generate a random
sample of size 1000 from the Exp(2,1) distribution.
answer
## In R we need to install package tolerance then it easy to
generate random sample
assume here set. seed is equal to 1000