def get_aic(self, second_order=False): """returns Aikake Information Criteria Parameters ---------- second_order if true, the second adjusted by the alignment length """ if second_order: sequence_length = sum( len(self.get_param_value("lht", locus=l).index) for l in self.locus_names) else: sequence_length = None lnL = self.get_log_likelihood() nfp = self.get_num_free_params() return aic(lnL, nfp, sequence_length)
def test_aic_corrected(self): """correctly compute AIC corrected for small sample size""" # from Burnham & Anderson 2002, p102 assert_allclose(aic(-9.7039, 4, sample_size=13), 32.4078)
def test_aic(self): """correctly compute AIC from Burnham & Anderson 2002, p102""" assert_allclose(aic(-9.7039, 4), 27.4078)
def test_aic(self): """correctly compute AIC from Burnham & Anderson 2002, p102""" self.assertFloatEqual(aic(-9.7039, 4), 27.4078)