Question

Determine a method to generate random observations for the Laplace pdf. If access is available, write an R function which returns a random sample of observation from a Laplace distribution.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

> ## install "rmutil" R package
>
> library(rmutil)
>
> data=rlaplace(n=50, m=0, s=1)
> data
[1] -1.30236491 1.44954964 0.14647383 -0.19840311 -1.58270860 3.01498590
[7] -0.03368618 -0.01649112 1.63712209 1.87807825 -0.19292235 -1.25757044
[13] 1.65227739 1.63162978 -0.20379632 -1.36775629 1.97616613 0.54970665
[19] -1.99288684 0.88957333 0.37725789 -0.42262610 -1.95727814 0.98419761
[25] 3.13923809 1.83653814 -0.20401601 -0.13804444 -1.69516214 0.09733094
[31] -2.30680813 0.19693882 -1.13176007 0.49130645 -0.11651602 -1.49790769
[37] -0.50380373 0.57563257 0.29256264 -0.85044427 -0.27626054 2.14790177
[43] 0.20260942 -0.06807347 0.59691364 -2.03365779 -0.53093729 0.36291089
[49] -0.35579759 -0.87894641
>
> # Arguments
>
> # n number of values to generate
> # m vector of location parameters.
> # s   vector of dispersion parameters.

Add a comment
Know the answer?
Add Answer to:
Determine a method to generate random observations for the Laplace pdf. If access is available, write...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT