summaryrefslogtreecommitdiff
path: root/gi/pf/tied_resampler.h
diff options
context:
space:
mode:
Diffstat (limited to 'gi/pf/tied_resampler.h')
-rw-r--r--gi/pf/tied_resampler.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/gi/pf/tied_resampler.h b/gi/pf/tied_resampler.h
index 5a262f9d..6f45fbce 100644
--- a/gi/pf/tied_resampler.h
+++ b/gi/pf/tied_resampler.h
@@ -42,6 +42,10 @@ struct TiedResampler {
return llh;
}
+ double LogLikelihood() const {
+ return LogLikelihood(discount, strength);
+ }
+
struct DiscountResampler {
DiscountResampler(const TiedResampler& m) : m_(m) {}
const TiedResampler& m_;
@@ -106,6 +110,13 @@ struct BinTiedResampler {
}
}
+ double LogLikelihood() const {
+ double llh = 0;
+ for (unsigned i = 0; i < resamplers.size(); ++i)
+ llh += resamplers[i].LogLikelihood();
+ return llh;
+ }
+
private:
std::vector<TiedResampler<CRP> > resamplers;
};