Learn R Programming

matie (version 1.2)

shpd: Generates sample hyperplane data.

Description

This function generates a sample hyperplane data set.

Usage

shpd(n,m=2,Rsq=0.7,Ri=0)

Arguments

n
number of sample points to generate
m
a hyperplane of dimension m-1 will be generated in m space
Rsq
the desired coefficient of determination for the hyperplane, indicates how far data points will vary from the plane.
Ri
correlation coefficient for "independent"" variables within the hyperplane

Value

Returns a n x m data set

Details

Scatters data around the hyperplane: Vm = sum(V1...Vm-1) + noise where noise is adjusted so that the final dataset has coefficient of determination equal to Rsq. Variables V1..Vm-1 are assumed to be independent but the user can make them dependent on each other by setting the Vi parameter away from zero.

References

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

See Also

ma

Examples

Run this code
    d <- shpd(500,3,Rsq=0.8,Ri=0.01)
    ma(d)$A
    ma(d,partition=list(1,2))$A
    ma(d,partition=list(3,1))$A
    ma(d,partition=list(3,2))$A
    ma(d,partition=list(3,c(1,2)))$A
    cor(d)^2
    # if m=3 and if you have rgl 
    # you can view the data set in 3D 
    # library("rgl")  
    # plot3d(d)

Run the code above in your browser using DataLab