mgc.sims.step: Step Function Simulation

Description Usage Arguments Value Details Author(s) Examples

View source: R/simulations.R

Description

A function for Generating a step function simulation.

Usage

1
mgc.sims.step(n, d, eps = 1, ind = FALSE, a = -1, b = 1)

Arguments

n

the number of samples for the simulation.

d

the number of dimensions for the simulation setting.

eps

the noise level for the simulation. Defaults to 1.

ind

whether to sample x and y independently. Defaults to FALSE.

a

the lower limit for the data matrix. Defaults to -1.

b

the upper limit for the data matrix. Defaults to -1.

Value

a list containing the following:

X

[n, d] the data matrix with n samples in d dimensions.

Y

[n] the response array.

Details

Given: w[i] = 1/i is a weight-vector that scales with the dimensionality. Simulates n points from Step-Function(X, Y) where:

X ~ U(a, b)^d

,

Y = I{w^TX > 0} + K*eps*N(0, 1)

and K = 1 if d=1, and 0 otherwise controls the noise for higher dimensions.

For more details see the help vignette: vignette("sims", package = "mgc")

Author(s)

Eric Bridgeford

Examples

1
2
3
library(mgc)
result  <- mgc.sims.step(n=100, d=10)  # simulate 100 samples in 10 dimensions
X <- result$X; Y <- result$Y

mgc documentation built on July 1, 2020, 7:09 p.m.