Closed ghost closed 10 years ago
It does draw to the same filename. The reasoning for this behavior is that we were hoping that a julia IDE would surface that would allow you to display plots as you created them (so each time you press ENTER to draw next plot you would see the plot in the IDE).
It might be a good idea for us to consider writing these plots out to different filenames in the interim.
Maybe another way around this is using now & ncol, e.g. the Seeds example:
p = plot(sim);
draw(p, nrow=5, ncol=2, filename="/home/user/Desktop/summaryplot.svg")
Not sure how to do this on Windows, but is there an equivalent for
run(`open -a "Google Chrome.app" "/home/user/Desktop/summaryplot.svg"`)
to immediately show the plots?
In addition to my earlier suggestion to use nrow & ncol, an alternative is to plot directly within iJulia, an example below for the Seeds example.
I actually like Brian’s format quite a bit and even have started using that to show the output (converted to Mamba chains) of Jags (and soon Stan) using similar .svg files.
Rob J. Goedman goedman@icloud.com
vstack( hstack( plot(x=1:size(sim.value, 1), y=sim.value[:, 3], Geom.line, Guide.xlabel("Samples"), Guide.ylabel(sim.names[3])), plot(x=1:size(sim.value, 1), y=sim.value[:, 2], Geom.line, Guide.xlabel("Samples"), Guide.ylabel(sim.names[2])), ), hstack( plot(x=1:size(sim.value, 1), y=sim.value[:, 4], Geom.line, Guide.xlabel("Samples"), Guide.ylabel(sim.names[4])), plot(x=1:size(sim.value, 1), y=sim.value[:, 5], Geom.line, Guide.xlabel("Samples"), Guide.ylabel(sim.names[5])), ) )
On Oct 20, 2014, at 11:04 PM, rsmith31415 notifications@github.com wrote:
It seems to be the case that plotting large models has a somewhat odd behavior. For example, plotting the results of this example http://mambajl.readthedocs.org/en/latest/examples/seeds.html outputs this:
julia> p = plot(sim) julia> draw(p, filename="/home/user/Desktop/summaryplot.svg") Press ENTER to draw next plot However, I can't see the other plots. I'm not entirely sure if the same file is being replaced although I don't think so.
In more complex models, the message Press ENTER to draw next plot keeps showing up after pressing enter many times and I have to interrupt the operation.
I'm using Julia 0.3.1 and Gadfly 0.3.9.
— Reply to this email directly or view it on GitHub https://github.com/brian-j-smith/Mamba.jl/issues/9.
@bdeonovic Are you sure draw
is writing in the same file? I reran the simulation and didn't get other plots no matter how many times I pressed enter. I didn't notice the original file reloading or changing in the any way.
There are a couple of Julia IDEs. However, it is important that this works in the Julia interpreter (creating several files as you suggested or displaying images as R or Python do using a backend) and in IJulia as inline images.
@goedman That's how the resulting plot should look like. Is it possible to automate that for all simulations? By the way, it takes a while to draw the plots even after loading Gadfly (~50 seconds in my machine.) Are you experiencing the same slowness? This only happens the first time.
This discussion is a bit broader than Mamba and I am not a frequent iJulia user, but when needed, I have used something like:
## Plot results
myplot = plot(sim[:,1:3,:], legend=true)
draw(myplot, nrow=3, ncol=2)
and:
myplot2 = [plot(sim[:,1:3,:], :autocor), plot(sim[:,1:3,:], :mean, legend=true)];
draw(myplot2, nrow=2, ncol=3)
to get inline images. Certainly not fully automated. In the Seeds case dropping the [:,1:3,;] selectors would show 5 rows/columns and the figures become pretty small. The same is true for the generated .svg files.
The first time Gadfly is used I also see 'JIT@work', but after that it is pretty snappy.
This is a good discussion to have, and I agree with Rob that it is broader than Mamba. Nevertheless, graphical displays are a very important part of Bayesian analysis in general and MCMC in particular. I would certainly like for plot management to be better in Mamba.
A short-term solution is probably in order, and I am open to suggestions. There are some good one already in this thread. Feel free to speak up as the spirit moves you. Personally, I am not all that interested in pursuing IDE-specific solutions. IDEs come and go, and are often moving targets. They take development time to keep up with, which is time I would rather spend on core MCMC functionality.
A longer-term solution that I have been thinking about is having a stand-alone (IDE-independent) graphics window applet to which Gadfly plots could be sent. The applet would accept multiple plots, and allow a user to navigate through, print, and save them. See the plot tab in RStudio for example. I don't know how much work this would be, but the Tk package and others that Tim Holy has written would certainly help. This seems like an obvious solution that julia needs in general. I wonder if someone else is working on or done it already???
@brian-j-smith it seems like several users are using iJulia, and having a separate display pop up for graphics would not jive well with that. I think it would be an interesting side option to have, but definitely should not be necessary to view plots.
I think a good fix in the meantime would be to draw plots to separate files rather than onto the same files.
PS: Also I was totally wrong about Tk package being ready for Travis testing, but I did get a spirited conversation started about moving towards that direction.
I can’t test it on other platforms (I’m on OSX), but shouldn’t (in a vanilla Julia session):
using Gadfly plot(x=1:10, y = rand(10))
plot(x=1:100, y = rand(100)
show the plots in a new tab in the default browser (Safari, Chrome, Firefox, Internet Explorer) or inline in IJulia (each plot() in a separate IJulia cell)?
Having separate tabs in a browser is a great advantage for quick comparisons.
Steven Johnson posted another interesting hint this morning:
julia> isdefined(Main, :IJulia) && Main.IJulia.inited
if special provisions are needed inside IJulia.
For more advanced use or documenting results for later comparisons, creating separate files is a good way to go as Benjamin suggests (and I often use).
Having contributed to R.app and helped out John Fox with supporting Rcmdr on OSX, the issue will be to support a separate display tool on _many_ platforms. I’m not yet convinced we would do better than the browsers and IJulia (love the scrolling option in IJulia). On the other hand, Winston.jl has taken the separate display approach I believe.
Rob J. Goedman goedman@icloud.com
On Oct 22, 2014, at 9:39 AM, Benjamin Deonovic notifications@github.com wrote:
@brian-j-smith https://github.com/brian-j-smith it does seem like several users are using iJulia, and having a separate display pop up for graphics would not jive well with that. I think it would be an interesting side option to have, but definitely should not be necessary to view plots.
I think a good fix in the meantime would be to draw plots to separate files rather than onto the same files.
— Reply to this email directly or view it on GitHub https://github.com/brian-j-smith/Mamba.jl/issues/9#issuecomment-60114983.
@goedman Unfortunately, this code:
using Gadfly
plot(x=1:10, y = rand(10))
plot(x=1:100, y = rand(100)
doesn't output both plots and doesn't create new tabs either. It only outputs the last plot, in this case, plot(x=1:100, y = rand(100)
.
I think a good compromise is to create separate files when working in the Julia interpreter (REPL) and creating a grid in Gadfly when working in IJulia as goedman described before:
using Gadfly
set_default_plot_size(20cm, 16cm)
p1 = plot(x=1:10, y = rand(10))
p2 = plot(x=1:100, y = rand(100))
vstack(p1, p2)
Since Mamba outputs traces and densities by default, there is certainty that we only need 2 columns and as many rows as there are nodes to be plotted.
By the way, maybe some optimization is needed on the d3 that is generated by plot()
or draw()
in IJulia. It feels a bit laggy. Furthermore, I couldn't right click in the image and select "save as" as I usually do in Ipython.
In this case I’ve inserted some responses below.
Regards, Rob
On Oct 22, 2014, at 12:32 PM, rsmith31415 notifications@github.com wrote:
@goedman https://github.com/goedman Unfortunately, this code:
using Gadfly plot(x=1:10, y = rand(10))
plot(x=1:100, y = rand(100) doesn't output both plots and doesn't create new tabs either. It only outputs the last plot, in this case, plot(x=1:100, y = rand(100).
Are you running this in IJulia?
show the plots in a new tab in the default browser (Safari, Chrome, Firefox, Internet Explorer) or inline in IJulia (each plot() in a separate IJulia cell)?
Tabs would only show up in the REPL. In IJulia the 2 plot() commands have to be in separate IJulia cells. But your suggestion below is perfectly fine as well (if not better!).
I think a good compromise is to create separate files when working in the Julia interpreter (REPL) and creating a grid in Gadfly when working in IJulia as goedman described before:
using Gadfly set_default_plot_size(20cm, 16cm)
p1 = plot(x=1:10, y = rand(10)) p2 = plot(x=1:100, y = rand(100))
vstack(p1, p2) https://cloud.githubusercontent.com/assets/599274/4742483/654cf6fc-5a1f-11e4-80f2-fa7404d8abe3.png Since Mamba outputs traces and densities by default, there is certainty that we only need 2 columns and as many rows as there are nodes to be plotted.
Agreed, but if there are too many nodes, figures get very small. I’m not sure if specifying the default_plot_size height fixes this. By the way, maybe some optimization is needed on the d3 that is generated by plot() or draw() in IJulia. It feels a bit laggy. Furthermore, I couldn't right click in the image and select "save as" as I usually do in Ipython.
— Reply to this email directly or view it on GitHub https://github.com/brian-j-smith/Mamba.jl/issues/9#issuecomment-60141665.
@goedman
Are you running this in IJulia?
Yes. I was running that in IJulia. Now I understand what you meant. I think that behavior is fine but it is a bit confusing that using p = plot()
in any instance creates plots automatically (in this situation, opening tabs in the browser) instead of keeping the necessary information in the variable p
.
Agreed, but if there are too many nodes, figures get very small. I’m not sure if specifying the default_plot_size height fixes this.
You're right. It does shrink all the images to fit a given height. I'm not sure if that is due to d3 creating a SVG element with that height and width or some Ipython (Jupyter) parameter that needs to be modified. What do you think? By the way, I remember that Ipython exposes a few options to change the way output cells should be displayed, but I can't find any of them in the IJulia namespace.
@rsmith31415
On Oct 22, 2014, at 3:00 PM, rsmith31415 notifications@github.com wrote:
@goedman https://github.com/goedman Are you running this in IJulia?
Yes. I was running that in IJulia. Now I understand what you meant. I think that behavior is fine but it is a bit confusing that using p = plot() in any instance creates plots automatically (in this situation, opening tabs in the browser) instead of keeping the necessary information in the variable p.
You can suppress that by adding a ; at the end of the line: p = plot();
Agreed, but if there are too many nodes, figures get very small. I’m not sure if specifying the default_plot_size height fixes this.
You're right. It does shrink all the images to fit a given height. I'm not sure if that is due to d3 creating a SVG element with that height and width or some Ipython (Jupyter) parameter that needs to be modified. What do you think? By the way, I remember that Ipython exposes a few options to change the way output cells should be displayed, but I can't find any of them in the IJulia namespace.
I will be of very limited help here as I don’t use IJulia often enough but maybe on the IJulia issues list? — Reply to this email directly or view it on GitHub https://github.com/brian-j-smith/Mamba.jl/issues/9#issuecomment-60162779.
For some reason not exactly clear to me, draw is not executing subsequent writes to the (same) external file, as @rsmith31415 noted. It used to be working - don't know what changed. I'll fix that soon and have multiple writes go to different file names to kill two birds with one stone.
You can suppress that by adding a ; at the end of the line: p = plot();
Thanks. That works. I'm getting used to the fact that Julia outputs the last line of everything.
I noticed that this issue is fixable in the Julia interpreter by changing manually the dimensions of the image:
julia> draw(SVG("/home/user/Desktop/image.svg", 6inch, 5inch),
vstack(hstack(p1,p2), hstack(p1,p2), hstack(p1,p2)))
And fortunately a workaround is possible in IJulia:
using Gadfly
p1 = plot(x=1:10, y = rand(10))
p2 = plot(x=1:100, y = rand(100))
p3 = vstack(hstack(p1,p2), hstack(p1,p2), hstack(p1,p2), hstack(p1,p2), hstack(p1,p2))
draw(SVG(8inch, 14inch), p3)
No need to suppress the output this time. However, the issue of selecting appropriate dimensions remains. That's what Mamba should do automatically.
@rsmith31415 ,
Executing
(nsamples, nnodes, nchains) = size(sim)
immediately gives you the number of samples, the number of nodes and the number of chains. The other consideration is the sequence of plotting the nodes, e.g. variables first, then variances, etc. Thus I would have a slight preference to keep the plotting part under my control and do it along the lines discussed in this thread.
@goedman Do you mean writing several files as @brian-j-smith indicated when working in the Julia interpreter and using vstack
and hstack
to create inline images in IJulia?
A fix for draw and an extension to allow automatic outputting of plots to multiple files is now in the development branch, and will be in the next version. The draw documentation has also been updated with a description of the added capability.
@brian-j-smith I tested it in the seeds example with the following command
draw(p, filename="/home/user/Desktop/summaryplot")
and for some reason, it creates 3 files: summaryplot.svg, summaryplot-1.svg and summaryplot-2.svg. However, the first and third plot are exactly the same. I also noticed that I can't put a dot in the file name to select another format without falling back to the original behavior of replacing the file after pressing enter.
Shouldn't it be better to output different files regardless of whether the file name contains a dot or not?
The code you posted correctly produces two files (summaryplot-1.svg and summaryplot-2.svg) for me with the seeds example. Maybe summaryplot.svg is coming from another call you made to draw. Delete all .svg files, make sure you only have the one call to draw, and try again.
The functionality is described in the (develop branch) documentation. Leave the file extension off the name to get the automatic behavior. Otherwise, when the full file name is specified, I assume that is what the user wants to call the file and do not make changes to it. In such a case, the user should be prompted before advancing to the next plot so that the file can be viewed before being overwritten.
@brian-j-smith You're absolutely correct. I'm not sure what was happening because I tried it a couple of times and I saw 3 files being created by the line I posted earlier. However, now everything works as you described in the documentation.
I understand the logic of creating different files vs replacing a single file, but I'm wondering if users are going to be confused by different behaviors depending on something as subtle as the extension.
By the way, what if I want to obtain several .png files without replacing the previous plot? Right now, it default to replacing previous plots because a dot is being used in the file name to describe the extension:
julia> draw(p, filename="/home/user/Desktop/summaryplot.png")
Press ENTER to draw next plot
Argument fmt
of the draw function determines the output file type. The default type is svg (fmt = :svg
). Thus, unless otherwise specified, svg is the type of file that will be produced. Your code produces an svg file called summaryplot.png. Probably not what you intended. The automated and manual methods for saving to a png file are, respectively,
draw(p, filename="/home/user/Desktop/summaryplot", fmt=:png)
and
draw(p, filename="/home/user/Desktop/summaryplot.png", fmt=:png)
On my system, by appending below code to seeds.jl, the seeds_summaryplot-1.svg and seeds_summaryplot-2.svg files are correctly created.
The seeds_autocormeanplot-1.svg file shows up as seeds_autocormeanplot-1.svg-1.svg and similarly seeds_autocormeanplot-2.svg file shows up as seeds_autocormeanplot-2.svg-1.svg.
myplot5 = plot(sim, legend=true);
draw(myplot5, filename="seeds_summaryplot")
myplot6 = [plot(sim[:, 1:3,:], :autocor) plot(sim[:, 1:3,:], :mean, legend=true)];
draw(myplot6, nrow=2, ncol=3, filename="seeds_autocormeanplot-1.svg")
myplot7 = [plot(sim[:, 4:5,:], :autocor) plot(sim[:, 4:5,:], :mean, legend=true)];
draw(myplot7, nrow=2, ncol=2, filename="seeds_autocormeanplot-2.svg")
Note: Tried twice to respond via email, but that didn't seem to work.
@brian-j-smith Correct. Now I'm getting the desired behavior. I still think it is a bit confusing for new users, but if you think the benefits of having an IDE taking advantage of this feature are greater than the occasional confusion, that's okay.
@rsmith31415 I didn't reply yet on your vstack/hstack question. Once the vanilla plot functions work it shouldn't be too hard to develop a wrapper method to use from inside IJulia based on a test if IJulia is active..
I'm not 100% convinced the updates in the develop branch are better because in my example from 12 hours ago :autocross and :mean are now above one another while previously they showed up side by side. But I'm sure I can work around that.
@brian-j-smith If I made a PR to update plot() to accept a union type for ptype consisting of a single Symbol or an array of Symbols, would you be ok with that? As an example, one could then call:
plot(sim, [:autocor, :mean])
@goedman Sounds good.
Regarding your example using :autocross and :mean, specifically in myplot6
, you're forcing a 2X3 grid, but you need a 3X2 grid to place autocorrelations and means sharing the same row. However, that's not the whole solution because it produces this:
You need to transpose your initial array (julia> p = [plot(sim[:, 1:3, :], :autocor) plot(sim[:, 1:3,:], :mean, legend=true)].';
) in order to obtain:
You can omit nrow
and ncol
, if you want. However, I can't figure out what is the logic that draw
is using because sometimes the resulting plot keeps the dimensions of p
but in other instances, the dimensions are transposed. So it is confusing. Even the tutorial is transposing p
to obtain the usually desired plot.
Note that draw
has a parameter byrow
which specifies whether the plots should be filled in by row or by column. By default byrow is set to true. See the documentation:
http://mambajl.readthedocs.org/en/latest/mcmc/chains.html#draw
By the way, is something like plot(sim[:, 1:2,:], :autocor)
documented? I don't remember reading about it.
The definition of plot
in the documentation is plot(c::Chains, ptype::Symbol=:summary; args...)
. If sim[:,1:2,:]
is a valid Chains
object then the plot will work. This is really more of a question of how does julia as a language work rather than anything specific about how Mamba deals with things.
Oh, now I see what is going on. draw
takes p's columns and orders them by rows or columns. I was thinking that plot
was keeping the same structure of p
.
Thank you for the explanation of plot(c::Chains, ptype::Symbol=:summary; args...)
I will take a look at the documentation again.
Thanks Benjamin, what threw me off are the defaults for nrow and ncol. In the case of seeds.jl, with 5 nodes, for the 2nd autocor+mean plot I need to set nrow to 2, thus overriding the default of nrow=3.
for i in 1:2
isfile("seeds_summaryplot-$(i).svg") && rm("seeds_summaryplot-$(i).svg")
isfile("seeds_autocormeanplot-$(i).svg") && rm("seeds_autocormeanplot-$(i).svg")
end
myplot5 = plot(sim, legend=true);
draw(myplot5, filename="seeds_summaryplot")
for i in 1:2
isfile("seeds_summaryplot-$(i).svg") &&
run(`open -a "Google Chrome.app" "seeds_summaryplot-$(i).svg"`)
end
myplot6 = [plot(sim[:, 1:3,:], :autocor) plot(sim[:, 1:3,:], :mean, legend=true)];
draw(myplot6, filename="seeds_autocormeanplot-1.svg", byrow=false)
myplot7 = [plot(sim[:, 4:5,:], :autocor) plot(sim[:, 4:5,:], :mean, legend=true)];
draw(myplot7, nrow=2, filename="seeds_autocormeanplot-2.svg", byrow=false)
for i in 1:2
isfile("seeds_autocormeanplot-$(i).svg") &&
run(`open -a "Google Chrome.app" "seeds_autocormeanplot-$(i).svg"`)
end
I prefer how it is handled 'by default' for :summary, so will have a go at allowing ptype to be an array (of length 2 or 3?) of Symbols.
@goedman Not sure if I understood your question correctly, but if you want different types of plots next to each other (similar to the ptype
summary feature, which has density and trace plots next to each other) you can simply do
## Autocorrelation and running mean plots
p = [plot(sim1, :autocor) plot(sim1, :mean, legend=true)].'
draw(p, nrow=3, ncol=2, filename="autocormeanplot.svg")
For an example look at
http://mambajl.readthedocs.org/en/latest/tutorial.html#plotting
@bdeonovic You're quite right! For more than 3 nodes I'll use:
myplot2 = [plot(sim, :autocor) plot(sim, :mean, legend=true)].';
draw(myplot2, filename="seeds_autocormeanplot")
for i in 1:2
isfile("seeds_autocormeanplot-$(i).svg") &&
run(`open -a "Google Chrome.app" "seeds_autocormeanplot-$(i).svg"`)
end
Thank you.
The Chains plot method has been updated in the develop branch to allow the ptype
argument to be specified as a vector with an arbitrary number and combination of plot types. Accompanying develop documentation can be viewed at http://mambajl.readthedocs.org/en/develop/.
@brian-j-smith This works great! By default it produces a similar results as above lines of code, based on Benjamin's suggestion, but it feels much more Julia-ish and more consistent.
for i in 1:2
isfile("seeds_summary-$(i).svg") && rm("seeds_summary-$(i).svg")
isfile("seeds_autocormean-$(i).svg") && rm("seeds_autocormean-$(i).svg")
isfile("seeds_meanautocordensity-$(i).svg") && rm("seeds_meanautocordensity-$(i).svg")
end
myplot1 = plot(sim, legend=true);
draw(myplot1, filename="seeds_summary")
for i in 1:2
isfile("seeds_summary-$(i).svg") &&
run(`open -a "Google Chrome.app" "seeds_summary-$(i).svg"`)
end
myplot2 = plot(sim, [:mean, :autocor], legend=true);
draw(myplot2, filename="seeds_autocormean")
for i in 1:2
isfile("seeds_autocormean-$(i).svg") &&
run(`open -a "Google Chrome.app" "seeds_autocormean-$(i).svg"`)
end
myplot3 = plot(sim, [:mean, :autocor, :density], legend=true);
draw(myplot3, ncol=3, filename="seeds_meanautocordensity")
for i in 1:2
isfile("seeds_meanautocordensity-$(i).svg") &&
run(`open -a "Google Chrome.app" "seeds_meanautocordensity-$(i).svg"`)
end
As far as I'm concerned I'm ready to apply all of this to Jags.jl and Stan.jl!
I believe the major changes suggested here have been incorporated.
Hi Brian,
Not sure if this is of interest to you or if maybe you’ve already seen it.
Regards, Rob J. Goedman goedman@icloud.com
Begin forwarded message:
Date: November 4, 2014 at 7:01:44 AM PST From: Theodore Papamarkou notifications@github.com Reply-To: "JuliaStats/MCMC.jl" reply@reply.github.com To: "JuliaStats/MCMC.jl" MCMC.jl@noreply.github.com Cc: Rob J Goedman goedman@mac.com Subject: [MCMC.jl] e-meetup tomorrow? (#73)
Hi Julians,
As you may have seen, the package has gone through a (semi-complete) major upgrade. I am currently documenting the package so that users can catch up with the changes. This will take me a few more days, as I am writing up bits of doc sections daily whenever I can squeeze some time in my timetable.
In the meantime, we have been thinking how we could possibly amplify the range of models accommodated by the package. For this reason, I would like to invite those of you interested in MCMC to catch up on Google Hangout. @spencerlyon2 https://github.com/spencerlyon2 and I are going to have a chat tomorrow at 11:00am New York time (3:00pm London time). Please feel free to drop in if interested in participating. My hope is that we can make these e-meetings more regular, meeting once per forthnight or month to discuss progress. I will set up a new repo to upload miniutes, possibly under JuliaStats.
I have made some thoughts on how factor graphs could be possibly used for MCMC model specification, see issue #72 https://github.com/JuliaStats/MCMC.jl/issues/72 . Nevertheless, tomorrow's chat will be focused mostly on Gibbs sampling. @spencerlyon2 https://github.com/spencerlyon2 will explain how he has coded Gibbs to fit the existing state of MCMC.jl. I think it would be good we understand how he set up the updating mechanism and get his code merged soon so that the relevant functionality is available. We can return to the more general issue of model specification later.
If you have any other MCMC issues that you would like to discuss in future e-meetings, you can mention them tomorrow.
@fredo-dedup https://github.com/fredo-dedup @spencerlyon2 https://github.com/spencerlyon2 @goedman https://github.com/goedman @johnmyleswhite https://github.com/johnmyleswhite @lindahua https://github.com/lindahua @dmbates https://github.com/dmbates @StefanKarpinski https://github.com/StefanKarpinski (please forward this to people I may have missed out)
— Reply to this email directly or view it on GitHub https://github.com/JuliaStats/MCMC.jl/issues/73.
Rob -- Thanks for forwarding the email. I wasn’t aware of it. I am in meetings for most of the morning tomorrow, but would otherwise be interested in participating in the future. That is a really talented group of people that would be nice to interact with.
From: Rob J Goedman [mailto:notifications@github.com] Sent: Tuesday, November 04, 2014 10:04 AM To: brian-j-smith/Mamba.jl Cc: Smith, Brian J Subject: Re: [Mamba.jl] "Press ENTER to draw next plot" message (#9)
Hi Brian,
Not sure if this is of interest to you or if maybe you’ve already seen it.
Regards, Rob J. Goedman goedman@icloud.commailto:goedman@icloud.com
Begin forwarded message:
Date: November 4, 2014 at 7:01:44 AM PST From: Theodore Papamarkou notifications@github.com<mailto:notifications@github.com> Reply-To: "JuliaStats/MCMC.jl" reply@reply.github.com<mailto:reply@reply.github.com> To: "JuliaStats/MCMC.jl" MCMC.jl@noreply.github.com<mailto:MCMC.jl@noreply.github.com> Cc: Rob J Goedman goedman@mac.com<mailto:goedman@mac.com> Subject: [MCMC.jl] e-meetup tomorrow? (#73)
Hi Julians,
As you may have seen, the package has gone through a (semi-complete) major upgrade. I am currently documenting the package so that users can catch up with the changes. This will take me a few more days, as I am writing up bits of doc sections daily whenever I can squeeze some time in my timetable.
In the meantime, we have been thinking how we could possibly amplify the range of models accommodated by the package. For this reason, I would like to invite those of you interested in MCMC to catch up on Google Hangout. @spencerlyon2 https://github.com/spencerlyon2 and I are going to have a chat tomorrow at 11:00am New York time (3:00pm London time). Please feel free to drop in if interested in participating. My hope is that we can make these e-meetings more regular, meeting once per forthnight or month to discuss progress. I will set up a new repo to upload miniutes, possibly under JuliaStats.
I have made some thoughts on how factor graphs could be possibly used for MCMC model specification, see issue #72 https://github.com/JuliaStats/MCMC.jl/issues/72 . Nevertheless, tomorrow's chat will be focused mostly on Gibbs sampling. @spencerlyon2 https://github.com/spencerlyon2 will explain how he has coded Gibbs to fit the existing state of MCMC.jl. I think it would be good we understand how he set up the updating mechanism and get his code merged soon so that the relevant functionality is available. We can return to the more general issue of model specification later.
If you have any other MCMC issues that you would like to discuss in future e-meetings, you can mention them tomorrow.
@fredo-dedup https://github.com/fredo-dedup @spencerlyon2 https://github.com/spencerlyon2 @goedman https://github.com/goedman @johnmyleswhite https://github.com/johnmyleswhite @lindahua https://github.com/lindahua @dmbates https://github.com/dmbates @StefanKarpinski https://github.com/StefanKarpinski (please forward this to people I may have missed out)
— Reply to this email directly or view it on GitHub https://github.com/JuliaStats/MCMC.jl/issues/73.
— Reply to this email directly or view it on GitHubhttps://github.com/brian-j-smith/Mamba.jl/issues/9#issuecomment-61662951.
I asked Theodore ( @scidom ) to add you to his list of invitees. The meeting looks like will take place somewhere next week, too short notice.
It would be nice if Julia gets a broad, layered MCMC toolset where over time we can improve on aspects like sampler interchangeability, learn from each other how to improve performance in Julia, blocking choice strategies for model parameters, common backend tools, etc.
v0.3.8 works fine!
Rob J. Goedman goedman@icloud.com
On Nov 4, 2014, at 1:11 PM, Brian J Smith notifications@github.com wrote:
Rob -- Thanks for forwarding the email. I wasn’t aware of it. I am in meetings for most of the morning tomorrow, but would otherwise be interested in participating in the future. That is a really talented group of people that would be nice to interact with.
From: Rob J Goedman [mailto:notifications@github.com] Sent: Tuesday, November 04, 2014 10:04 AM To: brian-j-smith/Mamba.jl Cc: Smith, Brian J Subject: Re: [Mamba.jl] "Press ENTER to draw next plot" message (#9)
Hi Brian,
Not sure if this is of interest to you or if maybe you’ve already seen it.
Regards, Rob J. Goedman goedman@icloud.commailto:goedman@icloud.com
Begin forwarded message:
Date: November 4, 2014 at 7:01:44 AM PST From: Theodore Papamarkou notifications@github.com<mailto:notifications@github.com> Reply-To: "JuliaStats/MCMC.jl" reply@reply.github.com<mailto:reply@reply.github.com> To: "JuliaStats/MCMC.jl" MCMC.jl@noreply.github.com<mailto:MCMC.jl@noreply.github.com> Cc: Rob J Goedman goedman@mac.com<mailto:goedman@mac.com> Subject: [MCMC.jl] e-meetup tomorrow? (#73)
Hi Julians,
As you may have seen, the package has gone through a (semi-complete) major upgrade. I am currently documenting the package so that users can catch up with the changes. This will take me a few more days, as I am writing up bits of doc sections daily whenever I can squeeze some time in my timetable.
In the meantime, we have been thinking how we could possibly amplify the range of models accommodated by the package. For this reason, I would like to invite those of you interested in MCMC to catch up on Google Hangout. @spencerlyon2 https://github.com/spencerlyon2 and I are going to have a chat tomorrow at 11:00am New York time (3:00pm London time). Please feel free to drop in if interested in participating. My hope is that we can make these e-meetings more regular, meeting once per forthnight or month to discuss progress. I will set up a new repo to upload miniutes, possibly under JuliaStats.
I have made some thoughts on how factor graphs could be possibly used for MCMC model specification, see issue #72 https://github.com/JuliaStats/MCMC.jl/issues/72 . Nevertheless, tomorrow's chat will be focused mostly on Gibbs sampling. @spencerlyon2 https://github.com/spencerlyon2 will explain how he has coded Gibbs to fit the existing state of MCMC.jl. I think it would be good we understand how he set up the updating mechanism and get his code merged soon so that the relevant functionality is available. We can return to the more general issue of model specification later.
If you have any other MCMC issues that you would like to discuss in future e-meetings, you can mention them tomorrow.
@fredo-dedup https://github.com/fredo-dedup @spencerlyon2 https://github.com/spencerlyon2 @goedman https://github.com/goedman @johnmyleswhite https://github.com/johnmyleswhite @lindahua https://github.com/lindahua @dmbates https://github.com/dmbates @StefanKarpinski https://github.com/StefanKarpinski (please forward this to people I may have missed out)
— Reply to this email directly or view it on GitHub https://github.com/JuliaStats/MCMC.jl/issues/73.
— Reply to this email directly or view it on GitHubhttps://github.com/brian-j-smith/Mamba.jl/issues/9#issuecomment-61662951. — Reply to this email directly or view it on GitHub https://github.com/brian-j-smith/Mamba.jl/issues/9#issuecomment-61715111.
Hi @goedman, I haven't sent email invitations, just created a public doodle poll; @brian-j-smith here is the link to the poll:
Thanks @scidom for including me. It's great to see the continued MCMC activity.
You're welcome @brian-j-smith, looking forward to the chat. Feel free to invite anyone interested in MCMC.
I think Mamba is great, but I'm not entirely clear why this issue was closed. "Press enter" really is unacceptable behavior, in that it assumes an interactive session, and yet plot(sim) could be used in all kinds of non-interactive settings. (In fact, I ran into this issue in the quasi-interactive setting of a Juno session, where I'm executing ad-hoc subsets of a file as I write it, but I don't have any simple stdin with which to "press enter".) In that circumstance, I'd rather get an unusably-small plot or even an exception than a hung session.
...added later: after reading this thread more carefully, I suspect I may be using an out-of-date version. I'll check this again.
Hi Jameson,
Hope I'm not speaking out of turn, this is clearly Brian's call. But my $0.02.
I don't think the latest versions fundamentally change this behavior. I do know the "generating multipage graphics" feature works in the REPL, iJulia and since a few days I have also been using Mamba's back-end functions on JuliaBox (for Stan posterior processing). In all those cases, if the number of plots requested is more than nrow*ncol in the draw() call, default is nrow=3, ncol=2, it will ask to "press enter".
If Juno can't handle this kind of interactive user input, as a work around you can look at the size of the simulations output (the Chains object) and multiply the 2nd dimension of the Chains object by the number of ptypes requested (by default this is 2).
To give a concrete example, using the EightSchools example, if 'sim' is the Chains object, size(sim, 2), tells you how many (e.g. 12 in this case) variables will be plotted and below plot command requests 4 ptypes ([:trace, :mean, :density, :autocor]). Below draw command will plot 3 pages each with 16 plots each.
p = plot(sim, [:trace, :mean, :density, :autocor], legend=true);
draw(p, nrow=4, ncol=4, filename="$(stanmodel.name)-summaryplot", fmt=:svg)
At least on my system I can set nrow=12, ncol=4 and get 48 very small figures on a single page. Or:
pty = [:trace, :mean, :density, :autocor]
p = plot(sim, pty, legend=true);
draw(p, nrow=size(sim, 2), ncol=length(pty), filename="$(stanmodel.name)-summaryplot", fmt=:svg)
During interactive development, I tend to subset which variables to plot until I'm satisfied with the results and than plot all variables in multiple calls to plot() and draw().
I don't use Juno for day to day work, so as I said, just my $0.02.
It seems to be the case that plotting large models has a somewhat odd behavior. For example, plotting the results of this example outputs this:
However, I can't see the other plots. I'm not entirely sure if the same file is being replaced although I don't think so.
In more complex models, the message
Press ENTER to draw next plot
keeps showing up after pressing enter many times and I have to interrupt the operation.I'm using Julia 0.3.1 and Gadfly 0.3.9.