estimateSampleSizeViaStudentT

fun estimateSampleSizeViaStudentT(desiredHW: Double, initStdDevEst: Double, level: Double = 0.95): Long

Estimate the sample size based on iterating the half-width equation based on the Student-T distribution: hw = t(1-alpha/2, n-1)*s/sqrt(n) <= epsilon

Return

the estimated sample size

Parameters

desiredHW

the desired half-width (must be bigger than 0)

initStdDevEst

an initial estimate of the standard deviation (must be bigger than or equal to 0)

level

the confidence level (must be between 0 and 1)