Package ramcmc. May 29, 2018

Similar documents
Package ECctmc. May 1, 2018

Package diagis. January 25, 2018

Package strat. November 23, 2016

Package robustreg. R topics documented: April 27, Version Date Title Robust Regression Functions

Package intcensroc. May 2, 2018

Package validara. October 19, 2017

Package wrswor. R topics documented: February 2, Type Package

Package SEMrushR. November 3, 2018

Package spark. July 21, 2017

Package RcppProgress

Package elmnnrcpp. July 21, 2018

Package milr. June 8, 2017

Package coga. May 8, 2018

Package nmslibr. April 14, 2018

Package fastdummies. January 8, 2018

Package nngeo. September 29, 2018

Package semver. January 6, 2017

Package diffusr. May 17, 2018

Package geogrid. August 19, 2018

Package clusternomics

Package GauPro. September 11, 2017

Package triebeard. August 29, 2016

Package SimilaR. June 21, 2018

Package cattonum. R topics documented: May 2, Type Package Version Title Encode Categorical Features

Package ompr. November 18, 2017

Package jdx. R topics documented: January 9, Type Package Title 'Java' Data Exchange for 'R' and 'rjava'

Package canvasxpress

Package geojsonsf. R topics documented: January 11, Type Package Title GeoJSON to Simple Feature Converter Version 1.3.

Package WordR. September 7, 2017

Package reconstructr

Package readxl. April 18, 2017

Package inca. February 13, 2018

Package CompGLM. April 29, 2018

Package kdtools. April 26, 2018

Package fusionclust. September 19, 2017

Package deductive. June 2, 2017

Package bisect. April 16, 2018

Package matchingr. January 26, 2018

Package catenary. May 4, 2018

Package TVsMiss. April 5, 2018

Package iccbeta. January 28, 2019

Package geoops. March 19, 2018

Package benchmarkme. R topics documented: February 26, Type Package Title Crowd Sourced System Benchmarks Version 0.2.

Package vinereg. August 10, 2018

Package eply. April 6, 2018

Package bigreadr. R topics documented: August 13, Version Date Title Read Large Text Files

Package phrasemachine

Package condusco. November 8, 2017

Package UNF. June 13, 2017

Package rbgm. May 18, 2018

Package reval. May 26, 2015

Package pwrab. R topics documented: June 6, Type Package Title Power Analysis for AB Testing Version 0.1.0

Package mixsqp. November 14, 2018

Package rmumps. September 19, 2017

Package bayesdp. July 10, 2018

Package readobj. November 2, 2017

Package stapler. November 27, 2017

Package gifti. February 1, 2018

Package queuecomputer

Package modmarg. R topics documented:

Package rsppfp. November 20, 2018

Package combiter. December 4, 2017

Package clipr. June 23, 2018

Package SteinerNet. August 19, 2018

Package rucrdtw. October 13, 2017

Package farver. November 20, 2018

Package rprojroot. January 3, Title Finding Files in Project Subdirectories Version 1.3-2

Package nonnest2. January 23, 2018

Package rollply. R topics documented: August 29, Title Moving-Window Add-on for 'plyr' Version 0.5.0

Package edfreader. R topics documented: May 21, 2017

Package githubinstall

Package ADMM. May 29, 2018

Package crochet. January 8, 2018

Package rnn. R topics documented: June 21, Title Recurrent Neural Network Version 0.8.1

Package shinyhelper. June 21, 2018

Package calpassapi. August 25, 2018

Package birtr. October 4, 2017

Package ordinalclust

Package RaPKod. February 5, 2018

Package RcppArmadillo

Package KernelKnn. January 16, 2018

Package PUlasso. April 7, 2018

Package bife. May 7, 2017

Package skm. January 23, 2017

Package FSelectorRcpp

Package quadprogxt. February 4, 2018

Package ECOSolveR. February 18, 2018

Package ggimage. R topics documented: November 1, Title Use Image in 'ggplot2' Version 0.0.7

Package MTLR. March 9, 2019

Package simsurv. May 18, 2018

Package RODBCext. July 31, 2017

Package apastyle. March 29, 2017

Package balance. October 12, 2018

Package NNLM. June 18, 2018

