mgc.sims.linear {mgc} | R Documentation |
Linear Simulation
Description
A function for Generating a linear simulation.
Usage
mgc.sims.linear(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 |
ind |
whether to sample x and y independently. Defaults to |
a |
the lower limit for the range of the data matrix. Defaults to |
b |
the upper limit for the range of the data matrix. Defaults to |
Value
a list containing the following:
X |
|
Y |
|
Details
Given: w_i = \frac{1}{i}
is a weight-vector that scales with the dimensionality.
Simulates n
points from Linear(X, Y) \in \mathbf{R}^d \times \mathbf{R}
, where:
X \sim {U}(a, b)^d
Y = w^TX + \kappa \epsilon
and \kappa = 1\textrm{ if }d = 1, \textrm{ and 0 otherwise}
controls the noise for higher dimensions.
Author(s)
Eric Bridgeford
Examples
library(mgc)
result <- mgc.sims.linear(n=100, d=10) # simulate 100 samples in 10 dimensions
X <- result$X; Y <- result$Y