Package codadiags. February 19, 2015

Similar documents
Package goftest. R topics documented: April 3, Type Package

Package dhsic. R topics documented: July 27, 2017

Package HMMcopula. December 1, 2018

STAT 425: Introduction to Bayesian Analysis

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

Package EL. February 19, 2015

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

Package darts. February 19, 2015

Package esreg. August 22, 2017

Package horseshoe. November 8, 2016

Package homtest. February 20, 2015

Package factorqr. R topics documented: February 19, 2015

Package sscor. January 28, 2016

Package HDtest. R topics documented: September 13, Type Package

Package mcmcse. July 4, 2017

Package RTransferEntropy

Package EWGoF. October 5, 2017

Package AID. R topics documented: November 10, Type Package Title Box-Cox Power Transformation Version 2.3 Date Depends R (>= 2.15.

Package depth.plot. December 20, 2015

Package ICBayes. September 24, 2017

Package ARCensReg. September 11, 2016

Package BayesNI. February 19, 2015

Package RcppSMC. March 18, 2018

Package CCP. R topics documented: December 17, Type Package. Title Significance Tests for Canonical Correlation Analysis (CCA) Version 0.

Package TSF. July 15, 2017

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

Package LIStest. February 19, 2015

Package FDRSeg. September 20, 2017

Package CPE. R topics documented: February 19, 2015

Package RATest. November 30, Type Package Title Randomization Tests

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

0.1 poisson.bayes: Bayesian Poisson Regression

Package clogitboost. R topics documented: December 21, 2015

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

Package ppcc. June 28, 2017

Package rnmf. February 20, 2015

Package Grace. R topics documented: April 9, Type Package

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

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

Package noncompliance

Package polypoly. R topics documented: May 27, 2017

Package locfdr. July 15, Index 5

Package tspi. August 7, 2017

Package CopulaRegression

Package ssanv. June 23, 2015

Package hwwntest. R topics documented: August 3, Type Package Title Tests of White Noise using Wavelets Version 1.3.

Package unbalhaar. February 20, 2015

Package SpatialNP. June 5, 2018

Package generalhoslem

0.1 normal.bayes: Bayesian Normal Linear Regression

Package MicroMacroMultilevel

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

Package RI2by2. October 21, 2016

Package cccrm. July 8, 2015

Package eel. September 1, 2015

Package bmem. February 15, 2013

Package spatial.gev.bma

Package sbgcop. May 29, 2018

Lecture 2: CDF and EDF

Package IndepTest. August 23, 2018

Package effectfusion

Package BNN. February 2, 2018

Package gma. September 19, 2017

Package BayesS5. February 24, 2017

Package idmtpreg. February 27, 2018

Package CompQuadForm

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

Package TwoStepCLogit

Package TimeSeries.OBeu

Package PVR. February 15, 2013

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

Bayesian model selection in graphs by using BDgraph package

Package spcov. R topics documented: February 20, 2015

Package scio. February 20, 2015

Package multdm. May 18, 2018

Package pearson7. June 22, 2016

Package invgamma. May 7, 2017

Package rbvs. R topics documented: August 29, Type Package Title Ranking-Based Variable Selection Version 1.0.

Package jaccard. R topics documented: June 14, Type Package

Package basad. November 20, 2017

0.1 factor.ord: Ordinal Data Factor Analysis

Package MultisiteMediation

Package rgabriel. February 20, 2015

Package R1magic. April 9, 2013

Package ForwardSearch

Package SimSCRPiecewise

Package NonpModelCheck

Package WaveletArima

Package jmuoutlier. February 17, 2017

Package nardl. R topics documented: May 7, Type Package

Package RootsExtremaInflections

Package esaddle. R topics documented: January 9, 2017

Some Statistical Inferences For Two Frequency Distributions Arising In Bioinformatics

Package plspolychaos

Package R1magic. August 29, 2016

ST 740: Markov Chain Monte Carlo

Package vhica. April 5, 2016

Package covsep. May 6, 2018

Package ltsbase. R topics documented: February 20, 2015

Package flexcwm. R topics documented: July 11, Type Package. Title Flexible Cluster-Weighted Modeling. Version 1.0.

Transcription:

Type Package Package codadiags February 19, 2015 Title Markov chain Monte Carlo burn-in based on ``bridge'' statistics Version 1.0 Date 2013-09-17 Author Yann Richet, Xavier Bay, Olivier Jacquet, Aleis Jinaphanh Maintainer Yann Richet <yann.richet@irsn.fr> Markov chain Monte Carlo burn-in based on ``bridge'' statistics, in the way of coda::heidel.diag, but including non asymptotic tabulated statistics. License GPL-3 Depends R (>= 3.0.0), coda LazyData no NeedsCompilation yes Repository CRAN Date/Publication 2013-11-18 10:28:00 R topics documented: codadiags-package..................................... 2 ad.cdf............................................ 2 add.transient......................................... 3 AR1............................................. 4 autocorr1.......................................... 5 bay.cdf............................................ 5 bridgestat.diag........................................ 6 brownianbridge....................................... 7 cvm.cdf........................................... 7 ks.cdf............................................ 8 loglikbridge......................................... 9 mainv.bay.cdf....................................... 9 null.lim.cdf......................................... 10 null.param.cdf........................................ 10 studentbridge........................................ 11 transient.test......................................... 11 1

2 ad.cdf Inde 13 codadiags-package Markov chain Monte Carlo burn-in based on "bridge" statistics. Details This package implements many burn-in procedures based on iterative transient statistic tests. The tests are calibrated on simple AR1 MCMC process, tuned on particle simulation Monte Carlo codes. It should be viewed as a non asymptotic declination of heidel.diag burnin from coda package. Package: codadiags Type: Package Version: 1.0 Date: 2013-09-17 License: GPL-3 Depends: coda Author(s) Yann Richet, Xavier Bay, Olivier Jacquet, Aleis Jinaphanh Maintainer: Yann Richet <yann.richet@irsn.fr> References Y. Richet, PhD: "Suppression of the initial transient in Monte Carlo criticality simulations", University of St Etienne, France, 2009. set.seed(123) = AR1() print(bridgestat.diag()) y = add.transient() print(bridgestat.diag(y,trunc=10)) ad.cdf Anderson-Darling cumulative density function, copy from ADGofTest package.

add.transient 3 Anderson-Darling cumulative density function, copy from ADGofTest package. ad.cdf(, n = 1000) n value to test sample size for Anderson-Darling statistic Author(s) Carlos J. Gil Bellosta References G. and J. Marsaglia, "Evaluating the Anderson-Darling Distribution", Journal of Statistical Software, 2004 plot(null.lim.cdf("loglik_mean.brownianbridge",forceuseecdf=true),col= blue,lim=c(-4,0)) plot(vectorize(function()1-ad.cdf(-)),col= green,add=true,lim=c(-4,0)) add.transient Add a transient to a given mcmc sequence Add a transient to a given mcmc sequence add.transient(x, a = 100, b = a + 100, step = -1) X a b step sequence to add the transient on last iteration of the constant transient part last iteratio of the transient transient step

4 AR1 = AR1() plot(,type= l,col=rgb(.5,0,0,.5)) y = add.transient() lines(y,col=rgb(0,0,0.5,.5)) transient.test() transient.test(y) AR1 Generate auto-regressive order 1 sequence Generate auto-regressive order 1 sequence AR1(length = 1000, mean = 0, sd = 1, rho = 0.1, rand = function() { rnorm(1) }) length mean sd rho rand size of the sequence mean value of the sequence standard deviation of the sequence auto-correlation factor function to generate one random step µ σ Value Auto Regressive ("AR") sequence X = µ { n } 1 n N, 1 = σ u 1 / 1 ρ 2, n = ρ n 1 + σ u n = AR1() plot(,type= l,col=rgb(.5,0,0,.5))

autocorr1 5 autocorr1 Basic auto-correlation estimation of a given sequence Basic auto-correlation estimation of a given sequence autocorr1(x) X sequence Value first auto-correlation coefficient bay.cdf Bay cumulative density function, corresponding to -B(t+)/B(t-), where B(t+) (resp. B(t-)) is the maimum (resp.minimum) of B(t)/(t*(1-t)). Bay cumulative density function, corresponding to -B(t+)/B(t-), where B(t+) (resp. B(t-)) is the maimum (resp.minimum) of B(t)/(t*(1-t)). bay.cdf() value to test Author(s) X. Bay

6 bridgestat.diag bridgestat.diag Iterative truncation procedure based on a bridge statistic. Iterative truncation procedure based on a bridge statistic. bridgestat.diag(, bridge = "student", stat = "E", param = "asymptotic", trunc = 1, eps = 0.1, pvalue = 0.3) bridge stat param trunc eps pvalue coda::mcmc sequence (will be cast to if necessary) to truncate transient bridge type to use: "brownian", student" or "loglik" statistic to use for testing bridge: - if student bridge, "E","var","autocov","loglik_mean","loglik_etremum - if brownian bridge, "E","var","autocov","loglik_mean","loglik_etremum","etremum","ratio_etremum - if loglik bridge, "E","var","autocov","etremum","ratio_etremum" if "asymptotic" use asymptotic statistics, else if a list of N and rho use these parameters, if NULL estimate N and rho number of mcmc iterations to delete: if >=1, it is a constant number, if <1, a percentage of remaining batches Target value for ratio of halfwidth to sample mean (for compatibility with heidel.diag) significance level to use in iterative test References Heidelberger P and Welch PD. Simulation run length control in the presence of an initial transient. Opns Res., 31, 1109-44 (1983) See Also coda::heidel.diag set.seed(123) = AR1() print(bridgestat.diag()) y = add.transient() print(bridgestat.diag(y,trunc=10))

brownianbridge 7 brownianbridge Compute the so called (abusively) "Brownian bridge" process. Compute the so called (abusively) "Brownian bridge" process. brownianbridge(x) X MCMC sampling sequence of length N Value cumulative normalized sum sequence: B = {b n } 0 n N, b n = n (ˆµ 1,n ˆµ 1,N ) ˆσ (N) = AR1(rho=0) bb = brownianbridge() plot(bb,type= l,col= red ) cvm.cdf Cramer von Mises cumulative density function, import from coda package. Cramer von Mises cumulative density function, import from coda package. cvm.cdf() value to test

8 ks.cdf References Csorgo S. and Faraway, JJ. The eact and asymptotic distributions of the Cramer-von Mises statistic. J. Roy. Stat. Soc. (B), 58, 221-234 (1996). See Also coda::pcramer plot(null.lim.cdf("var.brownianbridge",forceuseecdf=true),col= blue ) plot(vectorize(cvm.cdf),col= green,add=true) ks.cdf Kolmogorov-Smirnov cumulative density function, copy from stats::ks.test. Kolmogorov-Smirnov cumulative density function, copy from stats::ks.test. ks.cdf(, n = 100) n value to test sample size for Kolmogorov-Smirnov statistic References George Marsaglia, Wai Wan Tsang and Jingbo Wang (2003), Evaluating Kolmogorov s distribution. Journal of Statistical Software, 8/18. http://www.jstatsoft.org/v08/i18/. See Also package stats, ks.c plot(null.lim.cdf("etremum.brownianbridge",forceuseecdf=true),col= blue,lim=c(0.01,4)) plot(vectorize(ks.cdf),col= green,add=true,lim=c(0.01,4))

loglikbridge 9 loglikbridge Compute the so called "Log-likelihood bridge" process. Compute the so called "Log-likelihood bridge" process. loglikbridge(x) X MCMC sampling sequence of length N Value log-likelihood sequence LL = {ll n } 2 n N 2, ll n = N ln(ˆσ 2 1,N ) n ln(ˆσ 2 1,n) (N n)ln(ˆσ 2 n+1,n ) = AR1(rho=0) llb = loglikbridge() plot(llb,type= l,col= red ) mainv.bay.cdf CDF of ma(,1/) (=cdf()-cdf(1)+cdf(1)-cdf(1/)) where is Bay distributed CDF of ma(,1/) (=cdf()-cdf(1)+cdf(1)-cdf(1/)) where is Bay distributed mainv.bay.cdf() value to test plot(null.lim.cdf("ratio_etremum.brownianbridge",forceuseecdf=true),col= blue,lim=c(0,10)) plot(vectorize(mainv.bay.cdf),col= green,add=true,lim=c(0,10))

10 null.param.cdf null.lim.cdf Asymptotic CDF for a given statistic Asymptotic CDF for a given statistic null.lim.cdf(stat, forceuseecdf = FALSE) stat forceuseecdf statistic if true, - if stat is loglik_mean.brownianbridge, use the Anderson-Darling CDF #NO - if stat is var.brownianbridge, use the Cramer von Mises CDF - if stat is etremum.brownianbridge, use the Kolmogorov-Smirnov CDF #NO - if stat is ratio_loglik_etremum.brownianbridge, use the chi-square (3 freedom degrees) CDF - if stat is ratio_etremum.brownianbridge, use the Bay CDF else, use tabulated empirical CDF built on white noise process (length 10000) null.param.cdf Build the null CDF (cumulative density function) for a given statistic, for arbitrary length and autocorrelation sequence. Build the null CDF (cumulative density function) for a given statistic, for arbitrary length and autocorrelation sequence. null.param.cdf(stat, N, rho) stat N rho statistic used length of the target sequence to be tested autocorrelation (1st coeff) of the target sequence to test

studentbridge 11 studentbridge Compute the so called "Student bridge" process. Compute the so called "Student bridge" process. studentbridge(x) X MCMC sampling sequence of length N Value Student bridge sequence: S = {s n } 1 n N 1, s n = n (ˆµ 1,n ˆµ n+1,n ) N 2 ( ) 1 n + 1 N n ((n 1) σ 1,n ˆ 2 2 + (N n 1) σ n+1,n ˆ = AR1(rho=0) sb = studentbridge() plot(sb,type= l,col= blue ) transient.test Perform a stationary test to check for an initial burn-in in a sequence Perform a stationary test to check for an initial burn-in in a sequence transient.test(, bridge = studentbridge, stat = E.studentbridge, param = NULL, plot = FALSE)

12 transient.test bridge stat param plot sequence bridge builder function statistic of the bridge to use in the test sequence parameters: length N and first auto-correlation coefficient rho, or "asymptotic" for default asymptotic parameters, or NULL for auto estimated parameters boolean to ask for test plots Value A list with class "htest" containing the following components: statistic: the value of the test statistic. p.value: the p-value of the test. method: a character string indicating what type of test was performed. data.name: character string giving the name(s) of the data.

Inde Topic Monte Carlo, initial transient, Brownian bridge, criticality, neutronics codadiags-package, 2 ad.cdf, 2 add.transient, 3 AR1, 4 autocorr1, 5 bay.cdf, 5 bridgestat.diag, 6 brownianbridge, 7 codadiags (codadiags-package), 2 codadiags-package, 2 cvm.cdf, 7 ks.cdf, 8 loglikbridge, 9 mainv.bay.cdf, 9 null.lim.cdf, 10 null.param.cdf, 10 studentbridge, 11 transient.test, 11 13