Home Login  |   Contact  |   About Us       Thursday, April 25, 2024   

j0182018 - Back to Home
   Skip Navigation LinksHOME ›  AREAS OF EXPERTISE  #2 ›   Distribution Function ›  ~ Normal Distribution



Skip Navigation Links.



"Distribution Functions"
Normal Distribution Method
Normal Distribution Results



Number of Points:
Number of Bins:



[ Initial Number of Bins: {20) ]
[ Initial Number of Points: {1000} ]

IMPLEMENTATION
Normal Distribution Method

The normal distribution, also called Gaussian distribution, is a probability distribution of great importance in many fields.

The histogram data is constructed by segmenting the range of the data into equal-sized bins. The vertical axis of the histogram is the number of counts for each bin, and the horizontal axis of the histogram is labeled with the range of response variable. Of course, the best approach to examine the normal distribution is to display the results graphically on a chart. The user can plot results through charting programs, such as Microsoft Excel and Matlab.


Normal Random Number Generator

A normal random generation can be obtained by using a polar algorithm. This algorithm creates two random values at a time. It involves finding a random point in the unit circle by generating uniformly distributed points [-1,1] x [-1,1] square and rejecting any points outside the circle.

Basics of the polar algorithm:

  • Generate two random numbers v1 and v2
  • Let v1 = 2 * v1 - 1, v2 = 2 * v2 - 1, and v12 = v1 * v1 + v2 + v2
  • If vl2 > 1, regenerate v1 and v2

Testing the Normal Distribution Method

To test the Normal Distribution method, a new static method has been added. The TestNormalDistribution() method has been written and executed. No additional code is shown.

For the test, two parameters were set:

number of bins = 20; (nBins)
number of points = 1000; (nPoints)

where the parameter (nBins) is the number of bins in the histogram and (nPoints) is the number of random points. Then a random array is created with a normal distribution. Finally, a comparison is made between the histogram of random data and the theoretical probability density function of the normal distribution. One can see that the results from the normal random generator are very close to the theoretical normal distribution function.

Running this example generates the results shown above.


           static void TestNormalDistribution();
              {
                  for (int i = 0; i < nBins; i++)
                 {
                      ListBox1.Items.Add(" x = " + xdata[i] + "," + " - - - - -> Normal random data = " + ydata[i] + "," + " - - - - -> Normal Distribution = " + Math.Round(ydistribution[i] * normalizeFactor,0).ToString());
                 }
              }



Other Implementations...


Object-Oriented Implementation
Graphics and Animation
Sample Applications
Ore Extraction Optimization
Vectors and Matrices
Complex Numbers and Functions
Ordinary Differential Equations - Euler Method
Ordinary Differential Equations 2nd-Order Runge-Kutta
Ordinary Differential Equations 4th-Order Runge-Kutta
Higher Order Differential Equations
Nonlinear Systems
Numerical Integration
Numerical Differentiation
Function Evaluation


   Quotes

Consulting Services - Back to Home


Home

Home Math, Analysis,
  expertise..."

EIGENVALUE
SOLUTIONS...


> Rayleigh-Quotient Method

> Cubic Spline Method

 

Applied Mathematical Algorithms

Home

ComplexFunctions

Home

NonLinear
Home

Differentiation
Home

Integration
About Us


KMP Software Engineering is an independent multidisciplinary engineering consulting company specializing in mathematical algorithms.

      (About Us) →
Areas of
Expertise


SpecialFunctions
VectorsMatrices
OptimizationMethods
ComplexNumbers
Interpolation
CurveFitting
NonLinearSystems
LinearEquations
DistributionFunctions
NumericalDifferentiation
NumericalIntegration
DifferentialEquations
Smalltalk
FiniteBoundary
Eigenvalue
Graphics
Understanding
Mining


MiningMastery
MineralNews
MineralCommodities
MineralForum
Crystallography
Services


NumericalModeling
WebServices
MainframeServices
OutsourceServices

LINKED IN
MINE REVIEW(by G.Pacheco)
Brand





Home

Login

Contact
Since 2006 All Rights Reserved  © KMP Software Engineering LINKS | PRIVACY POLICY | LEGAL NOTICE