# plot an exponential statistical function

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$$

• Please at least write your function in Mathematica syntax. And if possible, tell us what have you tried. Commented Nov 29, 2013 at 20:11

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*)

• Great! But how will you plot the variance function from here?? Commented Nov 30, 2013 at 8:19
• Sorry, I don't know what is "variance function". If you tell me I will try to help. Commented Nov 30, 2013 at 8:29
• 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. Commented Nov 30, 2013 at 8:45
• @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. Commented Nov 30, 2013 at 8:51
• @JensJensen I think if you have another question you better post it here. Another users probably will find it useful. Commented Nov 30, 2013 at 9:43