maxLikOverlap {SIBER} | R Documentation |
Calculate the overlap between two ellipses based on the maximum likelihood fitted ellipses.
Description
This function uses the ML estimated means and covariances matrices of two specified groups to calculate the area of overlap.
Usage
maxLikOverlap(
ellipse1,
ellipse2,
siber.object,
p.interval = 0.95,
n = 100,
do.plot = FALSE
)
Arguments
ellipse1 |
character code of the form |
ellipse2 |
same as |
siber.object |
an object created by |
p.interval |
the prediction interval used to scale the ellipse as per
|
n |
the number of points on the edge of the ellipse used to define it.
Defaults to |
do.plot |
logical switch to determine whether the corresponding ellipses
should be plotted or not. A use-case would be in conjunction with a low
numbered |
Value
A vector comprising three columns: the area of overlap, the area of
the first ellipse and the area of the second ellipse and as many rows as
specified by draws
.
Examples
# load in the included demonstration dataset data("demo.siber.data")
siber.example <- createSiberObject(demo.siber.data)
# The first ellipse is referenced using a character string representation
# where in "x.y", "x" is the community, and "y" is the group within that
# community.
ellipse1 <- "1.2"
# Ellipse two is similarly defined: community 1, group3
ellipse2 <- "1.3"
# the overlap betweeen the corresponding 95% prediction ellipses is given by:
ellipse95.overlap <- maxLikOverlap(ellipse1, ellipse2, siber.example,
p.interval = 0.95, n = 100)