plotABC_3D: 3D ABCplots

View source: R/plotABC_3D.R

plotABC_3DR Documentation

3D ABCplots

Description

Plot posterior density distribution for each generation in 3d plot window

Usage

plotABC_3D(
  particleDataFrame,
  parameter,
  show.particles = "none",
  plot.parent = FALSE,
  realParam = FALSE,
  realParamValues = NA
)

Arguments

particleDataFrame

A particleDataFrame object, as found among the output from doRun functions.

parameter

Column number of parameter of interest from particleDataFrame.

show.particles

Option to show particles on 3d plot as "none" or as a function of "weights" or "distance".

plot.parent

Option to plot lines on the floor of the 3d plot to show particle parantage.

realParam

Option to display real parameter value as a solid line, also must give actual value for this (realParamValues). Note: this should only be done with simulated data where real param values are recorded.

realParamValues

Value for realParam.

Details

This opens a new interactive 3d plotting window and plots the posterior density distribution of accepted particles from each generation. Several options are available to add to the plot: plotting particles by weight or distance, plotting particle parantage, and plotting the real parameter values (if known).

As of version 0.6.0, rejected particles are not saved for outputting by the parallelized algorithm, and thus they are no longer displayed by this function, unlike previous versions.

Note

This function requires access to the function triangulate and the as method for class gpc.poly from package gpclib. As of 08-22-19, this package was not available from CRAN as a Windows binary, and thus this function is likely unavailable to many (if not all) Windows users.

This function also requires the package rgl, which is usually easier to obtain than package gpclib, but may not be buildable on some UNIX workstations.

Author(s)

Barb Banbury

Examples


# need to check for required suggested packages
if(requireNamespace("gpclib", quietly = TRUE) & requireNamespace("rgl", quietly = TRUE)){

 data(simRunExample)
 plotABC_3D(
     particleDataFrame = resultsBMExample[[1]]$particleDataFrame, 
     parameter = 7, 
     show.particles = "none", 
     plot.parent = FALSE, 
     realParam = FALSE, 
     realParamValues = NA
     )

}

bomeara/treevo documentation built on Aug. 19, 2023, 6:52 p.m.