In [1]:
from __future__ import division

import numpy as np
import scipy.linalg as lin
import pylab as pl

from locore.identifiability import crit_l1_synthesis

Dimension of the problem


In [2]:
n = 100
p = n // 4

Random matrix forward operator


In [3]:
A = np.random.randn(p, n)

Generate a sparse vector


In [4]:
x = np.zeros((n,1))
x[2] = 1
x[8] = 1

Compute IC for this vector


In [5]:
crit_l1_synthesis(A, x)


Out[5]:
(0.77043373924575453,
 array([[-0.0862186 ],
       [-0.01711932],
       [ 0.00575851],
       [-0.03254814],
       [ 0.0686393 ],
       [-0.00769248],
       [-0.13616097],
       [-0.07452367],
       [-0.07769122],
       [-0.00152505],
       [-0.01228834],
       [ 0.03620595],
       [ 0.07423077],
       [ 0.08094236],
       [-0.03062557],
       [-0.0471553 ],
       [-0.02980458],
       [-0.04308071],
       [-0.00702941],
       [ 0.12854697],
       [ 0.03423215],
       [ 0.00041204],
       [-0.00293466],
       [ 0.02107606],
       [ 0.07388007]]))