Package parsimony :: Package datasets :: Package simulate :: Module l1_l2_glmu
[hide private]
[frames] | no frames]

Module l1_l2_glmu

source code

Created on Tue Jan 21 21:53:33 2014

Copyright (c) 2013-2014, CEA/DSV/I2BM/Neurospin. All rights reserved.


Author: Tommy Löfstedt

License: BSD 3-clause.

Functions [hide private]
 
load(l, k, g, beta, M, e, A, mu, snr=None, intercept=False)
Returns data generated such that we know the exact solution.
source code
 
_generate(l, k, g, beta, M, e, A, mu, intercept) source code
Variables [hide private]
  __package__ = 'parsimony.datasets.simulate'
Function Details [hide private]

load(l, k, g, beta, M, e, A, mu, 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 + Smoothed group lasso function, i.e.:

    f(b) = (1 / 2).|Xb - y|² + l.|b|_1 + (k / 2).|b|² + g.GLmu(b),

where |.|_1 is the L1 norm, |.|² is the squared L2 norm and GLmu is the
smoothed group lasso penalty.

Parameters
----------
l : Non-negative float. The L1 regularisation parameter.

k : Non-negative float. The L2 regularisation parameter.

g : Non-negative float. The group lasso regularisation parameter.

beta : Numpy array (p-by-1). The regression vector to generate data from.

M : Numpy array (n-by-p). 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 : Numpy array (n-by-1). The error vector e = Xb - y. This vector carries
        the desired distribution of the residual.

A : Numpy or (usually) scipy.sparse array (K-by-p). The linear operator
        for the Nesterov function.

mu : Non-negative float. The Nesterov smoothing regularisation parameter.

snr : Positive float. 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 : Numpy array (n-by-p). The generated X matrix.

y : Numpy array (n-by-1). The generated y vector.

beta : Numpy array (p-by-1). The regression vector with the correct snr.