Learn R Programming

matie (version 1.0)

std: Generates Sample Trivariate Data set.

Description

This function generates a sample trivariate data set.

Usage

std(func,xMin,xMax,yMin,yMax,n,Rsq)

Arguments

Value

Returns an n x 3 trivariate data set.

Details

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

References

coming soon

See Also

ma sbd

Examples

Run this code
f <- function(x,y,name="MexicanHat", def="z=(1-t^2)exp(-t^2div2), t^2=x^2+y^2"){
      t <- sqrt(x^2 + y^2)
      z <- (1.0 - t^2) * exp(- t * t / 2)
      return(z)
    }
    d <- std(f, xMin=-2, xMax=2, yMin=-2, yMax=2, n=500, Rsq=0.85)
    ma(d)$A
    # 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