/** Computes <code>hyper_sigsq_mu</code> and <code>hyper_lambda</code>. */ protected void calculateHyperparameters() { hyper_mu_mu = 0; hyper_sigsq_mu = Math.pow(YminAndYmaxHalfDiff / (hyper_k * Math.sqrt(num_trees)), 2); if (sample_var_y == null) { sample_var_y = StatToolbox.sample_variance(y_trans); } // calculate lambda from q double ten_pctile_chisq_df_hyper_nu = 0; ChiSquaredDistributionImpl chi_sq_dist = new ChiSquaredDistributionImpl(hyper_nu); try { ten_pctile_chisq_df_hyper_nu = chi_sq_dist.inverseCumulativeProbability(1 - hyper_q); } catch (MathException e) { System.err.println( "Could not calculate inverse cum prob density for chi sq df = " + hyper_nu + " with q = " + hyper_q); System.exit(0); } hyper_lambda = ten_pctile_chisq_df_hyper_nu / hyper_nu * sample_var_y; }