Skip to content
Advertisement

Searching the student-t distribution table for values using python

Student-t distribution

I would like to define a function that, given a student t distribution table, degrees of freedom(N-1) and P would interpolate over the values of the table to get the desired value of tv,p. Test the code for df=14 and t93. I would like to find another function, given a a student t distribution table, degrees of freedom(N-1) and tv,p would interpolate over the values of the table to get the desired value of P. test the code for df=15, tv,p=20125 I wrote the table in a matrix but I don’t have a clue how I should search and Interpolate for values and would really appreciate the help. Many Thanks!

JavaScript

Advertisement

Answer

For a meaningful interpolation, you would first need to define a 2D inperpolation function (bilinear, bicubic).

For better resutls directly use the scipy implementations of the percent point function (i.e. the inverse cumulative distribution function).

JavaScript

Result is v: 2.57058 so the result is the same as the 2.571 from your table.

This code reproduces your student_t list:

JavaScript

As said above, the inverse of the ppf is the cdf. It can be calculated like this:

JavaScript

Which gives P = 0.950025.

Standard Normal

For standard normal distribution the ppf is also implemented in scipy:

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement