0
$\begingroup$

I have this exponential function, where j is unknown. How can I plot the variance function for $k= 0.1, \; 1, \;10$

$$f_{j,k}(y)=\frac{\sqrt{j}}{\sqrt{2 \pi}}e^{\sqrt{jk}}y^{-\frac{1}{2}} \text{exp}\left( -\frac{1}{2} (j y + \frac{k}{y}) \right) \quad \quad y>0$$

$\endgroup$
  • $\begingroup$ Please at least write your function in Mathematica syntax. And if possible, tell us what have you tried. $\endgroup$ – Dr. belisarius Nov 29 '13 at 20:11
4
$\begingroup$

Assuming that given function is a PDF of a distribution:

f[y_, j_, k_] := Sqrt[j]/Sqrt[2 Pi] Exp[Sqrt[j k]]/Sqrt[y] Exp[-(1/2) (j y + k/y)];

You can create an object that will represent your distribution:

distr = ProbabilityDistribution[{"PDF", f[y, j, k]}, {y, 0, Infinity}, 
                                               Assumptions -> (j > 0 && k > 0)];

And now you can calculate anything you want:

Variance[distr]
(*(2 + Sqrt[j k])/j^2*)
Mean[distr]
(*Mean[distr]*)
CentralMoment[distr, 3]
(*(8 + 3 Sqrt[j k])/j^3*)
| improve this answer | |
$\endgroup$
  • $\begingroup$ Great! But how will you plot the variance function from here?? $\endgroup$ – Jens Jensen Nov 30 '13 at 8:19
  • $\begingroup$ Sorry, I don't know what is "variance function". If you tell me I will try to help. $\endgroup$ – Kamov Sergey Nov 30 '13 at 8:29
  • $\begingroup$ The Variance[distr] is the variance function. However, I found out how to do it. Very simple of course. Thank you for the help. Problem solved. $\endgroup$ – Jens Jensen Nov 30 '13 at 8:45
  • $\begingroup$ @Karnov Sergey I have some few close related questions related to this topic. Can we start a chat, or email conversation? This was very helpful for me. $\endgroup$ – Jens Jensen Nov 30 '13 at 8:51
  • $\begingroup$ @JensJensen I think if you have another question you better post it here. Another users probably will find it useful. $\endgroup$ – Kamov Sergey Nov 30 '13 at 9:43

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.