Message Boards Message Boards

0
|
5211 Views
|
3 Replies
|
3 Total Likes
View groups...
Share
Share this post:

How to specify arbitrary working precision for inverse cdf?

I am working on a homework assignment for statistics, and I am using InverseCDF to find the point where I would have a certain cumulative probability for a QuantityDistribution applied to a normal distribution.

widthOfBoltsOfFabricDistribution = 
     QuantityDistribution[NormalDistribution[950, 10], "Millimeters"]

InverseCDF[widthOfBoltsOfFabricDistribution, 0.8531]

InverseCDF[widthOfBoltsOfFabricDistribution, 0.8531] // FullForm

I wonder if there is a way to specify arbitrary working precision for InverseCDF. When I add WorkingPrecision->100, it gives General::argt as an error. I don't understand why InverseCDF doesn't have the option WorkingPrecision when NProbability does. Is there a specific thing that InverseCDF doesn't have that NProbability does have? I will say the ability to specify arbitrary working precision is something Mathematica is very strong in.

POSTED BY: Peter Burbery
3 Replies
Posted 1 year ago

I don't know of an option for InverseCDF specifically. However, you can manage accuracy/precision in several ways.

  • Use the backtick notation. An expression like 0.8531 will be interpreted as a machine precision (approximately 16 digits). You can specify a different precision with the backtick, so, for example,

    0.8531`50
    

will use 50 digits, and subsequent calculations will try to respect that degree of precision.

  • You can apply N to set finite precision of an infinitely precise expression (but it won't actually increase the precision of expressions that already are finite precision).

  • You can use SetPrecision or SetAccuracy on an expression

I'm not actually sure which of these is what you want in your case (and there are probably several other ways to fiddle with accuracy/precision).

POSTED BY: Eric Rimbey

I want InverseCDF to use higher internal precision. I want the output that I get to return an exact answer when I use NProbability with WorkingPrecision->100 for example.

POSTED BY: Peter Burbery

The precision of 0.8531 is MachinePrecision so the result has the same precision. A different precision can be specified e.g. for 20 digits

InverseCDF[widthOfBoltsOfFabricDistribution, 0.8531`20]

Or, get an exact result and then use N for the desired precision

icdf = InverseCDF[widthOfBoltsOfFabricDistribution, Rationalize@0.8531]
N[icdf, 50]

Take a look at the tutorial on numbers.

POSTED BY: Rohit Namjoshi
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract