Python Numpy Poisson Distribution
<p>I am generating a Gaussian, for the sake of completeness, that's my implementation:</p>

<pre><code>from numpy import *
x=linspace(0,1,1000)
y=exp(-(x-0.5)**2/(2.0*(0.1/(2*sqrt(2*log(2))))**2))
</code></pre>

<p>with peak at <code>0.5</code> and <code>fwhm=0.1</code>. So far so not interesting. In the next step I calculate the poisson distribution of my set of data using <code>numpys</code> <a href="https://docs.scipy.org/doc/numpy-1.13.0/reference/generated/numpy.random.poisson.html" rel="noreferrer">random.poisson</a> implementation.</p>

<pre><code>poi = random.poisson(lam=y)
</code></pre>

<p>I'm having two major problems.</p>

<ol>
<li>A specialty of poisson is that the variance equals the exp. value,
comparing the output of mean() and var() does confuse me as the
outputs are not equal.</li>
<li>When plotting this, the poisson dist. takes up integer values <em>only</em>
and the max. value is around 7, sometimes 6, whilst my old function
y has its max. at 1. Afai understand, the poisson-function should
give me sort of a 'fit' of my actual function y. How come the max.
values are not equal? Sorry for my mathematical incorrectness,
actually I'm doing this to emulate poisson-distributed noise but I
guess you understand 'fit' in this context.</li>
</ol>

<hr>

<p>EDIT: 3. question: What's the 'size' variable used for in this context? I've seen different types of usage but in the end they did not give me different results but failing when choosing it wrong...</p>

<p>EDIT2: OK, from the answer I got I think that I was not clear enough (although it already helped me correct some other stupid errors I did, thanks for that!). What I want to do is apply poisson (white) noise to the function y. As described by MSeifert in the post below, I now use the expectation value as lam. But this only gives me the noise. I guess I have some understanding problems on the level of how th{is,e} noise is applied (and maybe it's more physics related?!).</p>