/** * Returns the mean of the distribution. * * For <code>k</code> degrees of freedom, the mean is * <code>k</code> * * @return the mean * @since 2.2 */ public double getNumericalMean() { return getDegreesOfFreedom(); }
/** * Returns the variance of the distribution. * * For <code>k</code> degrees of freedom, the variance is * <code>2 * k</code> * * @return the variance * @since 2.2 */ public double getNumericalVariance() { return 2*getDegreesOfFreedom(); } }
/** * Access the initial domain value, based on <code>p</code>, used to * bracket a CDF root. This method is used by * {@link #inverseCumulativeProbability(double)} to find critical values. * * @param p the desired probability for the critical value * @return initial domain value */ @Override protected double getInitialDomain(double p) { // NOTE: chi squared is skewed to the left // NOTE: therefore, P(X < μ) > .5 double ret; if (p < .5) { // use 1/2 mean ret = getDegreesOfFreedom() * .5; } else { // use mean ret = getDegreesOfFreedom(); } return ret; }
/** * Access the initial domain value, based on <code>p</code>, used to * bracket a CDF root. This method is used by * {@link #inverseCumulativeProbability(double)} to find critical values. * * @param p the desired probability for the critical value * @return initial domain value */ @Override protected double getInitialDomain(double p) { // NOTE: chi squared is skewed to the left // NOTE: therefore, P(X < μ) > .5 double ret; if (p < .5) { // use 1/2 mean ret = getDegreesOfFreedom() * .5; } else { // use mean ret = getDegreesOfFreedom(); } return ret; }
/** * Access the domain value upper bound, based on <code>p</code>, used to * bracket a CDF root. This method is used by * {@link #inverseCumulativeProbability(double)} to find critical values. * * @param p the desired probability for the critical value * @return domain value upper bound, i.e. * P(X < <i>upper bound</i>) > <code>p</code> */ protected double getDomainUpperBound(double p) { // NOTE: chi squared is skewed to the left // NOTE: therefore, P(X < μ) > .5 double ret; if (p < .5) { // use mean ret = getDegreesOfFreedom(); } else { // use max ret = Double.MAX_VALUE; } return ret; }
/** * Access the initial domain value, based on <code>p</code>, used to * bracket a CDF root. This method is used by * {@link #inverseCumulativeProbability(double)} to find critical values. * * @param p the desired probability for the critical value * @return initial domain value */ protected double getInitialDomain(double p) { // NOTE: chi squared is skewed to the left // NOTE: therefore, P(X < μ) > .5 double ret; if (p < .5) { // use 1/2 mean ret = getDegreesOfFreedom() * .5; } else { // use mean ret = getDegreesOfFreedom(); } return ret; }
/** * Access the domain value upper bound, based on <code>p</code>, used to * bracket a CDF root. This method is used by * {@link #inverseCumulativeProbability(double)} to find critical values. * * @param p the desired probability for the critical value * @return domain value upper bound, i.e. * P(X < <i>upper bound</i>) > <code>p</code> */ @Override protected double getDomainUpperBound(double p) { // NOTE: chi squared is skewed to the left // NOTE: therefore, P(X < μ) > .5 double ret; if (p < .5) { // use mean ret = getDegreesOfFreedom(); } else { // use max ret = Double.MAX_VALUE; } return ret; }
/** * Access the domain value upper bound, based on <code>p</code>, used to * bracket a CDF root. This method is used by * {@link #inverseCumulativeProbability(double)} to find critical values. * * @param p the desired probability for the critical value * @return domain value upper bound, i.e. * P(X < <i>upper bound</i>) > <code>p</code> */ @Override protected double getDomainUpperBound(double p) { // NOTE: chi squared is skewed to the left // NOTE: therefore, P(X < μ) > .5 double ret; if (p < .5) { // use mean ret = getDegreesOfFreedom(); } else { // use max ret = Double.MAX_VALUE; } return ret; }