1

I have the density function $$f(x)= \frac {e^x}{(e^x+1)^2}.$$ The integral from $-\infty$ to $\infty$ is $1$ so it is indeed a density function. The expected value of the function is $0$ and the variance is $\pi^2/3$.

My goal is to set the variance to $1$ but leaving the expected value at $0$ and of course the Integral of $f(x)$ from $-\infty$ to $\infty$ should stay at $1$ in order to have a density. But I am clueless of how to do it. Also is there a general way to perform this kind of task for any given density function?

1 Answers1

4

Hint: If $g(x)$ is a density function, then so is $$ a\cdot g(ax) $$ for any $a\in (0, \infty)$.

Arthur
  • 199,419
  • So what you are saying is, that I should add an constant a to the density and I assume a is the inverse of the variance ($a=\frac{3}{pi^2}$) – user2968163 Apr 23 '18 at 11:48
  • @user2968163 I think you should let $a$ be the inverse of the standard deviation, not the variance, but I can never keep those straight in my head. You will have to check. – Arthur Apr 23 '18 at 12:48
  • It's strange but neither is working. I also chose other densities and also neither the inverse of the variance nor the standard deviation is working – user2968163 Apr 23 '18 at 14:12
  • I think I got it now. The term a must be just the standard deviation (not the inverse) which seems kind of odd to me. But at least in my calculations in R it gives me the right results – user2968163 Apr 23 '18 at 15:42
  • Well, that makes sense, the moment I actually stop to think about it. The graph of $g(2x)$ is narrower than the graph of $g(x)$, after all. So if the variance (and standard deviation) is too large, then the graph is too wide, so you want $a$ to be larger than $1$ in order to make it narrower. – Arthur Apr 23 '18 at 15:46