Skip to content
Browse files

Added attrs for evaluate-survey.

  • Loading branch information...
1 parent c2031ad commit 3e62929cd59dac7c44f489e26affd452ab64e2f6 @apatil apatil committed Oct 18, 2010
Showing with 10 additions and 1 deletion.
  1. +10 −1 itn/__init__.py
View
11 itn/__init__.py
@@ -1,6 +1,6 @@
# from mcmc import *
from model import *
-from generic_mbg import stukel_invlogit, FieldStepper
+from generic_mbg import stukel_invlogit
import pymc as pm
import numpy as np
@@ -23,6 +23,15 @@ def itn_map(sp_sub, a1, a2):
map_postproc = [itn_map]
+def simdata_postproc(sp_sub, survey_plan, a1, a2):
+ p = pm.stukel_invlogit(sp_sub, a1, a2)
+ n = survey_plan.n
+ return pm.rbinomial(n, p)
+
+def survey_likelihood(sp_sub, survey_plan, data, i, a1, a2):
+ data_ = np.ones_like(sp_sub)*data[i]
+ return pm.binomial_like(data_, survey_plan.n[i], pm.stukel_invlogit(sp_sub, a1, a2))
+
def itn_val(data):
obs = data.pos
n = data.pos + data.neg

0 comments on commit 3e62929

Please sign in to comment.
Something went wrong with that request. Please try again.