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_analysis
from locore.operators import finite_diff_1d

Dimension of the problem


In [2]:
n = 100

Denoising setting


In [3]:
A = np.eye(n)

First order dictionary (TV)


In [4]:
D = finite_diff_1d(n)

Generate a test vector


In [5]:
x = np.ones((n,1))
x[n//2:n//2+10] = 2

Compute IC


In [6]:
crit_l1_analysis(D, A, x)


Out[6]:
(0.97999999999999987,
 array([[-0.02 ],
       [-0.04 ],
       [-0.06 ],
       [-0.08 ],
       [-0.1  ],
       [-0.12 ],
       [-0.14 ],
       [-0.16 ],
       [-0.18 ],
       [-0.2  ],
       [-0.22 ],
       [-0.24 ],
       [-0.26 ],
       [-0.28 ],
       [-0.3  ],
       [-0.32 ],
       [-0.34 ],
       [-0.36 ],
       [-0.38 ],
       [-0.4  ],
       [-0.42 ],
       [-0.44 ],
       [-0.46 ],
       [-0.48 ],
       [-0.5  ],
       [-0.52 ],
       [-0.54 ],
       [-0.56 ],
       [-0.58 ],
       [-0.6  ],
       [-0.62 ],
       [-0.64 ],
       [-0.66 ],
       [-0.68 ],
       [-0.7  ],
       [-0.72 ],
       [-0.74 ],
       [-0.76 ],
       [-0.78 ],
       [-0.8  ],
       [-0.82 ],
       [-0.84 ],
       [-0.86 ],
       [-0.88 ],
       [-0.9  ],
       [-0.92 ],
       [-0.94 ],
       [-0.96 ],
       [-0.98 ],
       [-0.8  ],
       [-0.6  ],
       [-0.4  ],
       [-0.2  ],
       [ 0.   ],
       [ 0.2  ],
       [ 0.4  ],
       [ 0.6  ],
       [ 0.8  ],
       [ 0.975],
       [ 0.95 ],
       [ 0.925],
       [ 0.9  ],
       [ 0.875],
       [ 0.85 ],
       [ 0.825],
       [ 0.8  ],
       [ 0.775],
       [ 0.75 ],
       [ 0.725],
       [ 0.7  ],
       [ 0.675],
       [ 0.65 ],
       [ 0.625],
       [ 0.6  ],
       [ 0.575],
       [ 0.55 ],
       [ 0.525],
       [ 0.5  ],
       [ 0.475],
       [ 0.45 ],
       [ 0.425],
       [ 0.4  ],
       [ 0.375],
       [ 0.35 ],
       [ 0.325],
       [ 0.3  ],
       [ 0.275],
       [ 0.25 ],
       [ 0.225],
       [ 0.2  ],
       [ 0.175],
       [ 0.15 ],
       [ 0.125],
       [ 0.1  ],
       [ 0.075],
       [ 0.05 ],
       [ 0.025]]))