sbd: Generates sample bivariate data.

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

Description

This function generates a sample bivariate data set.

Usage

1
sbd(func,min,max,n,Rsq)

Arguments

func

a user supplied function of one variable, y = func(x), near which data is generated.

min

min value for the domain of func

max

max value for the domain of func

n

number of sample points to generate

Rsq

coefficient of determination for the data set

Details

If func is NULL then a normal bivariate data set of n samples is generated with correlation coefficient sqrt(Rsq). If func is passed by the user then n sample points are scattered about y=func(x) with variance governed by the Rsq parameter

Value

Returns an n x 2 bivariate data set

Note

See examples below on how to set up user defined functions

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=500,Rsq=0.9)
    ma(d)$A
    plot(d)

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