powered by
A function for Generating an uncorrelated bernoulli simulation.
mgc.sims.ubern(n, d, eps = 0.5, p = 0.5)
the number of samples for the simulation.
the number of dimensions for the simulation setting.
the noise level for the simulation. Defaults to 0.5.
0.5
the bernoulli probability.
a list containing the following:
X
[n, d] the data matrix with n samples in d dimensions.
[n, d]
n
d
Y
[n] the response array.
[n]
Given: \(w_i = \frac{1}{i}\) is a weight-vector that scales with the dimensionality. Simumlates \(n\) points from \(Wshape(X, Y) \in \mathbf{R}^d \times \mathbf{R}\) where: $$U \sim Bern(p)$$ $$X \sim Bern\left(p\right)^d + \epsilon N(0, I_d)$$ $$Y = (2U - 1)w^TX + \epsilon N(0, 1)$$
For more details see the help vignette: vignette("sims", package = "mgc")
vignette("sims", package = "mgc")
# NOT RUN { library(mgc) result <- mgc.sims.ubern(n=100, d=10) # simulate 100 samples in 10 dimensions X <- result$X; Y <- result$Y # }
Run the code above in your browser using DataLab