7

Given a Gaussian function of the form $$g(x) = ae^{-(x-b)^2/(2c^2)}$$

I am interested in a discrete analogue to this, which deals with the case where $x$ is discrete. As I understand there are two ways of doing this, namely, the Sampled Gaussian kernel and the Discrete Gaussian kernel. Does anyone know how to explain the implementation of these in a simple way or has a good reference for a text or set of notes? I don't have a very strong background in statistics hence I am having difficulty understanding the protocol involved in these two methods.

To give some context: Consider an operator which takes the constants $a,b,c$ to a Gaussian function $$\{a,b,c\} \mapsto ae^{\frac{(x-b)^2}{2c^2}}~~~~~~~(1)$$

Given that $x'$ is discrete and possibly bounded $-N \leq x' \leq N$, is there a discrete case analogue to the operator (1) which gives some Gaussian type distribution given some parameters $a,b,c...$ which include the mean and the variance?

John Jack
  • 179
  • 1
  • 4
  • Does the distribution in question range from negative infinity to positive infinity, or is it bounded somehow? What would the bounds be? – gung - Reinstate Monica Jul 21 '17 at 13:02
  • @gung Thanks for your respone. I would like to consider a case where integer $x$ runs from $-N$ to $N$. – John Jack Jul 21 '17 at 13:09
  • 1
    Since there are many possible (but distinctly different) solutions, we need more information. Could you explain what this discrete function would be used for or how you would interpret it? – whuber Jul 21 '17 at 14:28
  • 2
    Thank you for trying, but you still haven't described a statistical problem, thereby leaving us without any clues to recommend one solution over another. Your description is abstractly mathematical, apparently devoid of any purpose. *Why* do you want to define a discrete analog of this operator (a convolution, apparently)? What will you do with it? How will you interpret it? How would it be applied? – whuber Jul 21 '17 at 15:42
  • 2
    @JohnJack - what is the "business case" for this? What are you going to do with it when you are done? How are you going to measure the success or failure of that thing? – EngrStudent Jul 21 '17 at 15:43
  • 1
    @wubher The actual application is going to take too long to explain. I just want the question interpreted purely as a statistics query, someone just wondering about the possibilities of defining the mentioned operator. I revised the question to be less muddled. – John Jack Jul 21 '17 at 16:12
  • 1
    @whuber, I find that I am further & further from any idea of what is going on here. Do you have any insights? Do you think I should just delete my answer? – gung - Reinstate Monica Jul 21 '17 at 16:15
  • 3
    @gung A well-posed question still hasn't appeared and I haven't a clue concerning the statistical setting or proposed application. The references to "include the mean and variance" are obscure, because as far as I can see we aren't even (yet) discussing an actual distribution, but only a Gaussian function. Even if $a$ is chosen to make it one, $c^2$ would not exactly be its variance. As far as I can tell, the latest incarnation of this question asks responders to propose a two- or three-parameter family of "discrete Gaussians," but it provides no further information to guide one to a solution. – whuber Jul 21 '17 at 16:49

3 Answers3

6

The most basic way to discretize the continuous probability distribution is to assumed its "rounded" form, i.e. if $X \sim \mathcal{N}(\mu, \sigma)$, then $\lfloor X \rfloor$ follows the discrete analogue. For discrete normal distribution, the probability mass function following from such procedure is

$$ f(x) = \Phi\left(\frac{x-\mu+1}{\sigma}\right) - \Phi\left(\frac{x-\mu}{\sigma}\right) $$

where $\Phi$ is standard normal cumulative distribution function, as described in

Roy, D. (2003). The discrete normal distribution. Communications in Statistics-Theory and Methods, 32, 1871-1883.

Alternatively, you may consider rounding within the $\pm0.5$ interval (i.e. distribution of $\lfloor X +0.5\rfloor$).

Tim
  • 108,699
  • 20
  • 212
  • 390
  • Thanks for your answer. Please see my updated question with some context. Would your suggestion be appropriate for this type of application? – John Jack Jul 21 '17 at 15:32
4

