Click here to Skip to main content
15,888,521 members
Home / Discussions / C#
   

C#

 
GeneralPre-Build events for specific configurations Pin
Joe Woodbury6-Oct-03 8:42
professionalJoe Woodbury6-Oct-03 8:42 
GeneralRe: Pre-Build events for specific configurations Pin
leppie6-Oct-03 9:21
leppie6-Oct-03 9:21 
GeneralRe: Pre-Build events for specific configurations Pin
Joe Woodbury6-Oct-03 9:39
professionalJoe Woodbury6-Oct-03 9:39 
GeneralStatistical Functions in C# Pin
AZBugsBunny6-Oct-03 8:00
AZBugsBunny6-Oct-03 8:00 
GeneralRe: Statistical Functions in C# Pin
leppie6-Oct-03 9:28
leppie6-Oct-03 9:28 
GeneralRe: Statistical Functions in C# Pin
Kevin McFarlane6-Oct-03 10:37
Kevin McFarlane6-Oct-03 10:37 
GeneralRe: Statistical Functions in C# Pin
leppie6-Oct-03 12:31
leppie6-Oct-03 12:31 
GeneralRe: Statistical Functions in C# Pin
Donald_a8-Oct-03 3:40
Donald_a8-Oct-03 3:40 
I'm not sure exactly what you are after, but this may help?

using System;

namespace NormInvFunc{

	public class Normal
	{         
	        private static double Density(double x)
		{
			double y=Math.Pow (2*Math.PI ,-.5)*Math.Exp(-.5*x*x);
			return y;
		}

		public static double StandardNormal(double x)
		{
			double [] a=new double[5];
			a[0]=.31938153;
			a[1]=-.356563782;
			a[2]=1.781477937;
			a[3]=-1.821255978;
			a[4]=1.330274429;
 
			double K=.2316419;
			double L=Math.Abs(x);
			double nx=Density(L);
			double q=1/(1+K*L);
			double S=0;
			for(int j=0;j<5;j++)
			{
				S+= a[j]*Math.Pow(q,j+1);
			}
			double SND=1-nx*S;
			if(x<0)
			{
				SND=1-SND;
			}
			return SND;
 
		}
                                                               
		public static double StandardNormalInv(double R)
		{
			double Delta=1;
			double X=0;
			double Y=0;
			do
			{
				Y=X-(StandardNormal(X)-R)/Density(X);
				Delta=Math.Abs (Y-X);
				X=Y;
			}
			while (Delta>.000000001);
 
			return Y;
 		}
 
	}
 
}


NB will not return quite as many decimal places as excel.
Generalabout lock Pin
yyf6-Oct-03 5:52
yyf6-Oct-03 5:52 
GeneralRe: about lock Pin
jparsons6-Oct-03 6:21
jparsons6-Oct-03 6:21 
GeneralRe: about lock Pin
Daniel Turini6-Oct-03 6:30
Daniel Turini6-Oct-03 6:30 
GeneralRe: about lock Pin
jparsons6-Oct-03 6:36
jparsons6-Oct-03 6:36 
GeneralRe: about lock Pin
yyf6-Oct-03 7:39
yyf6-Oct-03 7:39 
GeneralRe: about lock Pin
jparsons6-Oct-03 13:02
jparsons6-Oct-03 13:02 
GeneralRe: about lock Pin
yyf7-Oct-03 6:03
yyf7-Oct-03 6:03 
QuestionA datatype/some way for 256 bit values? Pin
Fang@Illusion6-Oct-03 5:42
Fang@Illusion6-Oct-03 5:42 
AnswerRe: A datatype/some way for 256 bit values? Pin
Daniel Turini6-Oct-03 6:37
Daniel Turini6-Oct-03 6:37 
GeneralRe: A datatype/some way for 256 bit values? Pin
Fang@Illusion6-Oct-03 7:55
Fang@Illusion6-Oct-03 7:55 
AnswerRe: A datatype/some way for 256 bit values? Pin
leppie6-Oct-03 7:06
leppie6-Oct-03 7:06 
GeneralRe: A datatype/some way for 256 bit values? Pin
jparsons6-Oct-03 5:42
jparsons6-Oct-03 5:42 
GeneralRe: A datatype/some way for 256 bit values? Pin
Fang@Illusion8-Oct-03 9:01
Fang@Illusion8-Oct-03 9:01 
GeneralDirectoryTreeView with CheckBoxes Pin
j-hannemann6-Oct-03 4:30
j-hannemann6-Oct-03 4:30 
GeneralGetting CheckBox control in DataGrid Pin
brian41906-Oct-03 3:51
brian41906-Oct-03 3:51 
GeneralContext Menu Pin
.gonad6-Oct-03 3:31
.gonad6-Oct-03 3:31 
GeneralRe: Context Menu Pin
mistery226-Oct-03 10:13
mistery226-Oct-03 10:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.