1

I am new to Bayesian statistics and pymc3. In my problem there is workers and reviewers. workers are given a set of questions.Responses given by workers are reviewed by the reviewers. So review is the observable variable. Based on those observes I need to calculate the quality of response, ability of worker and bias of reviewer. reviews are binary correct(Boolean 1) and incorrect(Boolean 0) I created following model using pymc3 and used find_map function to calculate the wanted variables..

##function
def predict(ob):
    with pm3.Model() as last:
       quality_precision = pm3.Gamma('quality_precision', 2, 1)
       ability = pm3.Normal(name="ability", mu=0, sd=10)
       quality = pm3.Normal(name='quality', mu=ability, sd=1 / np.sqrt(quality_precision))
       reviewer_bias= pm3.Normal(name="reviewer_bias", mu=0, sd=5)
       iscorrect = pm3.Binomial('iscorrect',n=1, p=sigmoid(quality + reviewer_bias), observed=ob)
       start = pm3.find_MAP()
   return start



##function call
   print(predict([0,1,1,1,1]))

Model enter image description here

When I give observations for a particular response it is calculating the quality of that response, workers ability. It also gives a values for reviewer bias. But if the observations are like [0,1,1,1,1] that is from several reviewers. How can I calculate each reviewers bias separately?.

Again if I have observations of 2 responses. how can I proceed? how to get quality for those responses separately? I can give an observation set a time.. But ability will be calculated only for that response's observations. But ability needed to be calculated for the all reviews given to that persons responses. Help me!

Community
  • 1
  • 1
Gihan Gamage
  • 2,944
  • 19
  • 27
  • I solved this issue by giving vectors as distribution parameters. – Gihan Gamage Oct 03 '18 at 03:16
  • Glad to hear you solved your issue, Gihan! Please consider posting your comment (maybe with some code) as an answer, and then deleting the comment. – merv Oct 08 '18 at 03:47
  • actually what I did was extended my variables... for example, if there are two workers..there should be two ability values.. so ability=pm3.Normal(name="ability", mu=np.zeros(2), sd=np.ones(2)*10) – Gihan Gamage Oct 08 '18 at 05:26

0 Answers0