View source: R/all_diagnostics.R
contour.angmcmc | R Documentation |
Contour plot for angmcmc objects with bivariate data
## S3 method for class 'angmcmc' contour( x, fn = "MAP", type = "point-est", show.data = TRUE, xpoints = seq(0, 2 * pi, length.out = 100), ypoints = seq(0, 2 * pi, length.out = 100), levels, nlevels = 20, cex = 1, col = "red", alpha = 0.4, pch = 19, ... )
x |
angular MCMC object (with bivariate data). |
fn |
function, or a single character string specifying its name, to evaluate on MCMC samples to estimate
parameters. Defaults to |
type |
Passed to d_fitted. Possible choices are "point-est" and "post-pred". |
show.data |
logical. Should the data points be added to the contour plot? Ignored if |
xpoints |
Points on the first (x-) coordinate where the density is to be evaluated. Default to seq(0, 2*pi, length.out=100). |
ypoints |
Points on the first (x-) coordinate where the density is to be evaluated. Default to seq(0, 2*pi, length.out=100). |
levels |
numeric vector of levels at which to draw contour lines; passed to the contour function in graphics. |
nlevels |
number of contour levels desired if levels is not supplied; passed to the contour function in graphics. |
cex, col, pch |
graphical parameters passed to |
alpha |
color transparency for the data points, implemented via |
... |
additional arguments to be passed to the function |
contour.angmcmc
is an S3 function for angmcmc objects that calls contour
from graphics.
To estimate the mixture density required to construct the contour plot, first the parameter vector η is estimated
by applying fn
on the MCMC samples, yielding the (consistent) Bayes estimate \hat{η}. Then the mixture density
f(x|η) at any point x is (consistently) estimated by f(x|\hat{η}).
# first fit a vmsin mixture model # illustration only - more iterations needed for convergence fit.vmsin.20 <- fit_vmsinmix(tim8, ncomp = 3, n.iter = 20, n.chains = 1) # now create a contour plot contour(fit.vmsin.20)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.