Last updated: 2019-08-16
Checks: 4 2
Knit directory: lieb/
This reproducible R Markdown analysis was created with workflowr (version 1.3.0). The Checks tab describes the reproducibility checks that were applied when the results were created. The Past versions tab lists the development history.
Great! Since the R Markdown file has been committed to the Git repository, you know the exact version of the code that produced these results.
Great job! The global environment was empty. Objects defined in the global environment can affect the analysis in your R Markdown file in unknown ways. For reproduciblity it’s best to always run the code in an empty environment.
The command set.seed(20190717)
was run prior to running the code in the R Markdown file. Setting a seed ensures that any results that rely on randomness, e.g. subsampling or permutations, are reproducible.
To ensure reproducibility of the results, delete the cache directory running_mcmc_cache
and re-run the analysis. To have workflowr automatically delete the cache directory prior to building the file, set delete_cache = TRUE
when running wflow_build()
or wflow_publish()
.
Great! You are using Git for version control. Tracking code development and connecting the code version to the results is critical for reproducibility. The version displayed above was the version of the Git repository at the time these results were generated.
Note that you need to be careful to ensure that all relevant files for the analysis have been committed to Git prior to generating the results (you can use wflow_publish
or wflow_git_commit
). workflowr only checks the R Markdown file, but you know if there are other scripts or data files that it depends on. Below is the status of the Git repository when the results were generated:
Ignored files:
Ignored: .DS_Store
Ignored: .Rhistory
Ignored: .Rproj.user/
Ignored: analysis/.DS_Store
Ignored: analysis/.Rhistory
Ignored: analysis/pairwise_fitting_cache/
Ignored: analysis/running_mcmc_cache/
Ignored: docs/.DS_Store
Ignored: output/.DS_Store
Ignored: output/vision_shiny/.DS_Store
Ignored: output/vision_shiny/.Rhistory
Ignored: output/vision_shiny/Data/.DS_Store
Untracked files:
Untracked: analysis/shiny_app.Rmd
Unstaged changes:
Modified: _workflowr.yml
Modified: analysis/index.Rmd
Note that any generated files, e.g. HTML, png, CSS, etc., are not included in this status report because it is ok for generated content to have uncommitted changes.
These are the previous versions of the R Markdown and HTML files. If you’ve configured a remote Git repository (see ?wflow_git_remote
), click on the hyperlinks in the table below to view them.
File | Version | Author | Date | Message |
---|---|---|---|---|
html | d58e1a6 | hillarykoch | 2019-08-16 | resource data |
html | 38fb1c0 | hillarykoch | 2019-08-16 | edit shiny |
html | d6d897c | hillarykoch | 2019-07-18 | reorder mcmc section |
Rmd | 330ef60 | hillarykoch | 2019-07-18 | reorder mcmc section |
html | 330ef60 | hillarykoch | 2019-07-18 | reorder mcmc section |
Rmd | a8d87b4 | hillarykoch | 2019-07-18 | updat mcmc section |
html | a8d87b4 | hillarykoch | 2019-07-18 | updat mcmc section |
Rmd | 4991356 | hillarykoch | 2019-07-18 | updat mcmc section |
html | 4991356 | hillarykoch | 2019-07-18 | updat mcmc section |
html | 228123d | hillarykoch | 2019-07-17 | update up to obtaining the hyperparameters |
html | c1dc0c1 | hillarykoch | 2019-07-17 | update up to obtaining the hyperparameters |
html | 674120c | hillarykoch | 2019-07-17 | update about page |
html | e67a3a2 | hillarykoch | 2019-07-17 | update about page |
html | 2faf446 | hillarykoch | 2019-07-17 | update about page |
html | 2177dfa | hillarykoch | 2019-07-17 | update about page |
html | 8b30694 | hillarykoch | 2019-07-17 | update about page |
html | e36b267 | hillarykoch | 2019-07-17 | update about page |
html | a991668 | hillarykoch | 2019-07-17 | update about page |
html | a36d893 | hillarykoch | 2019-07-17 | update about page |
html | e8e54b7 | hillarykoch | 2019-07-17 | update about page |
html | f47c013 | hillarykoch | 2019-07-17 | update about page |
Rmd | 50cf23e | hillarykoch | 2019-07-17 | make skeleton |
html | 50cf23e | hillarykoch | 2019-07-17 | make skeleton |
The final step of LIEB involves doing inference on the parsimonious Gaussian mixture using MCMC. MCMC is an iterative method, and thus the user needs to specify how many iterations to use. We recommend running a quick pilot analysis–say, for 10 iterations. This pilot analysis will give a good idea of how long an analysis will need to run for a given larger number of iterations (say, 20,000 iterations).
You can run an mcmc simply with the function run_mcmc()
. This function calls a script written in Julia, and executes everything at the default settings in the LIEB methodology. The user needs to provide 4 arguments:
dat
: the input data you’ve been using throughout the analysis
hyp
: the hyperparameter values estimated in the previous step
nstep
: number of MCMC iterations to run
retained_classes
: the parsimonious list of candidate latent classes, after finally filtering out by prior weights as done in the previous step
First, we load in our data, list of candidate latent classes, and estimated hyperparameters.
data("sim")
load("output/hyperparameters.Rdata")
retained_classes <- readr::read_tsv("output/retained_classes.txt", col_names = FALSE)
Now we are ready to launch an MCMC:
results <- run_mcmc(sim$data, hyp = hyp, nstep = 100, retained_classes = retained_classes)
Running the MCMC...100%|████████████████████████████████| Time: 0:00:33
The object results
contains 3 objects:
chain
: the estimate parameters over the course of nstep
iterations
acceptane_rate_chain
: an \(M\times\)nstep
matrix of the acceptance rates for each cluster covariance. The proposals for each cluster are adaptively tuned such that the acceptance rates converge to about 0.3
tune_df_chain
: the tuning degrees of freedom across the chain, adjusted to yield optimal acceptance rates
Functionality for processing the parameters estimates has not yet been introduced into LIEB.