totalvariation.circular: Conditional total variation distance between two circular...

View source: R/totalvariation.R

totalvariation.circularR Documentation

Conditional total variation distance between two circular samples.

Description

The total variation distance between two circular samples is evaluated conditional on a circular modal region.

Usage

totalvariation.circular(x, y, z = NULL, q = 0.95, bw, adjust = 1,
type = c("K", "L"), kernel = c("vonmises", "wrappednormal"),
na.rm = FALSE, step = 0.001, eps.lower = 10^(-4), eps.upper = 10^(-4), ...)

Arguments

x

numeric or an object of class circular.

y

numeric or an object of class circular.

z

numeric or object of class circular. The grid were the kernel density estimate will be evaluated. If NULL equally spaced points in the interval [0,2*pi) with step step.

q

numeric in the interval [0,1]. The quantile of the modal region.

bw

the smoothing bandwidth to be used. When the kernel is vonmises the bandwidth is equal to the concentration parameter.

adjust

the bandwidth used is actually adjust*bw. This makes it easy to specify values like “half the default bandwidth”.

type

Not Yet Used.

kernel

a character string giving the smoothing kernel to be used. This must be one of "vonmises" or "wrappednormal", that are kernels of type "K".

na.rm

logical; if TRUE, missing values are removed from x. If FALSE any missing values cause an error.

step

numeric. Used in the construction of the regular grid z.

eps.lower,eps.upper

the cut point in the density is searched in the interval [min(density)*(1+eps.lower),max(density)*(1-eps.upper)].

...

further arguments passed to the modal.region.circular function. Not used at present.

Value

A list of class totalvariation.circular with the following components

tv

the (conditional) total variation.

ovl

the (conditional) overlapping coefficient.

q

the order of the modal regions.

bw

the bandwidth value as in input.

modal.x

an object of class modal.region.circular for the x data set.

modal.y

an object of class modal.region.circular for the y data set.

density.x

an object of class density.circular for the x data set.

density.y

an object of class density.circular for the y data set.

density

a function which report the positive part of the difference between the estimated density of the two data sets.

Author(s)

Claudio Agostinelli

References

L.G.R. Oliveira-Santos, C.A. Zucco and C. Agostinelli (2013) Using conditional circular kernel density functions to test hypotheses on animal circadian activity. Animal Behaviour, 85(1) 269-280.

See Also

modal.region.circular

Examples

x <- rvonmises(100, circular(pi), 10)
y <- rvonmises(100, circular(pi+pi/8), 10)
res <- totalvariation.circular(x,y,bw=50)
plot(res)

circular documentation built on Sept. 8, 2023, 6:03 p.m.