knitr::opts_chunk$set(echo = TRUE) knitr::opts_knit$set(root.dir = knitr.root.directory) # showwd <- function() { # rmdwd <- getwd() # stop(sprintf("now in %s", rmdwd)) # } # showwd() # looking for relative paths in PReMiuM/rmd (location of Rmd file), not in user's working directory
diss <- lapply(premium.models, calcDissimilarityMatrix) clus <- lapply(diss, calcOptimalClustering) # choose maxClusters? prof <- lapply(clus, calcAvgRiskAndProfile)
rho_ranks <- lapply(premium.models, function(m) { tibble(var = names(m$xMat), rank = rank(summariseVarSelectRho(m)$rhoMean)) }) %>% bind_rows() %>% group_by(var) %>% summarise(rank = mean(rank)) %>% arrange(desc(rank)) (top_covariates <- rho_ranks$var[1:10]) (low_covariates <- rho_ranks$var[155:163]) do.call(getHyperparams, premium.models)
do.call(plotVarSelectRho, prof) do.call(plotClusterSizes, prof) do.call(plotSimilarityMatrix, diss)
lapply(prof, plotResponse) lapply(prof, plotCovariateProfiles, whichCovariates = top_covariates) # why warnings? lapply(prof, plotCovariateProfiles, whichCovariates = low_covariates) # using starred profile
alpha.mcmc <- do.call(codaFromPremium, c("alpha", premium.models)) summary(alpha.mcmc) plot(alpha.mcmc) par(mfrow = c(3, 1)) autocorr.plot(alpha.mcmc, auto.layout = F) gelman.plot(alpha.mcmc) nclus.mcmc <- do.call(codaFromPremium, c("nClusters", premium.models)) summary(nclus.mcmc) plot(nclus.mcmc) par(mfrow = c(3, 1)) autocorr.plot(nclus.mcmc, auto.layout = F) gelman.plot(nclus.mcmc)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.