I need to generate a sample of mixed distribution where 2/3 of a sample is an exponential distribution with rate = 1 and 1/3 of a sample is a normal distribution with mean = 0 and sd = 1. I don't know how do I use dexp
and dnorm
functions at the same time.
Asked
Active
Viewed 27 times
0

Kristina
- 1
- 1
-
Have a look at https://stackoverflow.com/questions/23480529/r-function-to-generate-a-mixture-distribution – Otto Kässi Nov 04 '21 at 10:19
-
1Does this answer your question? [R : function to generate a mixture distribution](https://stackoverflow.com/questions/23480529/r-function-to-generate-a-mixture-distribution) – Otto Kässi Nov 04 '21 at 10:19
-
you could maybe also simply create each separately and combine them later? – Bloxx Nov 04 '21 at 10:27