For program3&4, you are to use algorithms for generating Gaussian/Normal distrib
ID: 3747234 • Letter: F
Question
For program3&4, you are to use algorithms for generating Gaussian/Normal distributions as well as a Poison distribution. You need not document HOW these routines work. The purpose of the exercise is to SHOW graphically that we are using them properly and that we are experiencing the distributions we are expecting. Below, I have provided Visual Basic code for both but you can find your subroutines at a number of different web sites in just about any language you want. See links below. Program 3: Generate and plot the bins for X random number in a Gaussian/Normal distribution. You should be able to select a mean and a standard deviation as this will be required in the other labs. It is not overly tricky to do. Just remember that by default the normal/Gaussian distribution has a mean of 0 and a standard deviation of 1. That means that some of the randomly distributed random number could be NEGATIVE. In most languages, you can't use a negative index for an array element (Bin number),Explanation / Answer
using System; using CenterSpace.NMath.Core; using CenterSpace.NMath.Stats; namespace ProbabilityDistributionExample { /// /// A .NET example in C# showing how to use the probability distribution classes. /// /// /// NMath Stats provides classes for computing the probability density /// function (PDF), the cumulative distribution function (CDF), the inverse /// cumulative distribution function, and random variable moments for a /// variety of probability distributions, including normal (Gaussian), Poisson, /// chi-square, gamma, beta, Student's t, F, binomial, and negative binomial. /// class ProbabilityDistributionExample { static void Main( string[] args ) { // The distribution classes share a common interface, so once you // learn how to use one distribution class, it’s easy to use any of // the others. This code constructs an F distribution object with // degrees of freedom 9,24. int df1 = 9; int df2 = 24; var dist = new FDistribution( df1, df2 ); Console.WriteLine(); Console.WriteLine( dist ); Console.WriteLine(); // Pick a sample value for the F statistic. double fstat = 3.94; Console.WriteLine( "Sample F statistic = {0}", fstat ); Console.WriteLine(); // The PDF() method computes the probability density function // evaluated at a given value. The probability of // observing an F-statistic of 3.94 is given by: Console.WriteLine( "PDF = {0}", dist.PDF( fstat ) ); // The CDF() method computes the cumulative density function // evaluated at a given value. Find the probability of // observing an F-statistic of 3.94 or less, and the probability // of observing an F-statistic greater than 3.94: Console.WriteLine( "CDF = {0}", dist.CDF( fstat ) ); Console.WriteLine( "Upper tail probability = {0}", 1 - dist.CDF( fstat ) ); Console.WriteLine(); // The InverseCDF() computes the inverse cumulative density // function evaluated at a given value. Calculate left and right // critical values for 0.01 alpha level: double alpha = 0.01; Console.WriteLine( "Alpha = {0}", alpha ); Console.WriteLine( "Left critical value = {0}", dist.InverseCDF( alpha ) ); Console.WriteLine( "Right critical value = {0}", dist.InverseCDF( 1 - alpha ) ); Console.WriteLine(); // Properties are provided for getting the first four moments of a // distribution. Console.WriteLine( "Mean of distribution = {0}", dist.Mean ); Console.WriteLine( "Variance of distribution = {0}", dist.Variance ); Console.WriteLine( "Skewness of distribution = {0}", dist.Skewness ); Console.WriteLine( "Kurtosis of distribution = {0}", dist.Kurtosis ); Console.WriteLine(); Console.WriteLine(); Console.WriteLine( "Press Enter Key" ); Console.Read(); } // Main } // class } // namespaceRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.