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

Module l1mu_l2_tvmu

source code

Created on Fri Sep 27 14:47:48 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, mu, snr=None, shape=None)
Returns data generated such that we know the exact solution.
source code
 
_generate(l, k, g, beta, M, e, mu, shape) source code
Variables [hide private]
  __package__ = 'parsimony.datasets.simulate'
Function Details [hide private]

load(l, k, g, beta, M, e, mu, snr=None, shape=None)

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 total variation function, i.e.:

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

where L1mu is the smoothed L1 norm, |.|² is the squared L2 norm and TVmu is
the smoothed 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.

mu : The Nesterov smoothing regularisation parameter.

snr : Signal-to-noise ratio between model and residual.

shape : The underlying dimension of the regression vector, beta. E.g. the
        beta may represent an underlying 3D image. In that case the shape
        is a three-tuple with dimensions (Z, Y, X). If shape is not
        provided, the shape is set to (p,) where p is the dimension of
        beta.

Returns
-------
X : The generated X matrix.

y : The generated y vector.

beta : The regression vector with the correct snr.