pd: Plot density (after an 'ma' calculation).

Description Usage Arguments Details Value Note Author(s) References See Also Examples

Description

Optimal kernel widths output by ma are employed to recompute the weighted joint distribution for two variables in a data set, and a contour plot for this distribution is drawn.

Usage

1
pd(d,iv=1,jv=2)

Arguments

d

an n x m data frame with m > 1.

iv

the column index of the independent variable

jv

the column index of the dependent variable

Details

A data set of two variables is extracted from the user's data set and a full distribution is calculated using weighted marginal and joint likelihoods. The optimal kernel sizes and weighting are first computed via a call to ma.

Value

An n x n distribution of weighted likelihoods is returned.

Note

The data set must contain at least 2 columns.

Author(s)

Ben Murrell, Dan Murrell & Hugh Murrell.

References

Discovering general multidimensional associations, http://arxiv.org/abs/1303.1828

See Also

ma

Examples

1
2
3
4
5
6
    f <- function(x,name="Sinusoidal",def="y = 1 + sin(x)"){
      return(1 + sin(x))
    }
    d <- sbd(f,min=-2*pi,max=2*pi,n=1000,Rsq=0.9)
    ma(d)$A
    dist <- pd(d)

matie documentation built on May 2, 2019, 3:52 a.m.