Deriving points conforming to bell curve

Click For Summary

Discussion Overview

The discussion revolves around generating points that conform to a bell curve distribution for a system that collects values from devices. Participants explore methods for generating these points during data collection rather than analyzing them post hoc, focusing on mathematical transformations and algorithms suitable for this purpose.

Discussion Character

  • Exploratory
  • Technical explanation
  • Mathematical reasoning

Main Points Raised

  • One participant describes a current method for generating points that results in a linear distribution and seeks a way to adjust this to follow a bell curve.
  • Another participant suggests replacing the current method with a Normally Distributed Random Variable with Zero Mean.
  • A participant mentions the Box–Muller transform as a suitable method for generating normally distributed points, noting the need to decide on a standard deviation based on application requirements.
  • Another participant discusses the inverse-normal transformation as a general approach for generating random variables that conform to a normal distribution.
  • A later reply provides a specific implementation of the Box–Muller transform, focusing on generating points along the x-axis and adjusting the output accordingly.
  • One participant notes that the Box–Muller transform yields two normally distributed random variables and suggests generating them in pairs for efficiency, while confirming the validity of the provided formula.

Areas of Agreement / Disagreement

Participants generally agree on the use of the Box–Muller transform and the inverse-normal transformation for generating normally distributed points. However, there is no consensus on the specific implementation details or the choice of standard deviation, indicating multiple competing views on the best approach.

Contextual Notes

Participants mention the need to consider application-specific requirements when selecting standard deviations and transformations, highlighting the dependence on the context of use. There are also unresolved aspects regarding the efficiency of generating random variables and the implications of using different methods.

Who May Find This Useful

This discussion may be useful for software developers, data scientists, and engineers interested in generating normally distributed random variables for simulations or data collection systems.

MichaelEber
Messages
3
Reaction score
0
I am writing a system that collects values from our devices (CRAH, Generators, etc) compute the trend of the data, and determine if an alarm should be raised.

For testing I have a point generator and I want it to follow fairly realistic norms. Currently I generate a new point as:

p.Y = p'.Y + rand.NextDouble()-.5; | p' is the previous point, and Y is the value being generated (p.X is a point in time)

This is taking the value of the last point and adding a random variant that is +- .5.

The problem is that rand will generate a totally linear grouping of numbers. What I want to do is put that point through a computation so that the next point follows a bell curve. Therefore it is more likely to generate a difference of (say) .09 - -.09 then it is .5 and .5 is closer to a 0 chance of generation than any other point.

I've used google and searched a few math forums but most of the discussion is from data analysis after the fact not during generation of the points.

Any suggestions on a formulae that would produce the desired distribution?
 
Physics news on Phys.org
What I want to do is put that point through a computation so that the next point follows a bell curve.
Do you mean to replace p.Y = p'.Y + rand.NextDouble()-.5 with
p.Y = p'.Y + NormallyDistributedRandomVariableWithZeroMean ?
 
Well I guess that is what I mean. So what is the formula for that?
 
MichaelEber said:
Well I guess that is what I mean. So what is the formula for that?

The Box–Muller transform is a good way. But you're going to have to decide what standard deviation to use, and that depends on your application.
 
MichaelEber said:
Well I guess that is what I mean. So what is the formula for that?
Generally speaking, you need to apply the inverse-normal (inverse Gaussian) transformation to a random variable between 0 and 1; one way is to use the algorithm CRGreathouse suggested.
 
Thanks for the input. Looking at the Box Muller transform, it is aimed at creating an x,y point in a two dimensional space. Since I was only interested in generating points along the x-axis I used the s1 part of the transform.

p.Y = p'.Y + (Math.Sqrt( -2 * Math.Log( rand.NextDouble( ) ) ) * Math.Cos( 2 * Math.PI * rand.NextDouble( ) )) - .5;

where each rand.NextDouble() supplies the random x1 and y1 from the evenly distributed range of points between 0 and 1.

plugged it into the formula and will begin testing soon to see how it goes.

Thanks.
 
The s2 is just another random normal variable. You get two for the price of one. If speed is an issue, generate them two at a time; if not, the formula you have works.
 

Similar threads

  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 22 ·
Replies
22
Views
4K
Replies
24
Views
3K
  • · Replies 26 ·
Replies
26
Views
3K
  • · Replies 1 ·
Replies
1
Views
1K
Replies
7
Views
10K
  • · Replies 9 ·
Replies
9
Views
4K
  • · Replies 10 ·
Replies
10
Views
3K
  • · Replies 5 ·
Replies
5
Views
2K