dimanche 4 décembre 2016

How to transform linear cdf (uniform random) to square law

I want to model a collection of transmitters uniformly distributed around a receiver. I started with generating a uniform set of signal strengths from strongest to weakest but that matches a uniform linear distribution of transmitters.

I want to keep the signal strengths for ease of later calculations but I want to transform the sampling so that the weaker signals are more likely such that the cdf is a square law function (uniform area density).

I have read about using an inverse function derived from the integral of the cdf but would appreciate pointers to an existing r function or what my inverse needs to look like. Usual examples are for an exponential distribution.

Something like

signals <- runif(1000, 400, 1100)
#signal strengths tenths of dBm so make negative for stronger to weaker
signals <- -signals
transmissions <- sample (10, squarelawtransform(signals))

Want to know what should squarelawtransform look like?




Aucun commentaire:

Enregistrer un commentaire