summaryrefslogtreecommitdiff
path: root/report/pyp_clustering/acl09-short/code/cohnpred.m
diff options
context:
space:
mode:
Diffstat (limited to 'report/pyp_clustering/acl09-short/code/cohnpred.m')
-rw-r--r--report/pyp_clustering/acl09-short/code/cohnpred.m12
1 files changed, 12 insertions, 0 deletions
diff --git a/report/pyp_clustering/acl09-short/code/cohnpred.m b/report/pyp_clustering/acl09-short/code/cohnpred.m
new file mode 100644
index 00000000..35a49605
--- /dev/null
+++ b/report/pyp_clustering/acl09-short/code/cohnpred.m
@@ -0,0 +1,12 @@
+function output = cohnpred(input,b)
+
+uniqin = unique(input);
+prediction = zeros(max(input),1);
+
+p0=1/30114;
+for i = 1:length(uniqin)
+ prediction(uniqin(i)) = b*p0*(psi(b*p0+uniqin(i)) - psi(b*p0));
+end
+
+output = prediction(input);
+