Re: Calculation of critical p-, z-, t- and F-values



On 14 Nov, 11:16, "Nasser Abbasi" <n...@xxxxxxxxx> wrote:
<iandjmsm...@xxxxxxx> wrote in message

news:1195038272.573775.184990@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx



I have never used Mathematica, so I do not understand all of your
notes on its use.

I gather when you ask for

Quantile[StudentTDistribution[120], 975/1000]

it returns 2*Sqrt[30*(-1 + 1/InverseBetaRegularized[1, -(19/20), 60,
1/2])] as the symbolic equivalent of it and then evaluates this
expression and outputs it as 1.9799304050824413.

Mathematica does everthing when possible in symbolic form (numbers are kept
in rational form, etc..) unless there is a numeric value in the expression
(i.e. decimal). So, yes, all the above calculations are done analytically,
then at the end a user can ask for the numerical value using the function
N[].



Can you control the accuracy of the calculation?

Yes.

I am just curious
because none of the values returned are particularly accurate and if
Quantile[StudentTDistribution[100000000], 0.975] returns
1.959964074411019 then it is surprisingly inaccurate (relative error
of about 3e-8).

Tis is the actual Quantile expression:

Quantile[StudentTDistribution[100000000], 975/1000]

10000*Sqrt[-1 + 1/InverseBetaRegularized[1, -(19/20), 50000000, 1/2]]

I can now Ask Mathematica to give me the numerical value of the above to 50
decimals for example

N[%, 50]
1.9599640082627668207600863127853028493573117315681873087708854414654`50.

In my last message I was using the default settings. Is the above asnwer
accurate enough now?

Nasser

I've got it. The problem was you asked for
Quantile[StudentTDistribution[100000000], 0.975] and the 0.975 causes
it to work to machine precision. The method of calculation is very
poor and hence only delivers a results with relative error of 3e-8.

You can ask for exact calculations with
Quantile[StudentTDistribution[100000000], 975/1000]

According to http://reference.wolfram.com/mathematica/ref/N.html?q=N&lang=en
N[%, n] attempts to give a result with n-digit precision.

It is not clear what is stopping it giving rather than attempting to
give a result with n-digit precision. The + operation is going to lose
about 8 figures so InverseBetaRegularized[1, -(19/20), 50000000, 1/2]
must be calculated to about 58 digits to give 50 digit accuracy. I am
still lost as to why it has printed out 68 digits. Maybe that is how
many figures it did the calculations to.

Ian Smith

.



Relevant Pages

  • Re: How to increase Working Precision?
    ... string of digits or iterates a function many times or ... and you get an answer whose number of digits is ... If CAS are to be used for long sequences of calculations typical of ... Mathematica that they were not tripped up by Mathematica's ...
    (sci.math.symbolic)
  • Re: An uncountable countable set
    ... >> That the calculation of the digits can be done in parallel? ... but it may depend on the ordering of the calculations. ... By Cantor, Dedekind, Weierstrass and a host of others (using ... binary representations but were not). ...
    (sci.math)
  • Re: FAQ 4.2 Why is int() broken?
    ... To express 1/10 in binary you need an infinite ... number of digits, just like you need an infinite number of digits ... Even among different types of computers floating point calculations are ...
    (comp.lang.perl.misc)
  • Re: FAQ 4.2 Why is int() broken?
    ... To express 1/10 in binary you need an infinite ... number of digits, just like you need an infinite number of digits ... Even among different types of computers floating point calculations are ... is essentially tiny computer with a 6 MHz cpu and yet it can do many ...
    (comp.lang.perl.misc)
  • Re: Excel Calculation Errors
    ... have to do all of your calculations in VB. ... >>certain limits and found that Excel frequently gave misleading results ... >Excel's specifications include a maximum of 15 digits. ... >precision, I believe. ...
    (microsoft.public.excel.misc)