Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #6520 > unrolled thread
| Started by | Andy Ross <andyr@wolfram.com> |
|---|---|
| First post | 2011-11-19 11:45 +0000 |
| Last post | 2011-11-19 11:45 +0000 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.soft-sys.math.mathematica
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: EmpiricalDistribution bug Andy Ross <andyr@wolfram.com> - 2011-11-19 11:45 +0000
| From | Andy Ross <andyr@wolfram.com> |
|---|---|
| Date | 2011-11-19 11:45 +0000 |
| Subject | Re: EmpiricalDistribution bug |
| Message-ID | <ja84ta$idu$1@smc.vnet.net> |
This is a known issue that has been resolved for future versions of
Mathematica but unfortunately didn't make it in for 8.0.4. In the
meantime you can use the following code which should fix the problem.
GeometricFunctions`BinarySearch;
Unprotect[GeometricFunctions`BinarySearch];
GeometricFunctions`BinarySearch[{{d_?NumericQ},"Sorted"},x_?NumericQ]:=Which[x<d,0,x==d,1,True,2];
Protect[GeometricFunctions`BinarySearch];
It is possible (though unlikely) that this could have some unintended
consequences in other parts of Mathematica so only use it if you really
need it.
Sorry this didn't get caught earlier and I hope this resolves the issue
for you.
Andy Ross
Wolfram Research
On 11/18/2011 5:22 AM, Mark Fisher wrote:
> Here is a (bad) bug involving EmpriicalDistribution:
>
> PDF[EmpiricalDistribution[{1}], 1]
>
> produces error messages and returns
>
> Boole[{1}[[GeometricFunctions`BinarySearch[{{1}, "Sorted"}, 1]]] ==
> 1] {1}[[GeometricFunctions`BinarySearch[{{1}, "Sorted"}, 1]]]
>
> Here is an (awkward) workaround:
>
> PDF[EmpiricalDistribution[{1}], x] /. x -> 1
>
> which returns 1.
>
> I have submitted this to support@wolfram.com, but I'm hoping someone
> lurking from wolfram will look into this and figure out a code patch
> that can be applied right away. Thanks.
>
> --Mark
>
> "8.0 for Microsoft Windows (64-bit) (October 7, 2011)"
>
Back to top | Article view | comp.soft-sys.math.mathematica
csiph-web