sbird/S-GenIC

amplitude not actually drawn from a Rayleigh distribution

BenWibking opened this issue · 3 comments

I have been confused for quite some time why Volcker's IC code in any version I have seen does not actually draw the amplitude of the modes from a Rayleigh distribution (or else draw the real and imaginary parts independently from Gaussian distributions).

Is there something I am missing here? I am curious why there is this 'RayleighScatter' flag in this version of the code. Why would I not want a true Gaussian field?

if(RayleighScatter) p_of_k *= -log(ampl);

This code would be very useful to use instead of Roman Scoccimorro's F77 code for 2LPT, except for this issue.

I don't completely understand - this is a Rayleigh distribution, isn't it?
See:
http://en.wikipedia.org/wiki/Rayleigh_distribution#Generating_random_variates

ampl is drawn from a uniform distribution, and the actual modes are sqrt(p_of_k). This should be equivalent to drawing real and imaginary parts from Gaussians, shouldn't it?

The flag exists primarily for testing; it is useful to be able to check that the power spectrum of the initial conditions matches exactly the input power spectrum in the absence of scattering.

Ah, my mistake. I forgot about the square root. Then I think it should be the same, yes.

Thanks for correcting my confusion on this.


From: Simeon Bird notifications@github.com
Sent: Monday, December 01, 2014 3:17:22 PM
To: sbird/S-GenIC
Cc: Ben Wibking
Subject: Re: [S-GenIC] amplitude not actually drawn from a Rayleigh distribution (#1)

I don't completely understand - this is a Rayleigh distribution, isn't it?
See:
http://en.wikipedia.org/wiki/Rayleigh_distribution#Generating_random_variates

ampl is drawn from a uniform distribution, and the actual modes are sqrt(p_of_k). This should be equivalent to drawing real and imaginary parts from Gaussians, shouldn't it?

The flag exists primarily for testing; it is useful to be able to check that the power spectrum of the initial conditions matches exactly the input power spectrum in the absence of scattering.

Reply to this email directly or view it on GitHubhttps://github.com//issues/1#issuecomment-65136087.

Great, closing the issue then.