Generating functional dependencies

Share:

Description

Generate functional dependencies for benchmarking tests of independence. This function can generate 8 types of functional dependence: linear, quadratic, cubic, two sine functions, x^(1/4), step function and a circular dependence.

Usage

1
generate.benchmark.data(typ, noises, n, project = FALSE, windx = 1, windy = 1)

Arguments

typ

decimal, which type of dependence to generate. 1: linear 2: quadratic 3: cubic 4: sine period pi/4 5: sine period pi/16 6: x^(1/4) 7: circle 8: step function

noises

vector of noise values to apply to the generated dependence. The noise is normally distributed.

n

decimal, size of sample to return.

project

boolean (default FALSE), wether to project the generated dependence onto a torus

windx

decimal, how many times the dependence should wind around the torus in x-direction. Only used if project is TRUE

windy

decimal, how many times the dependence should wind around the torus in y-direction. Only used if project is TRUE

Value

list with two elements

x

matrix of x-coordinates, each column corresponds to a noise level from noises

y

matrix of y-coordinates, each column corresponds to a noise level from noises

Author(s)

Sebastian D├╝mcke duemcke@mpipz.mpg.de

See Also

generate.patchwork.copula for generating non-functional dependence and run.tests for benchmarking tests of independence

Examples

1
2
3
#generate a quadratic dependence of 10 points with two noise levels 0.3 and 0.6
generate.benchmark.data(2,c(.3,.6),10)
plot(generate.benchmark.data(4,.2,1000))