plotResults: Plot results from MCMC estimation

Description Usage Arguments Value See Also Examples

View source: R/plotresults.R

Description

Plot results from MCMC estimation

Usage

1
2
3
plotResults(data.df, res.df, res2.df = NULL, method, order = NULL,
  maintitle = NULL, plot.se = T, save.plot = T,
  save.file.name = "output/plots/myplot.pdf", ...)

Arguments

data.df

A data frame of t values and data values, with standard errors

res.df

A data frame of t values, estimates and uncertainty intervals

res2.df

A data frame of t values, estimates and uncertainty intervals. Default is NULL

method

Method used to fit model

order

Order of splines

maintitle

Title of plot

plot.se

Whether or not to plot standard errors

save.plot

Whether or not to save plot. Default is FALSE

save.file.name

Directory/file name where to save file

Value

A plot of time series data and estimates.

See Also

runMCMC, getResults

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
nyears <- 100
prop.sample <- 0.7
obs.err <- TRUE
sigma.y <- 0.5
seed <- 123
method <- 'splines'
params <- list(sigma.alpha = 1, order = 1)
res <- simulateFluctuations(nyears, prop.sample, method, params, obs.err, sigma.y)
res$se <- 0.1
mod <- runMCMC(input.data = res, nyears = 100, method = "splines", order = 2, nchains = 2, nburnin = 100, niter = 100+3000, nthin = 3, obs.err = TRUE)
df.mu <- getResults(mod, method = "splines", nyears = nyears)
plotResults(res, df.mu, method = "splines", order = 1, save.file.name = "test.pdf")

MJAlexander/distortr documentation built on July 17, 2020, 4:06 p.m.