Skip to contents

This generator produces uniform noise in a d-dimensional unit (hyper) cube.

Usage

DSD_UniformNoise(d = 2, range = NULL)

Arguments

d

Determines the number of dimensions.

range

A matrix with two columns and d rows giving the minimum and maximum for each dimension. Defaults to the range of \([0,1]\).

Value

Returns a DSD_UniformNoise object.(subclass of DSD_R, DSD).

Author

Michael Hahsler

Examples

# create data stream with three clusters in 2D
stream <- DSD_UniformNoise(d = 2)
get_points(stream, n = 5)
#>          X1        X2 .class
#> 1 0.5280215 0.8774594     NA
#> 2 0.4793368 0.9341587     NA
#> 3 0.6284030 0.5649711     NA
#> 4 0.6855764 0.5701182     NA
#> 5 0.2943891 0.6111523     NA
plot(stream, n = 100)


# specify a different range for each dimension
stream <- DSD_UniformNoise(d = 3,
  range = rbind(c(0, 1), c(0, 10), c(0, 5)))
plot(stream, n = 100)