tv_upper_bound: Turns meeting times into upper bounds on TV to stationarity

Description Usage Arguments Value Examples

View source: R/tv_upper_bound.R

Description

Given a vector of meeting times, e.g. generated by sample_meeting_times, a choice of lag L and an iteration t, returns mean(pmax(0,ceiling((meetingtimes-L-t)/L))).

Usage

1
tv_upper_bound(meetingtimes, L, t)

Arguments

meetingtimes

vector of meeting times, such as generated by sample_meeting_times.

t

iteration at which to compute the TV upper bound.

lag

lag between the chains.

Value

A non-negative value representing an estimated upper bound between the chain at iteration t and the limiting distribution of the chain.

Examples

1
2
3
4
5
6
7
8
## Not run: 
nrep <- 100
meeting_times <- sapply(1:nrep, function(irep) sample_meeting_times(counts = c(3,2,0,1)))
tmax <- floor(max(meeting_times)*1.2)
ubounds <- sapply(1:tmax, function(t) tv_upper_bound(meeting_times, 1, t))
plot(x = 1:tmax, y = ubounds, type = 'l', xlab = "iteration", ylab = "TV upper bounds")

## End(Not run)

pierrejacob/montecarlodsm documentation built on June 16, 2021, 1:06 p.m.