Simulating a continous distribution

  • Thread starter MechatronO
  • Start date
  • #1
30
1

Main Question or Discussion Point

Say we want a set of random values that are distributed according to some distribution function f(x).

A common way to accomplish that is to find the cumulative distribution function F(x) for the distribution and then solve for x according to

F(x) = Y

x = F'(Y)

Then x will be distributed with the original distribution function, if F'(Y) is fed with random values Y ranging from 0-1.

I'm currently trying to do that with a weibull distribution

f(x) = a*b*xb-1*e-a*b*x^b

where F(x) should be

F(x) = e-a - e-a*x^b

when solving for x in F(x) I however get

x = ( - ln(e-a - Y)/a)1/b

When Y> e-a there are no real solutions. Is there a way to get around this? Have I done something wrong?
 

Answers and Replies

  • #2
mathman
Science Advisor
7,798
430
Your F(x) can't be right. F(∞) should be 1.
 

Related Threads on Simulating a continous distribution

  • Last Post
Replies
7
Views
1K
  • Last Post
Replies
8
Views
3K
  • Last Post
Replies
2
Views
2K
  • Last Post
Replies
2
Views
3K
Replies
6
Views
980
Replies
4
Views
3K
Replies
3
Views
11K
Replies
1
Views
1K
Replies
2
Views
6K
Replies
1
Views
3K
Top