If you want to play with JAGS and you don't want to install it in your computer, then Docker is the best option as I can play with the package/software and then I can delete the container.
Now you got the idea why I have chosen Docker container for this. Let's proceed to setup an environment for Monte Carlo simulation. Make sure you have got Docker installed. Follow below steps to setup the environment:
1. Open Command prompt with administrative privilege and issue follow command:
$ docker run --name mybox -t -p 8004:8004 opencpu/rstudio
Above command will download the opencpu/rstudio image locally.
2. Issue below command to start/run the container:
$ docker container start mybox
3. Open browser in your host computer and point http://localhost:8004/rstudio/ and provide opencpu as username and password like shown below:
4. Now, you need to connect to container, by issuing below command in your command prompt, to install JAGS - a tool that generate Gibbs Sampling:
$ docker exec -I -t mybox /bin/bash
You will be taken to terminal of container like shown below:
5. Issue below commands to terminal of container:
$ sudo apt-get update
$ sudo apt-get install jags
5. Now go the browser (you opened in step 3) and install "rjags" and "runjags" packages like shown below and you are done. Now you use this environment to create a simulation using Monte Carlo.
That's it so far. Stay tuned.
No comments:
Post a Comment