Learn R Programming

matie (version 1.2)

pd: Plot density (after an ma calculation).

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

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

Value

An n x n distribution of weighted likelihoods is returned.

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.

References

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

See Also

ma

Examples

Run this code
    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)

Run the code above in your browser using DataLab