tuwrap: Wrapper of models in the tuts package

Description Usage Arguments Examples

View source: R/c_additional_functions.r

Description

tuwrap=function(y,ti.mu,ti.sd,n.sim, ...) tuwrap compares results obtained from fitting multiple of time-uncertain time series models.

Usage

1
tuwrap(y, ti.mu, ti.sd, n.sim, ...)

Arguments

y

A vector of observations.

ti.mu

A vector of estimates/observed timings of observations.

ti.sd

A vector of standard deviations of timings.

n.sim

A number of simulations.

...

optional arguments. n.chains: number of MCMC chains, default is set to 2. Thin: Thinning factor, default is set to 4.m: maximum number of significant frequencies in the data, the default is set to 5. polyorder: order of the polynomial regression component, the default is set to 3. freqs: set to a positive integer k returns a vector of k equally spaced frequencies in the Nyquist range. freqs can be provided as a vector of custom frequencies of interest. Set to 'internal' generates an equally spaced vector of frequencies in the Nyquist range

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
# Import or simulate the data (simulation is chosen for illustrative purposes):
DATA=simtuts(N=50,Harmonics=c(10,30,0), sin.ampl=c(10,10, 0), cos.ampl=c(0,0,0),
trend=0,y.sd=3, ti.sd=1)
y=DATA$observed$y.obs
ti.mu=DATA$observed$ti.obs.tnorm
ti.sd= rep(1, length(ti.mu))

Run simulations:
n.sim=1000
WRAP=tuwrap(y=y,ti.mu=ti.mu,ti.sd=ti.sd,n.sim=n.sim)

Compare the models:
summary(WRAP)

# Individual summaries, plots and diagnostics:
# Note: Accessing of individual summaries, diagnostics and plots is presented in manuals of all of the funcions contained in the wrapper.SOme examples:

plot(WRAP$BFS,type='periodogram')
summary(WRAP$BFS,tCI=0.99)

PeterFranke/tuts documentation built on May 30, 2019, 6:24 a.m.