Compiled PDF & CDF Issues
- To: mathgroup at smc.vnet.net
- Subject: [mg90581] Compiled PDF & CDF Issues
- From: "Benedetto Bongiorno" <bongiob at sbcglobal.net>
- Date: Mon, 14 Jul 2008 05:22:32 -0400 (EDT)
Members,
Below listed is my notebook "HypergeometricDistributionErrors.nb" that shows
the following:
When I use the PDF or CDF functions I get the correct answers.
When I use the compiled PDF or CDF functions I get the correct answers but
CompiledFunction::cfse errors.
I cannot figure what I am doing wrong.
Mathematica V 6.0.3
OS Microsoft Windows XP Professional x64
I thank you ahead for you advice.
Ben Bongiorno
Notebook start******************************************
Table[{k,CDF[HypergeometricDistribution[5,12,20],k]},{k,0,5}]
{{0,7/1938},{1,56/969},{2,287/969},{3,224/323},{4,613/646},{5,1}}
Compile[{sample,populationMarked,population,xMin,xMax},
Table[{k,CDF[HypergeometricDistribution[sample,populationMarked,population],
k]},{k,xMin,xMax}]];
%[5,12,20,0,5]
CompiledFunction::cfse: Compiled expression
HypergeometricDistribution[5.,12.,20.] should be a machine-size real number.
CompiledFunction::cfex: Could not complete external evaluation at
instruction 13; proceeding with uncompiled evaluation.
{{0,7/1938},{1,56/969},{2,287/969},{3,224/323},{4,613/646},{5,1}}
Table[{k,PDF[HypergeometricDistribution[5,12,20],k]},{k,0,5}]
{{0,7/1938},{1,35/646},{2,77/323},{3,385/969},{4,165/646},{5,33/646}}
Compile[{sample,populationMarked,population,xMin,xMax},Table[{k,PDF[Hypergeo
metricDistribution[sample,populationMarked,population],k]},{k,xMin,xMax}]];
%[5,12,20,0,5]
CompiledFunction::cfse: Compiled expression
HypergeometricDistribution[5.,12.,20.] should be a machine-size real number.
CompiledFunction::cfex: Could not complete external evaluation at
instruction 13; proceeding with uncompiled evaluation.
{{0,7/1938},{1,35/646},{2,77/323},{3,385/969},{4,165/646},{5,33/646}}
Notebook end*********************************************************