# How would I fit a distribution to this image noise?

I have collected some noise data from a dimly lit CMOS image sensor. The distribution of pixel values is tallied below:- I'd like to be able to simulate this sensor noise. How would I fit a statistical distribution to this bell curvish graph? And which distribution? Bear in mind that the distribution is discrete. From the raw samples, I get mean = 18 and standard deviation = 7 (both approximations).

• You can always find a distribution that fits. But you'd risk overfitting. You'd typically start with things like "I assume this is normal" or "$\chi^2$ with $M$ degrees of freedom, $M$ small. – Marcus Müller Aug 5 '18 at 0:57
• In physics, normal is often a very reasonable assumption. In your case, I'd presume you'd see a normal distribution (representing your noise) added to another distribution (representing your signal) – Marcus Müller Aug 5 '18 at 0:59
• @MarcusMüller But normal distributions are continuous, whilst pixel values are discrete integers. That's my problem. – Paul Uszak Aug 5 '18 at 1:13
• So? I see how these kind of values are different, but you can simply quantize a continuous distribution or consider a discrete distribution a slightly deformed continuous one. – Marcus Müller Aug 5 '18 at 1:16
• Define a sampled normal distribution function as discrete normal. Done. – Marcus Müller Aug 5 '18 at 1:46

Since you say your distribution is discrete, if your samples are independent, you could try a multinomial distribution as a model https://en.m.wikipedia.org/wiki/Multinomial_distribution

You can use either maximum likelihood or a Bayesian estimator.

You could also take the mean and standard deviation and use a Gaussian model with rounding. A goodness of fit test

https://en.m.wikipedia.org/wiki/Goodness_of_fit

would tell you how good the model is.

If your samples are independent noise generation is straightforward . A Bayesian model is different because you use another (prior) noise generator as an input to the fixed parameter noise generator.

If your samples are correlated you can use a Gibbs sampler.

You should perform an independence test on your data, of which a Google search will provide a number of candidates

You also might consider boot-strapping

https://en.wikipedia.org/wiki/Bootstrapping_(statistics)

It is also very likely that a physics based noise model exists for your device.