python - Probit regression using PyMC 3 -


I have posted a dragon notebook here:

I am trying to create a probe rebress model using PMC3.

"post-text" itemprop = "text" The estimation of blocking is correct, using the data generated to recover the known parameters (see notebook), but the slope estimation marks the mark is far.

My model looks like this:

  with pm.model () Model as: #prearse alpha = pm. Normal ('alpha', mu = 0, tow = 0.001) beta = b. B.) #def invlogit (x): # linear predictor theta_p = (alpha + beta * x) # logic conversion (just for comparison - this seems to be working properly): # (normal, 'beta', mu = 0, tau = 0.001) # Import theano.tensor T # Return T. XP (x) / (1 + t.exp (x)) # Theta = invlogit (theta_p) #Changes: This def phi (x) does not work: Import theano.tensor as T Return 0.5 * ( 1 + t.erf (x / t.sqr (2))) theta = phi (Theta_p) with the probability model y = pm.Bernoulli ('y', p = theta, saw = y): #include start = Print Print ("alpha:", ['alpha']) print ("beta:", [beta ']'), print the initial value by pm.find_MAP () # Customizable print ("MAP found:") Prior with the model ("Compare with the correct values") Print ("true_lfa", true_lifa) print ("true_beta", true_beta): phase = pm.NUTS () trace = pm.sample (2000, phase, start = start, progress bar = true) # draw back samples < / Code> 

It seems that the only way to do this is to use Theano to define F.A., use the error function, similarly for the suburban regression example, the PEMC repository To

Can anyone tell me in the right direction? Is there a better / easy way to do this?

It can be very long after the horse speaks, but I only have a simple hierarchical binary model Have tried to apply themselves and found comparable results for a logic function.

I only have the difference that I have used the tensor SQLTranscript function, maybe there may be a typo on your part?

  import theano.tensor as tsr def probit_phi (x): "" "probability 0 mean and 1 sd" mu = 0 sd = 1 0.5 * (1 + tsr. Erf ((x - mu) / (sd * tsr.sqrt (2))))  

Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -