JuliaCloud / JuliaBox

Juliabox continues to run, but this codebase is no longer current.
http://www.juliabox.org/
Other
185 stars 50 forks source link

Request to install Stan executable for common use on JuliaBox #158

Closed goedman closed 9 years ago

goedman commented 9 years ago

As CmdStan is too big to install on a (my) private JuliaBox account I wonder if it can be made available as a 'generally useful' package. Below are the steps needed.

If this works I'll add a few examples to the Stan.jl package for specifics on JuliaBox, e.g. like producing single page graphics etc.

Regards, Rob


Installation of CmdStan 2.5.0 as decribed in cmdstan-guide-2.5.0.pdf

Prerequisites make (>=3.8.1) and g++ (>=4.2.1). JuliaBox has newer versions.

  1. Download CmdStan from https://github.com/stan-dev/cmdstan/releases

    (This file is too big for me to try it on JuliaBox.)

  2. Untar the file
  3. Change directory to the untarred file location.

    That location needs to be permanent and is needed in Stan.jl as CMDSTAN_HOME. I typically add a line to ~/.juliarc.jl or define it as an environment variable.

  4. Run 'make stan-update'
  5. make -j 4

    Or how many cores are available.

    After about 5 to 10 minutes is should say "--- CmdStan buillt ---"

  6. To test CmdStan:

    make stan/example-models/basic_estimators/bernoulli cd stan/example-models/basic_estimators/ ./bernoulli sample data file=bernoulli.data.R

  7. To test Stan.jl

    julia # Start REPL Pkg.add("Stan") Pkg.test("Stan")

tanmaykm commented 9 years ago

Sure. We shall add it with our next update in a few days. Thanks for pointing out the installation steps!

tanmaykm commented 9 years ago

The new image is not yet applied at http://juliabox.org/. Shall update with a comment here once that is done.

I had some trouble running Pkg.test("Stan") because it looks for CMDSTAN_HOME symbol to be defined in Main module. Adding the following to runtests.jl fixed that issue:

Main.CMDSTAN_HOME = ENV.get("CMDSTAN_HOME", "")

If this is correct, this may probably need to made permanent in runtests.jl.

goedman commented 9 years ago

Thank you very much Tanmay!

Yes, it is possible to set CMDSTAN_HOME in each script. I usually set it in ~/.juliarc.jl or as an environment variable.

As soon the new image is applied I will update Stan.jl accordingly. I’ll also simplify the graphics in some of the examples.

Can’t wait to try it out!

Regards, Rob J. Goedman goedman@mac.com

On Dec 8, 2014, at 9:59 PM, Tanmay Mohapatra notifications@github.com wrote:

The new image is not yet applied at http://juliabox.org/ http://juliabox.org/. Shall update with a comment here once that is done.

I had some trouble running Pkg.test("Stan") because it looks for CMDSTAN_HOME symbol to be defined in Main module. Adding the following to runtests.jl fixed that issue:

Main.CMDSTAN_HOME = ENV.get("CMDSTAN_HOME", "") If this is correct, this may probably need to made permanent in runtests.jl.

— Reply to this email directly or view it on GitHub https://github.com/JuliaLang/JuliaBox/issues/158#issuecomment-66238624.

tanmaykm commented 9 years ago

The new image is now applied on http://juliabox.org/. Please check it out.

goedman commented 9 years ago

Thank you Tanmay, in the middle of testing it! Just created the first set of plots from the Stan results.

Will make updates to Stan.jl today!

This is great. Thanks again.

Rob J. Goedman goedman@mac.com

On Dec 11, 2014, at 7:36 AM, Tanmay Mohapatra notifications@github.com wrote:

The new image is now applied on http://juliabox.org/ http://juliabox.org/. Please check it out.

— Reply to this email directly or view it on GitHub https://github.com/JuliaLang/JuliaBox/issues/158#issuecomment-66636367.

ViralBShah commented 9 years ago

@goedman It would be great if you can give us a simple intro and a showcase notebook for Stan.jl capabilities. We are figuring out how to have a set of notebooks that new users can leverage.

goedman commented 9 years ago

@ViralBShah Absolutely. Today I did spend most of my time on testing and finished with updating Stan.jl, including an initial notebook (in the Examples/Notebooks directory) that demonstrates running one of the existing examples through include(). Tomorrow I intend to add more introductory remarks and explain the flow of running an actual analysis.

ViralBShah commented 9 years ago

@tanmaykm will the update to Stan.jl automatically come in during the next update?

tanmaykm commented 9 years ago

Yes. In a day or two.

goedman commented 9 years ago

In fact Stan v"0.1.7" just got merged. It contains 3 notebooks in the Examples/Notebooks directory. The notebook I worked on today is called StanBernoulliJB.ipynb. After some intro remarks it explains and shows the flow from defining a simple model, running Stan, checking the simulation results and showing the convergence plots. Will that work?

Regards, Rob

Sent from my iPhone

On Dec 12, 2014, at 8:56 PM, Tanmay Mohapatra notifications@github.com wrote:

Yes. In a day or two.

— Reply to this email directly or view it on GitHub.

ViralBShah commented 9 years ago

@shashi Do you think we can use the Stan notebooks for our gallery?

goedman commented 9 years ago

If you would like something simpler, more comments, etc, just let me know. I am very impressed how well JuliaBox works!