time2iSample: time2iSample

Description Usage Arguments Value Author(s) See Also Examples

Description

Convert time to sample number

Usage

1
2
time2iSample(time, thin = 1, match = c(round = "round", floor = "floor", 
    ceiling = "ceiling", none = "none"))

Arguments

time

numeric: indices of the samples in recorded states

thin

integer scalar: thinning interval

match

mode of matching times between samples

round

closest sample

floor

sample before time

ceiling

sample after time

none

returns a fractional, use if you sure that time corresponds to actual sample indices

Value

index of the neares sample

Author(s)

Thomas Wutzler

See Also

iSample2time getNGen.twDEMC ,subChains.twDEMC ,twDEMCBlockInt

Examples

1
2
3
4
5
6
7
time = 0:20
structure( time2iSample(time), names=time)
structure( iSample2time(1:6, thin=4) , names=1:6 )	# to show the times corresponding to sample
structure( time2iSample(time,thin=4,match="floor"), names=time)
structure( time2iSample(time,thin=4,match="ceiling"), names=time)
structure( time2iSample(time,thin=4), names=time)	# round may vary for times exactly between two samples
structure( time2iSample(time,thin=4,match="none"), names=time)	# here we do not get indices

twDEMC documentation built on May 2, 2019, 5:38 p.m.