load(l,
k,
g,
beta,
M,
e,
A,
snr=None,
intercept=False)
| source code
|
Returns data generated such that we know the exact solution.
The data generated by this function is fit to the Linear regression + L1 +
L2 + Total variation function, i.e. to:
f(b) = (1 / 2).|Xb - y|² + l.|b|_1 + (k / 2).|b|² + g.TV(b),
where |.|_1 is the L1 norm, |.|² is the squared L2 norm and TV is the
total variation penalty.
Parameters
----------
l : The L1 regularisation parameter.
k : The L2 regularisation parameter.
g : The total variation regularisation parameter.
beta : The regression vector to generate data from.
M : The matrix to use when building data. This matrix carries the desired
correlation structure of the generated data. The generated data
will be a column-scaled version of this matrix.
e : The error vector e = Xb - y. This vector carries the desired
distribution of the residual.
A : The linear operator for the Nesterov function.
snr : Signal-to-noise ratio between model and residual.
intercept : Boolean. Whether or not to include an intercept variable. This
variable is not penalised. Note that if intercept is True, then e
will be centred.
Returns
-------
X : The generated X matrix.
y : The generated y vector.
beta : The regression vector with the correct snr.
|