Deriving points conforming to bell curve

In summary, the point generator is generating points that follow a linear distribution, but what the user wants is for the next point to follow a bell curve, so they are using a Box-Muller transform to create an x,y point in a two dimensional space. The inverse normal transform is used to generate the random x1 and y1 values.
  • #1
MichaelEber
3
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
  • #2
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 ?
 
  • #3
Well I guess that is what I mean. So what is the formula for that?
 
  • #4
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.
 
  • #5
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.
 
  • #6
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.
 
  • #7
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.
 

Related to Deriving points conforming to bell curve

1. What is a bell curve and why is it important in data analysis?

A bell curve, also known as a normal distribution, is a graphical representation of a dataset that follows a symmetrical and bell-shaped pattern. It is important in data analysis because many natural phenomena, such as human traits and test scores, tend to follow this pattern, making it a useful tool for understanding and analyzing data.

2. How is a bell curve used to derive points?

A bell curve can be used to derive points by calculating the mean and standard deviation of a dataset and then using those values to determine the corresponding points on the curve. This method allows for the creation of a standardized scale for the dataset, making it easier to compare different data points.

3. Can a bell curve be used for any type of dataset?

No, a bell curve is most commonly used for datasets that follow a normal distribution. If the data does not follow a symmetrical pattern, a different type of curve or method may be more appropriate for deriving points.

4. How does the shape of a bell curve affect the data analysis?

The shape of a bell curve can provide important insights into the data being analyzed. For example, a bell curve with a high peak and narrow spread suggests that the data is tightly clustered around the mean, while a flatter curve with a wider spread indicates a more diverse dataset.

5. Are there any limitations to using a bell curve in data analysis?

While a bell curve can be a useful tool in data analysis, it is important to note that it is not always applicable to every dataset. Additionally, it is a simplified representation of data and may not accurately capture all the nuances and complexities of the data. It is important for scientists to carefully consider the appropriateness of using a bell curve and to use other methods if necessary.

Similar threads

  • Set Theory, Logic, Probability, Statistics
Replies
5
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
24
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
9
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
23
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
10
Views
2K
  • Set Theory, Logic, Probability, Statistics
Replies
15
Views
1K
Replies
1
Views
993
Replies
20
Views
1K
Replies
4
Views
1K
  • Calculus and Beyond Homework Help
Replies
8
Views
487
Back
Top