Package knitrprogressbar

Package virustotal. May 1, 2017

Package optimization

Package CatEncoders. March 8, 2017

Package rococo. October 12, 2018

Package pdfsearch. July 10, 2018

Transcription:

Title Robust Adaptive Metropolis Algorithm Version 0.1.0-1 Date 2018-05-29 Author Jouni Helske Package ramcmc May 29, 2018 Maintainer Jouni Helske <jouni.helske@iki.fi> Function for adapting the shape of the random walk Metropolis proposal as specified by robust adaptive Metropolis algorithm by Vihola (2012) <DOI:10.1007/s11222-011-9269-5>. Package also includes fast functions for rank-one Cholesky update and downdate. These functions can be used directly from R or the corresponding C++ header files can be easily linked to other R packages. License GPL (>= 2) BugReports https://github.com/helske/ramcmc/issues Suggests testthat, knitr Imports Rcpp (>= 0.12.8) LinkingTo Rcpp, RcppArmadillo RoxygenNote 5.0.1 VignetteBuilder knitr NeedsCompilation yes Repository CRAN Date/Publication 2018-05-29 10:38:05 UTC R topics documented: adapt_s........................................... 2 chol_downdate....................................... 3 chol_update......................................... 4 Index 5 1

2 adapt_s adapt_s Update the Proposal of RAM Algorithm Given the lower triangular matrix S obtained from the Cholesky decomposition of the shape of the proposal distribution, function adapt_s updates S according to the RAM algorithm. adapt_s(s, u, current, n, target = 0.234, gamma = 2/3) S A lower triangular matrix corresponding to the Cholesky decomposition of the scale of the proposal distribution. u A vector with with length matching with the dimensions of S. current n Note The current acceptance probability. Scaling parameter corresponding to the current iteration number. target The target acceptance rate. Default is 0.234. gamma Scaling parameter. Default is 2/3. If the resulting matrix is positive definite, an updated value of S. Otherwise original S is returned. If the downdating would result non-positive definite matrix, no adaptation is performed. References Matti Vihola (2012). "Robust adaptive Metropolis algorithm with coerced acceptance rate". Statistics and Computing, 22: 997. doi:10.1007/s11222-011-9269-5 Examples # sample from standard normal distribution # use proposals from the uniform distribution on # interval (-s, s), where we adapt s adapt_mcmc <- function(n = 10000, s) { x <- numeric(n) loglik_old <- dnorm(x[1], log = TRUE) for (i in 2:n) { u <- s * runif(1, -1, 1)

chol_downdate 3 prop <- x[i] + u loglik <- dnorm(prop, log = TRUE) accept_prob <- min(1, exp(loglik - loglik_old)) if (runif(1) < accept_prob) { x[i] <- prop loglik_old <- loglik else { x[i] <- x[i - 1] # Adapt only during the burn-in if (i < n/2) { s <- adapt_s(s, u, accept_prob, i) list(x = x[(n/2):n], s = s) out <- adapt_mcmc(1e5, 2) out$s hist(out$x) # acceptance rate: 1 / mean(rle(out$x)$lengths) chol_downdate Rank-one Downdate of Cholesky Decomposition Given the lower triangular matrix L obtained from the Cholesky decomposition of A, function chol_downdate updates L such that it corresponds to the decomposition of A - u*u (if such decomposition exists). chol_downdate(l, u) L Note A lower triangular matrix. Strictly upper diagonal part is not referenced. u A vector with with length matching with the dimensions of L. Updated L. The function does not check that the resulting matrix is positive semidefinite.

4 chol_update chol_update Rank-one Update of Cholesky Decomposition Given the lower triangular matrix L obtained from the Cholesky decomposition of A, function chol_update updates L such that it corresponds to the decomposition of A + u*u. chol_update(l, u) L A lower triangular matrix. Strictly upper diagonal part is not referenced. u A vector with with length matching with the dimensions of L. Updated L. Examples L <- matrix(c(4,3,0,5), 2, 2) u <- c(1, 2) chol_update(l, u) t(chol(l %*% t(l) + u %*% t(u)))

Index adapt_s, 2 chol_downdate, 3 chol_update, 4 5