plot.tuts_poisBFS: Graphical summaries and diagnostics of tuts_BFS objects.

Description Usage Arguments Examples

View source: R/b_tupoisBFS.R

Description

plot.tuts_poisBFS(x,...) plots and diagnostics of tuts_BFS objects.

Usage

1
2
## S3 method for class 'tuts_poisBFS'
plot(x, type, ...)

Arguments

x

A tuts_BFS objects.

type

plot/disgnostic type (options: 'periodogram' plots estimates of power spectrum, 'predTUTS' plots one step predictions of the model, 'GR' plots Gelman-Rubin diagnostics, 'cv' plots 5-fold cross validation, 'mcmc' plots diagnostics of mcmc objects, and 'lambda' plots lambda realizations)

...

list of optional parameters: 'burn' (burn-in parameter ranging from 0 to 0.7 with default value set to 0), and CI (credible interval ranging from 0.3 to 1 with default value set to 0.95)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
# 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 ; y=round(y)-min(round(y))
ti.mu=DATA$observed$ti.obs.tnorm
ti.sd= rep(1, length(ti.mu))

# Run the Bayesian Frequency Selection model with cross validation of the model:
n.sim=1000
TUPOIS=tupoisbsf(y=y,ti.mu=ti.mu,ti.sd=ti.sd,freqs='internal',n.sim=n.sim,n.chains=2, CV=TRUE)

# Plots and diagnostics (optional parameters are listed in brackets):
plot(TUPOIS,type='periodogram')               # spectral analysis (CI, burn).
plot(TUPOIS,type='predTUTS', CI=0.99)         # One step predictions of the model (CI, burn).
plot(TUPOIS,type='cv')                        # 5 fold cross validation plot (CI, burn).
plot(TUPOIS,type='GR')                        # Gelman-Rubin diagnostics (CI, burn).
plot(TUPOIS,type='mcmc')                      # mcmc diagnostics.
plot(TUPOIS,type='lambda')                    # Realizaitons of lambda.

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