Package elhmc. R topics documented: July 4, Type Package

Similar documents
Package sbgcop. May 29, 2018

Package SimSCRPiecewise

Package noncompliance

Package horseshoe. November 8, 2016

Package RZigZag. April 30, 2018

Package invgamma. May 7, 2017

Package mcmcse. July 4, 2017

Package gma. September 19, 2017

Package RcppSMC. March 18, 2018

Package ARCensReg. September 11, 2016

Package scio. February 20, 2015

Package pearson7. June 22, 2016

Package esaddle. R topics documented: January 9, 2017

Package gk. R topics documented: February 4, Type Package Title g-and-k and g-and-h Distribution Functions Version 0.5.

Package denseflmm. R topics documented: March 17, 2017

Package gtheory. October 30, 2016

Package darts. February 19, 2015

Package dhsic. R topics documented: July 27, 2017

Package FDRSeg. September 20, 2017

Package TSF. July 15, 2017

Package hurdlr. R topics documented: July 2, Version 0.1

Package clogitboost. R topics documented: December 21, 2015

Package spcov. R topics documented: February 20, 2015

Package leiv. R topics documented: February 20, Version Type Package

Package BNN. February 2, 2018

The sbgcop Package. March 9, 2007

Package polypoly. R topics documented: May 27, 2017

Package CPE. R topics documented: February 19, 2015

Package ppcc. June 28, 2017

Package MPkn. May 7, 2018

Package xdcclarge. R topics documented: July 12, Type Package

Package depth.plot. December 20, 2015

Package matrixnormal

Package lmm. R topics documented: March 19, Version 0.4. Date Title Linear mixed models. Author Joseph L. Schafer

Package ShrinkCovMat

Package BGGE. August 10, 2018

Package OGI. December 20, 2017

Package RTransferEntropy

Package mpmcorrelogram

Package zic. August 22, 2017

Package codadiags. February 19, 2015

Package dina. April 26, 2017

Package basad. November 20, 2017

Package EnergyOnlineCPM

Package BayesNI. February 19, 2015

Package multivariance

Package skellam. R topics documented: December 15, Version Date

Package MultisiteMediation

Package face. January 19, 2018

Package bigtime. November 9, 2017

Package rarhsmm. March 20, 2018

Package msir. R topics documented: April 7, Type Package Version Date Title Model-Based Sliced Inverse Regression

Package HMMcopula. December 1, 2018

Package Tcomp. June 6, 2018

Package EBMAforecast

Package varband. November 7, 2016

Package MicroMacroMultilevel

Package rnmf. February 20, 2015

Package Bhat. R topics documented: February 19, Title General likelihood exploration. Version

Package FDRreg. August 29, 2016

Package TruncatedNormal

Package reinforcedpred

Package rgabriel. February 20, 2015

Package Perc. R topics documented: December 5, Type Package

Package effectfusion

Package covsep. May 6, 2018

Hamiltonian Monte Carlo

Package EMVS. April 24, 2018

Package babar. R topics documented: February 24, Type Package

Package esreg. August 22, 2017

Package JointModel. R topics documented: June 9, Title Semiparametric Joint Models for Longitudinal and Counting Processes Version 1.

Package jmcm. November 25, 2017

Package factorqr. R topics documented: February 19, 2015

Package sscor. January 28, 2016

Package My.stepwise. June 29, 2017

Package beam. May 3, 2018

Package HIMA. November 8, 2017

Package clr. December 3, 2018

Package SEMModComp. R topics documented: February 19, Type Package Title Model Comparisons for SEM Version 1.0 Date Author Roy Levy

Package SK. May 16, 2018

The panel Package. June 10, Description Functions and datasets for fitting models to Panel data. dclike.panel

Package rarpack. August 29, 2016

Package pmhtutorial. October 18, 2018

Package alabama. March 6, 2015

Package TwoStepCLogit

Package msbp. December 13, 2018

Package NonpModelCheck

Package tspi. August 7, 2017

Package bayeslm. R topics documented: June 18, Type Package

Package LIStest. February 19, 2015

Package NORMT3. February 19, 2015

Bayesian Regression Linear and Logistic Regression

STAT 518 Intro Student Presentation

Package bivariate. December 10, 2018

Package WaveletArima

Package eel. September 1, 2015

Package spatial.gev.bma

Package misctools. November 25, 2016

Package RootsExtremaInflections

The lmm Package. May 9, Description Some improved procedures for linear mixed models

Transcription:

Package elhmc July 4, 2017 Type Package Title Sampling from a Empirical Likelihood Bayesian Posterior of Parameters Using Hamiltonian Monte Carlo Version 1.1.0 Date 2017-07-03 Author Dang Trung Kien <kien.dang@nus.edu.sg>, Sanjay Chaudhuri <stasc@nus.edu.sg>, Neo Han Wei <a0086731@u.nus.edu>, Maintainer Sanjay Chaudhuri <stasc@nus.edu.sg> Description A tool to draw samples from a Empirical Likelihood Bayesian posterior of parameters using Hamiltonian Monte Carlo. Imports emplik, plyr, stats, MASS, utils License GPL-2 LazyData TRUE RoxygenNote 5.0.1 NeedsCompilation no Repository CRAN Date/Publication 2017-07-04 04:44:14 UTC R topics documented: ELHMC........................................... 2 Index 5 1

