public static double gammaMode(double mu, double beta, double gamma) {
		if (beta <= 0.0D) throw new IllegalArgumentException("The scale parameter, " + beta + "must be greater than zero");
		if (gamma <= 0.0D) throw new IllegalArgumentException("The shape parameter, " + gamma + "must be greater than zero");
		double mode = Double.NaN;
		if (gamma >= 1.0D) mode = (gamma - 1.0D) * beta - mu;
		return mode;
	}