(*  normal_01_cdf_values.nb *)
(* *)
(*  Purpose: *)
(*    Evaluate the Normal 0,1 CDF *)
(*    at selected argument values, *)
(*    and write the data to a file. *)
(* *)
(*  Modified:  02 February 2006 *)
(*  Author:  John Burkardt *)

Needs["Statistics`ContinuousDistributions`"]

xvec={0, 1/10, 2/10, 3/10, 4/10, 5/10, 6/10, 7/10,8/10,9/10,1,15/10,2,25/10,3,35/10,4};
fvec = {};
num = Length [ xvec ];

Do [ {mu=0, sigma = 1, x=xvec[[i]],
dist=NormalDistribution[mu,sigma],f = CDF[dist,x] ,
fvec = Append [ fvec, f ],
      Print["  Normal01CDF[",x,"]=",N[f,16]] },{i,1,num,1}]

fileout=OpenWrite["C:\\Documents and Settings\\burkardt\\Desktop\\Misc\\mathematica\\normal_01_cdf_values.txt"];
SetOptions[fileout,FormatType->TextForm];
Write[fileout,"#  normal_01_cdf_values.txt"];today=DateList[];Write[fileout,"#  Created on ",today];Write[fileout,"#"];
Write[fileout,"#  x  f"];
Write[fileout,"#"];
Do[{x=xvec[[i]];f=fvec[[i]];Write[fileout,N[x,16],"  ",N[f,16]]},{i,1,num,1}];Close[fileout];