Luc Devroye defines a discrete normal in his book (Non-Uniform Random Variate Generation) (pg 117). Here is a link to chapter 3: http://www.nrbook.com/devroye/Devroye_files/chapter_three.pdf last page of chapter 3 is page 117.

$$\Pr(X=i)= c\exp\left[\frac{(|x| +0.5)^2}{2\sigma^2}\right],$$

where $i$ is an integer. The book also gives an algorithm for generating a random variable from this distribution. This would apply for your question if $N\to\infty$.

Frederik
  • 33
  • 8
Lucas Roberts
  • 3,819
  • 16
  • 45
3

I don't know of any such distribution. The normal distribution runs from negative infinity to positive infinity, so bounds (i.e., $-N$ to $N$) will weaken the analogy to the normal. That said, if I wanted a distribution that seemed this way, for a simulation say, I would sample from a Binomial distribution with $n = 2N$ and $\pi=.5$. Then I would subtract $N$ from all realized values. If you wanted the mean to be anything else, you could use a different value of $\pi$, but you need to recognize that that would weaken the analogy to the normal even further. The population SD of the generated distribution would necessarily be $.5\sqrt{2N}$. You could make that wider if you wanted by sampling the $\pi$ parameter from a narrow, symmetrical distribution around .5, with the wider that distribution of $\pi$s, the higher the resulting SD could be. The distribution then might be a beta binomial.

gung - Reinstate Monica
  • 132,789
  • 81
  • 357
  • 650
  • I'd love to see an example done. – EngrStudent Jul 21 '17 at 14:30
  • @EngrStudent, an example of what, exactly? – gung - Reinstate Monica Jul 21 '17 at 14:52
  • I like your answer. I think you are correct. I know its my own crazy, but my best rated answers go end-to-end with a worked example. I think a simple example case, some very simple R-code, and a plot showing the original and the approximation would be useful to folks for a long time. There are a number of times where I search on google, and it takes me to SE and there is a 100+ vote answer from 2013 that does the job. I think those kinds of answers are what make SE great, and are a good professional legacy. – EngrStudent Jul 21 '17 at 14:55
  • @EngrStudent, thanks. Can you give me some candidate parameters you have in mind? Are you referring to the beta-binomial version or the standard version? Etc. – gung - Reinstate Monica Jul 21 '17 at 15:01
  • @gung Thanks for your answer. Please see my updated question with some context. Would your suggestion be appropriate for this type of application? – John Jack Jul 21 '17 at 15:32
  • @JohnJack, I don't understand the situation you describe. – gung - Reinstate Monica Jul 21 '17 at 15:35
  • @gung Okay which part? I basically define an operator (1) which for any given number $m$ it defined a Gaussian distribution centered at $m$. This was done for $x' \in [-\infty, \infty]$. I want to do something similar for $-N \leq x' \leq N $. – John Jack Jul 21 '17 at 15:38
  • @JohnJack, the whole thing is perplexing to me. Are you trying to generate $x$s, or $m$s, or PDFs, or something else? Where do the $m$s come from? What are you going to do w/ the results? – gung - Reinstate Monica Jul 21 '17 at 15:43
  • @gung I have $x's$ and $ms$ I want the function which gives a Gaussian type function. A suggestion of a suitable way how this could be accomplished. – John Jack Jul 21 '17 at 15:51
  • @JohnJack, now I'm further from understanding your situation. Do you want something like the probability density of $x'$ given $m$ & whatever distribution? Do you want $Pr(X'\le x' | m, {\rm distribution})$? Something else? (I'm wondering if it may be better for me to walk away here & let someone else answer this.) – gung - Reinstate Monica Jul 21 '17 at 15:56
  • @gung Okay I probably didn't state it clearly. I will update it now. Consider the [Gaussian function](https://en.wikipedia.org/wiki/Gaussian_function) for continuous variable $x$. What do you need to define it, constants $a$, $b$ and $c$. Hence you have a mapping $\{a,b,c\}$ $\mapsto$ Gaussian function. Now consider discrete $x'$, is there an equivalent mapping is my question? – John Jack Jul 21 '17 at 16:03