Let $x$ have an exponential density $p(x|\theta) = \theta e^{-\theta x} \text{ if }x \ge 0;\quad 0 \text{ otherwise.}$

a) Plot $p(x|\theta)$ versus $x$ for $\theta = 1$. Plot $p(x|\theta)$ versus $\theta$, $(0\le \theta \le 5)$ for $x = 2.$

How would I do this?

  • 1
    $\begingroup$ What plotting techniques do you know? Let's be specific: part (a) asks you to graph the function $1 e^{-1 x} = e^{-x}$ for $x \ge 0$. Where exactly are you having trouble doing that? $\endgroup$ – whuber Mar 24 '13 at 21:44

The first part is simple: substitute $1$ for $\theta$ in the density equation, giving you $p(x|\theta=1)=\exp(- x)$. In this case, $x$ varies and $\theta$ remains fixed.

The second part treats $x$ as fixed and instead varies $\theta$. This can be done by generating a vector of, say, 1000 $\theta$ values between 0 and 5, and computing the density for $x=2$ at each value of $\theta$ in the vector. Plot the results.

  • $\begingroup$ If we have a program capable of sketching curves such as $\exp(-x)$ (program picks where to evaluate the function, draws the axes, plots the curve, etc.), why can't we use the same program to sketch $\theta\exp(-2\theta)$? That is, why is it necessary to suggest taking 1000 values of $\theta$ between $0$ and $5$, calculate $\theta\exp(-2\theta)$ for each value, and then plot the results, but it is not necessary to make similar suggestions for plotting $\exp(-x)$? $\endgroup$ – Dilip Sarwate Mar 24 '13 at 22:19
  • $\begingroup$ Yep. Those aren't different. $\endgroup$ – Reinstate Monica Mar 24 '13 at 22:23
  • $\begingroup$ so it is necessary to take multiple values for both the first and the 2nd one? $\endgroup$ – Jonas Mar 24 '13 at 23:23
  • $\begingroup$ As Dilip points out, how you generate the plots is dependent on the kind of plotting software you're using. $\endgroup$ – Reinstate Monica Mar 24 '13 at 23:49
  • $\begingroup$ Ok thank you I think i got that I do have a second question that is associated with this problem that I need clarification on would it be appropriate to post it here in the comments or should I edit the original question $\endgroup$ – Jonas Mar 25 '13 at 0:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.