MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

### Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

New to MATLAB?

# Thread Subject: How to use a discrete normal distribution to represent a normal distribution

Subject: How to use a discrete normal distribution to represent a normal distribution

From: Nick Jia

### Nick Jia (view profile)

Date: 18 Oct, 2008 09:01:05

Message: 1 of 8

I hope I'm making my question clear as follows,

Give any continuous distribution, say, a normal distribution, I hope to use a vector a value, say (x_1, x_2, \cdots, x_n) and a vector of corresponding probablity value (p_1, p_2, \cdots, p_n) attached to those values,
such that these two vectors represent a discrete distrubiton which approximate the normal "well" in some sense, say, the first m moments of normal disbutions are all equal to those of discrete distrubiton, and that the L_2 distance between the two disbutions are small enought.
(Actually, any other creteria is fine, I'm just describing the one I come up with).

btw, in the above question, let's say only n (and possibly m) is free to choose.

Thanks for your help or thoughts, insights, and suggestions.

best,
Jia

Subject: How to use a discrete normal distribution to represent a normal distribution

From: Bruno Luong

### Bruno Luong (view profile)

Date: 18 Oct, 2008 09:34:02

Message: 2 of 8

"Nick Jia" <jiashadidai@gmail.com> wrote in message <gdc8kg\$o7i\$1@fred.mathworks.com>...
> the L_2 distance between the two disbutions are small enought.

Hummm, The L_2 norm is not even defined (infinity) for discrete ditributions (it's a sum of Dirac, which is not even integrable).

Bruno

Subject: How to use a discrete normal distribution to represent a normal distribution

From: Nick Jia

### Nick Jia (view profile)

Date: 19 Oct, 2008 02:58:01

Message: 3 of 8

"Bruno Luong" <b.luong@fogale.findmycountry> wrote in message <gdcaia\$aq4\$1@fred.mathworks.com>...
> "Nick Jia" <jiashadidai@gmail.com> wrote in message <gdc8kg\$o7i\$1@fred.mathworks.com>...
> > the L_2 distance between the two disbutions are small enought.
>
> Hummm, The L_2 norm is not even defined (infinity) for discrete ditributions (it's a sum of Dirac, which is not even integrable).
>
> Bruno

I'm not sure about this, how about L_2 norm on cdf, where discrete one is an increasing step function?

but as I said, I mean any cretia, I was just randomly propose one.

Subject: How to use a discrete normal distribution to represent a normal distribution

From: Bruno Luong

### Bruno Luong (view profile)

Date: 19 Oct, 2008 07:06:02

Message: 4 of 8

"Nick Jia" <jiashadidai@gmail.com> wrote in message <gde7np\$avl\$1@fred.mathworks.com>...
> "Bruno Luong" <b.luong@fogale.findmycountry> wrote in message <gdcaia\$aq4\$1@fred.mathworks.com>...
> > "Nick Jia" <jiashadidai@gmail.com> wrote in message <gdc8kg\$o7i\$1@fred.mathworks.com>...
> > > the L_2 distance between the two disbutions are small enought.
> >
> > Hummm, The L_2 norm is not even defined (infinity) for discrete ditributions (it's a sum of Dirac, which is not even integrable).
> >
> > Bruno
>
> I'm not sure about this, how about L_2 norm on cdf, where discrete one is an increasing step function?
>

This now is well defined, but much weaker criteria than working of some sort of difference measure between original pdf, as you wanted to do initially. I'm afraid the fit might output some oscillation of fitted pdf.

Not sure what is a good criteria.

Bruno

Subject: How to use a discrete normal distribution to represent a normal distribution

From: Johannes

### Johannes (view profile)

Date: 26 Dec, 2008 11:42:02

Message: 5 of 8

"Nick Jia" <jiashadidai@gmail.com> wrote in message <gdc8kg\$o7i\$1@fred.mathworks.com>...
> I hope I'm making my question clear as follows,
>
> Give any continuous distribution, say, a normal distribution, I hope to use a vector a value, say (x_1, x_2, \cdots, x_n) and a vector of corresponding probablity value (p_1, p_2, \cdots, p_n) attached to those values,
> such that these two vectors represent a discrete distrubiton which approximate the normal "well" in some sense, say, the first m moments of normal disbutions are all equal to those of discrete distrubiton, and that the L_2 distance between the two disbutions are small enought.
> (Actually, any other creteria is fine, I'm just describing the one I come up with).
>
> btw, in the above question, let's say only n (and possibly m) is free to choose.
>
> Thanks for your help or thoughts, insights, and suggestions.
>
> best,
> Jia

Have you found a solution to this problem? I would be interested too.

Subject: How to use a discrete normal distribution to represent a normal distribution

From: Johannes

### Johannes (view profile)

Date: 26 Dec, 2008 11:42:02

Message: 6 of 8

"Nick Jia" <jiashadidai@gmail.com> wrote in message <gdc8kg\$o7i\$1@fred.mathworks.com>...
> I hope I'm making my question clear as follows,
>
> Give any continuous distribution, say, a normal distribution, I hope to use a vector a value, say (x_1, x_2, \cdots, x_n) and a vector of corresponding probablity value (p_1, p_2, \cdots, p_n) attached to those values,
> such that these two vectors represent a discrete distrubiton which approximate the normal "well" in some sense, say, the first m moments of normal disbutions are all equal to those of discrete distrubiton, and that the L_2 distance between the two disbutions are small enought.
> (Actually, any other creteria is fine, I'm just describing the one I come up with).
>
> btw, in the above question, let's say only n (and possibly m) is free to choose.
>
> Thanks for your help or thoughts, insights, and suggestions.
>
> best,
> Jia

Have you found a solution to this problem? I would be interested too.

Subject: How to use a discrete normal distribution to represent a normal distribution

From: Roger Stafford

### Roger Stafford (view profile)

Date: 26 Dec, 2008 19:15:04

Message: 7 of 8

"Nick Jia" <jiashadidai@gmail.com> wrote in message <gde7np\$avl\$1@fred.mathworks.com>...
> .......
> I'm not sure about this, how about L_2 norm on cdf, where discrete one is an increasing step function?
> but as I said, I mean any cretia, I was just randomly propose one.

If you consider that your two vectors represent a step function cdf, then you would, in effect, be asking, "what is the best way to approximate a given continuous density distribution with one another continuous distribution which is composed entirely of a given number of linear segments?" In an idealized sense it seems to me the best match would be achieved by minimizing the L2 norm distance between these, totally ignoring their respective moment values.

However, I have to admit finding this best match may not be such an easy task. The difficult part of it is probably optimizing the discrete x-values. It is a nonlinear least squares problem involving cumulative distribution values for the given distribution at continuously variable points - that is, at the discrete x-values which are to be optimised. If you used something like "fminunc" in the Optimzation Toolbox, the objective function would need to continually refer to integrals involving the given distribution function taken over varying x intervals, which would imply a great amount of computation.

I'm afraid this isn't much help, but it is the best I can come up with at the moment.

Roger Stafford

Subject: How to use a discrete normal distribution to represent a normal distribution

From: Roger Stafford

### Roger Stafford (view profile)

Date: 26 Dec, 2008 20:10:04

Message: 8 of 8

"Roger Stafford" <ellieandrogerxyzzy@mindspring.com.invalid> wrote in message <gj3afo\$pr2\$1@fred.mathworks.com>...
> ........
> If you consider that your two vectors represent a step function cdf, then you would, in effect, be asking, "what is the best way to approximate a given continuous density distribution with one another continuous distribution which is composed entirely of a given number of linear segments?" In an idealized sense it seems to me the best match would be achieved by minimizing the L2 norm distance between these, totally ignoring their respective moment values.
>
> However, I have to admit finding this best match may not be such an easy task. The difficult part of it is probably optimizing the discrete x-values. It is a nonlinear least squares problem involving cumulative distribution values for the given distribution at continuously variable points - that is, at the discrete x-values which are to be optimised. If you used something like "fminunc" in the Optimzation Toolbox, the objective function would need to continually refer to integrals involving the given distribution function taken over varying x intervals, which would imply a great amount of computation.
> .......

I want to clarify something I said a few minutes ago. Suppose we call the original density distribution function, f(x). In computing the objective function that 'fminunc' is to minimize, you would need to have available both

F(x) = int(f(t), t = -inf, x) <--- That is, its cdf function

and

M1(x) = int(t*f(t), t = -inf, x) <--- Its "first moment" function

These would have to be available to be called on as function handles. From them the objective function for 'fminunc' to use can be computed.

Roger Stafford

## Tags for this Thread

No tags are associated with this thread.

### What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.