Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #100445
| X-Received | by 10.107.135.21 with SMTP id j21mr32053534iod.2.1450147388630; Mon, 14 Dec 2015 18:43:08 -0800 (PST) |
|---|---|
| X-Received | by 10.50.85.111 with SMTP id g15mr32318igz.2.1450147388589; Mon, 14 Dec 2015 18:43:08 -0800 (PST) |
| Path | csiph.com!au2pb.net!feeder.erje.net!2.us.feeder.erje.net!enother.net!enother.net!news.glorb.com!mv3no16300748igc.0!news-out.google.com!l1ni3579igd.0!nntp.google.com!mv3no12382167igc.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail |
| Newsgroups | comp.lang.python |
| Date | Mon, 14 Dec 2015 18:43:08 -0800 (PST) |
| Complaints-To | groups-abuse@google.com |
| Injection-Info | glegroupsg2000goo.googlegroups.com; posting-host=50.100.117.144; posting-account=SZ_svQkAAACWRFG2bDA-zgq8ILyl4-vo |
| NNTP-Posting-Host | 50.100.117.144 |
| User-Agent | G2/1.0 |
| MIME-Version | 1.0 |
| Message-ID | <ba4b4615-2739-49b3-9bb3-eafc527ddebc@googlegroups.com> (permalink) |
| Subject | Question about figure plot |
| From | Robert <rxjwg98@gmail.com> |
| Injection-Date | Tue, 15 Dec 2015 02:43:08 +0000 |
| Content-Type | text/plain; charset=ISO-8859-1 |
| Xref | csiph.com comp.lang.python:100445 |
Show key headers only | View raw
Hi,
When I run the following code, there is no figure shown in the end.
//////////
import pymc
import numpy as np
n = 5*np.ones(4,dtype=int)
x = np.array([-.86,-.3,-.05,.73])
alpha = pymc.Normal('alpha',mu=0,tau=.01)
beta = pymc.Normal('beta',mu=0,tau=.01)
@pymc.deterministic
def theta(a=alpha, b=beta):
"""theta = logit^{-1}(a+b)"""
return pymc.invlogit(a+b*x)
d = pymc.Binomial('d', n=n, p=theta, value=np.array([0.,1.,3.,5.]),\
observed=True)
....
import pymc
import mymodel
S = pymc.MCMC(mymodel, db='pickle')
S.sample(iter=10000, burn=5000, thin=2)
pymc.Matplot.plot(S)
I find that the figures are shown after these two lines by myself:
*************
import matplotlib.pyplot as plt
plt.show()
I have searched around and have not found some explanation about it.
The plot function here is different from Matlab's. Is there better ways than
my last two lines? (I am not confident whether my last two lines is the
only choice.
Thanks,
Back to comp.lang.python | Previous | Next — Next in thread | Find similar | Unroll thread
Question about figure plot Robert <rxjwg98@gmail.com> - 2015-12-14 18:43 -0800 Re: Question about figure plot Robert Kern <robert.kern@gmail.com> - 2015-12-15 15:22 +0000
csiph-web