feasible_overlap: Find Smallest Feasible Ellipse Overlap

Description Usage Arguments Details Value See Also Examples

View source: R/feasible_overlap.R

Description

feasible_overlap will find the smallest radius such that the ellipses have a non-empty intersection.

Usage

1

Arguments

ell

a list of at least two (non degenerate) ellipses; see wrangle_ellipse.

...

additional arguments to be passed to internal functions.

Details

Given a list of ellipses ell the function feasible_overlap will find the smallest radius such that the ellipses from ell overlap. This is done by solving the following quadratically constrained problem

    &nbsp &nbsp min(x,s) &nbsp s
s.t. (x - ci)T Pi (x - ci) - ri ≤ s  &nbsp for all i = 1, ..., d

To solve this convex problem the logarithmic barrier method is used.

Note that it is not necessary to specify ellipse radii in ell.

Value

feasible_overlap returns an object of class "feasible_overlap". This object is a list with the following entries:

radii

the smallest ellipse radii resulting in a non-empty intersection.

x

The limiting common point.

distance

The ellipse specific distances.

call

The matched call.

See Also

wrangle_ellipse for detailed on ellipse parameterization.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
## two dimensional ellipses
e1 <- list("c" = c(1,1), "P" = matrix(c(2,0,0,0.5), ncol = 2))
e2 <- list("c" = c(0,0), "S" = matrix(c(1, 0.2, 0.2, 2), ncol = 2), "r" = 1)
# note: it is not necessary to specify an ellipse radius "r"

feasible_overlap(list(e1, e2))


## regression example
# generate data
n <- 100
E <- rbinom(n, 1, 0.5)
X <- rnorm(n, E * 3, 1)
Y <- rnorm(n, 2 + 1.5 * X, 1)

# create confidence region ellipses
m0 <- lm(Y ~ X, data = data.frame(Y, X), subset = (E == 0))
m1 <- lm(Y ~ X, data = data.frame(Y, X), subset = (E == 1))
ConfRegion0 <- list(c = coefficients(m0), S = vcov(m0))
ConfRegion1 <- list(c = coefficients(m0), S = vcov(m0))

# find smallest radius
res <- feasible_overlap(list(ConfRegion0, ConfRegion1))
# this radius now corresponds to the chisq quantile at which
# the confidence regions intersect non-emptily.
# In other words the (1 - alpha)-confidence intervals intersect for alpha:
alpha <- pchisq(res$radii, 2)

fellov documentation built on Feb. 21, 2020, 5:07 p.m.