Skip to content

Instantly share code, notes, and snippets.

@alexchinco
Last active January 12, 2017 23:16
Show Gist options
  • Save alexchinco/f90a2ffc14fea16a4c70aca875630c30 to your computer and use it in GitHub Desktop.
Save alexchinco/f90a2ffc14fea16a4c70aca875630c30 to your computer and use it in GitHub Desktop.
Hard Thresholding is Non-Convex
var lam = 1.75;
var sigma =0.55;
var varsigma = 0.70;
var theta = 1/(1 + sigma**2);
var vartheta = 1/(1 + varsigma**2);
var MSE0 = 6;
var MSE1 = 3 * (1 - theta**2) + 3;
var MSE2 = 1 + 4 * (1 - vartheta**2) + 1;
var MSE3 = 3 + 3 * (1 - theta**2);
var MSE12 = (1-theta**2) + 2*([1-theta] - [0.5*(2-theta)*vartheta])**2 + 2*(1-vartheta**2) + 1;
var MSE13 = 3*(1-theta**2) + 3*(1-theta**2);
var MSE23 = 1 + 2*(1-vartheta**2) + 2*([1-theta] - [0.5*(2-theta)*vartheta])**2 + (1-theta**2);
var MSE123 = (1-theta**2) + 4*([1-theta] - [0.5*(2-theta)*vartheta])**2 + (1-theta**2);
var PEN0 = 0;
var PEN1 = lam;
var PEN2 = lam;
var PEN3 = lam;
var PEN12 = 2*lam;
var PEN13 = 2*lam;
var PEN23 = 2*lam;
var PEN123 = 3*lam;
var VAL13 = MSE13 + PEN13;
var VAL12 = MSE12 + PEN12;
var VAL2 = MSE2 + PEN2;
var VAL1 = MSE1 + PEN1;
var VAL123 = MSE123 + PEN123;
VAL13 < VAL12;
VAL2 < VAL1;
VAL2 < VAL12;
VAL2 < VAL123;
VAL2 < 6;
var CORR12 = Math.sqrt(theta*vartheta/3);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment