How to generate samples from a modified exponential density?
显示 更早的评论
Hi everyone, The standard form of an exponential density is f(x|lambda)= lambda*exp(-x/lambda) if x>=0 and f(x|lambda)=0 if x<0.
I want to generate samples from the following density f(x|lambda, b)= lambda*exp(-(x-b)/lambda) if x>b and f(x|lambda,b)=0 if x<=b. Where b is a user-specified parameter.
Can anyone here suggest me how to do this ?
Best regards,
采纳的回答
更多回答(1 个)
Shashank Prasanna
2014-6-9
编辑:Shashank Prasanna
2014-6-9
0 个投票
You can generate uniform random numbers using the rand function and apply it to your modified density function.
类别
在 帮助中心 和 File Exchange 中查找有关 Random Number Generation 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!