- #1
Pyroadept
- 89
- 0
Homework Statement
The logistic random variable X has CDF:
F(X) = exp(a + bx)/(a + exp(a + bx)), b>0
(i) Obtain a formula for random values of X in terms of R ~ U(0,1)
(ii) Using the cdf, suppose that a certain application requires you to generate 'the middle one of three' i.i.d. logistic - generate two such values.
Use the following sequence of random numbers. If you run out, start again from the beginning:
0.9892, 0.2842, 0.9349, 0.9029, 0.3494, 0.9891, 0.6072, 0.4893
Homework Equations
The Attempt at a Solution
Hi everyone,
Here's my solution so far:
--
(i)
Solve for X using R = F(X)
Multiplying across and factorising, we get:
exp(a+bx).(1 - R) = R
Now taking natural logs and regarranging, we get:
X = (1/b).[ln(R/(1-R)) - a]
... an equation for X in terms of R, so could call it X(R)
(ii)
I will generate random values of X using the following method:
Let random value of X = X(R_i),
where R_i is the ith random number given in the sequence above.
My question is - what do they mean by 'middle one of three'? Do I generate three random numbers and then pick the middle-valued one? It seems a bit straightforward, but I can't see what else it could be.
If that is the case, I get:
X_1 = (4.517-a)/b
X_2 = (-0.9237-a)/b
X_3 = (2.6645-a)/b
And, as b>0, the middle one is then X_2.
Is this correct?
Thanks for any help!