Computing T-Distribution Cumulative Probability Density Function

I’ll be the first to admit, its been a long time since I was in Statistics class, but it’s really one of the most useful classes out there, even the esoteric parts of it.

Recently, I had to write code to compute bias estimation for climate change data, and one of the key stats used in computing bias estimation along with its summary statistics is: the t-distribution cumulative probability density function, or tcdf for short.

In Java land, we are fortunate to have the Apache Commons Math library, which allows computation of tcdf and inverse-tcdf:
http://commons.apache.org/math/userguide/distribution.html 

Something like the following, using Apache Commons Math, will allow calculation of an inverse tcdf:

TDistribution t = new TDistributionImpl(degreeOfFreedom);
a = (t.inverseCumulativeProbability(0.975))

Advertisements

2 thoughts on “Computing T-Distribution Cumulative Probability Density Function

  1. Hi Victor,

    TDistributionImpl (packaged under the apache commons-math lib) can be imported from the class: org.apache.commons.math.distribution.TDistributionImpl

    If you are using Maven, include the Apache Commons Math library by adding the following to your pom.xml:
    <dependency>
    <groupId>org.apache.commons</groupId>
    <artifactId>commons-math</artifactId>
    <version>2.1</version>
    </dependency>

    HTH!
    Rishi

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s