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

Module l1_l2_tv

source code

Created on Tue Jul 16 12:32:00 2013

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, snr=None, intercept=False)
Returns data generated such that we know the exact solution.
source code
 
_generate(l, k, g, beta, M, e, A, intercept) source code
Variables [hide private]
  __package__ = 'parsimony.datasets.simulate'
Function Details [hide private]

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.