1

I have been reviewing the documentation of apache commons math and I find that it also calculates distributions, but I can not understand how it works.

I have two values

  • degrees of freedom = 13
  • confidence interval = 0.95

My problem is that it does not yield the value I need, The objective is:

result = 1.771

import org.apache.commons.math3.distribution.TDistribution


fun calculo(a:Double, b:Double): Double {
    val distf = TDistribution(a,b)
    return distf.getNumericalMean()
}

fun main(args: Array<String>) {
    val ko = calculo(13,0.95)
    println(ko)
}
```
royer
  • 615
  • 1
  • 6
  • 19

1 Answers1

3

You can use the following:

new org.apache.commons.math3.distribution.TDistribution(deg_freedom).
    inverseCumulativeProbability(probability)

Where deg_freedom=13, and probability=0.95.

Brent Worden
  • 10,624
  • 7
  • 52
  • 57
pa4enko11
  • 76
  • 1
  • 8