How to calculate z score to percentile conversion in Java

In order to calculate the conversion of z score to percentile we need to get the cumulative area under the normal distribution curve. We could manually calculate the numeric integral however  this might lead us to mistaken results. The best way to do it is by using existing modules written by some trusty source.

In the case of Java, I used NormalDistribution class which comes as part of the Apache Commons Math jar.

My code:

Sample result:

zScore: 1.6151417880272858 Percentile: 94.68600033649766

 

 

Advertisements

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