Learn R Programming

matie (version 1.0)

sbd: Generates Sample Bivariate Data.

Description

This function generates a sample bivariate data set.

Usage

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

Arguments

Value

Returns an n x 2 bivariate 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

References

coming soon

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

Run the code above in your browser using DataLab