2 ELHMC ELHMC Empirical Likelihood Hamiltonian Monte Carlo Sampling Description Usage This function draws samples from a Empirical Likelihood Bayesian posterior distribution of parameters using Hamiltonian Monte Carlo. ELHMC(initial, data, fun, dfun, prior, dprior, n.samples = 100, lf.steps = 10, epsilon = 0.05, p.variance = 1, tol = 10^-5, detailed = FALSE, FUN, DFUN) Arguments initial data fun dfun prior dprior n.samples lf.steps epsilon p.variance tol detailed FUN DFUN a vector containing the initial values of the parameters a matrix containing the data the estimating function g. It takes in a parameter vector params as the first argument and a data point vector x as the second parameter. This function returns a vector. a function that calculates the gradient of the estimating function g. It takes in a parameter vector params as the first argument and a data point vector x as the second argument. This function returns a matrix. a function with one argument x that returns the prior densities of the parameters of interest a function with one argument x that returns the gradients of the log densities of the parameters of interest number of samples to draw number of leap frog steps in each Hamiltonian Monte Carlo update the leap frog step size(s). This has to be a single numeric value or a vector of the same length as initial. the covariance matrix of a multivariate normal distribution used to generate the initial values of momentum p in Hamiltonian Monte Carlo. This can also be a single numeric value or a vector. See Details. EL tolerance If this is set to TRUE, the function will return a list with extra information. the same as fun but takes in a matrix X instead of a vector x and returns a matrix so that FUN(params, X)[i, ] is the same as fun(params, X[i, ]). Only one of FUN and fun should be provided. If both are then fun is ignored. the same as dfun but takes in a matrix X instead of a vector x and returns an array so that DFUN(params, X)[,, i] is the same as dfun(params, X[i, ]). Only one of DFUN and dfun should be provided. If both are then dfun is ignored.

ELHMC 3 Details Value Suppose there are data x = (x 1, x 2,..., x n ) where x i takes values in R p and follow probability distribution F. Also, F comes from a family of distributions that depends on a parameter θ = (θ 1,..., θ d ) and there is a smooth function g(x i, θ) = (g 1 (x i, θ),..., g q (x i, θ)) T that satisfies E F [g(x i, θ)] = 0 for i = 1,..., n. ELHMC draws samples from a Empirical Likelihood Bayesian posterior distribution of the parameter θ, given the data x as data, the smoothing function g as fun, and the gradient of g as dfun or G(X) = (g(x 1 ), g(x 2 ),..., g(x n )) T as FUN and the gradient of G as DFUN. The function returns a list with the following elements: samples A matrix containing the parameter samples acceptance.rate The acceptance rate call The matched call If detailed = TRUE, the list contains these extra elements: proposed A matrix containing the proposed values at n.samaples - 1 Hamiltonian Monte Carlo updates acceptance trajectory References A vector of TRUE/FALSE values indicates whether each proposed value is accepted A list with 2 elements trajectory.q and trajectory.p. These are lists of matrices contraining position and momentum values along trajectory in each Hamiltonian Monte Carlo update. Chaudhuri, S., Mondal, D. and Yin, T. (2015) Hamiltonian Monte Carlo sampling in Bayesian empirical likelihood computation. Journal of the Royal Statistical Society: Series B. Neal, R. (2011) MCMC for using Hamiltonian dynamics. Handbook of Markov Chain Monte Carlo (eds S. Brooks, A.Gelman, G. L.Jones and X.-L. Meng), pp. 113-162. New York: Taylor and Francis. Examples ## Not run: ## Suppose there are four data points (1, 1), (1, -1), (-1, -1), (-1, 1) x = rbind(c(1, 1), c(1, -1), c(-1, -1), c(-1, 1)) ## If the parameter of interest is the mean, the smoothing function and ## its gradient would be f <- function(params, x) { x - params df <- function(params, x) { rbind(c(-1, 0), c(0, -1))

4 ELHMC ## Draw 50 samples from the Empirical Likelihood Bayesian posterior distribution ## of the mean, using initial values (0.96, 0.97) and standard normal distributions ## as priors: normal_prior <- function(x) { exp(-0.5 * x[1] ^ 2) / sqrt(2 * pi) * exp(-0.5 * x[2] ^ 2) / sqrt(2 * pi) normal_prior_log_gradient <- function(x) { -x set.seed(1234) mean.samples <- ELHMC(initial = c(0.96, 0.97), data = x, fun = f, dfun = df, n.samples = 50, prior = normal_prior, dprior = normal_prior_log_gradient) plot(mean.samples$samples, type = "l", xlab = "", ylab = "") ## End(Not run)

Index ELHMC, 2 5