Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #7056

Re: Gaps in plotted graph, probably resulting from real values being miscomputed as complex

From "Oleksandr Rasputinov" <oleksandr_rasputinov@hmamail.com>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: Gaps in plotted graph, probably resulting from real values being miscomputed as complex
Date 2011-12-09 11:03 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <jbspum$3tf$1@smc.vnet.net> (permalink)

Show all headers | View raw


On Thu, 08 Dec 2011 10:25:11 -0000, jdm <james.d.mclaughlin@gmail.com>  
wrote:

> Plot[Log[2,
>   PDF[NormalDistribution[0, 1],
>     InverseCDF[NormalDistribution[0, 1], (1 - 2^(-x))]]^2], {x, 1,
>   256}, PlotRange -> {-500, 0}]
>
> plots up to about x=56, and then nothing.
>
> Based on similar behaviour under another system, I suspect that some  
> sort of
> calculation error as 1 - 2^(-x) approaches 1 is causing some of the
> values that should be plotted to be wrongly computed as complex
> numbers, but have no way of confirming this and don't understand why
> the real-valued values aren't being plotted for their corresponding x
> if this is the case.
>
> Can anyone suggest anything?
>
> Thanks,
>
> James McLaughlin.
>

Working in machine precision without precision tracking leads to numerical  
errors in this case. Switching on precision tracking fixes the issue:

Plot[
  Log[2,
   PDF[
     NormalDistribution[0, 1],
     InverseCDF[NormalDistribution[0, 1], (1 - 2^(-x))]
    ]^2
  ], {x, 1, 256},
  PlotRange -> {-500, 0}, WorkingPrecision -> $MachinePrecision
]

Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread


Thread

Re: Gaps in plotted graph, probably resulting from real values being miscomputed as complex "Oleksandr Rasputinov" <oleksandr_rasputinov@hmamail.com> - 2011-12-09 11:03 +0000

csiph-web