(*  truncated_normal_b_pdf_values.nb *)
(* *)
(*  Purpose: *)
(*    Evaluate the PDF of the Truncated Normal B Distribution *)
(*    at selected argument values, *)
(*    and write the data to a file. *)
(* *)
(*  Modified:  13 September 2013 *)
(*  Author:  John Burkardt *)

xvec={90, 92, 94, 96, 98, 100, 102, 104, 106, 108, 110};
fvec = {};
num = Length [ xvec ];

Do [ {
mu=100, 
sigma = 25, 
x=xvec[[i]],
tdist = TruncatedDistribution[ {-Infinity,150},NormalDistribution[mu,sigma]],f = PDF[tdist,x] ,
fvec = Append [ fvec, f ],
      Print["  TruncatedNormalB_PDF[",x,"]=",N[f,16]] },{i,1,num,1}]

fileout=OpenWrite["/panfs/panasas1/users/jburkardt/public_html/math_src/truncated_normal/truncated_normal_b_pdf_values.txt"];
SetOptions[fileout,FormatType->TextForm];
Write[fileout,"#  truncated_normal_b_pdf_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];