Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save alexchinco/4232ed89ffececb20d0b43b8b283e091 to your computer and use it in GitHub Desktop.
Save alexchinco/4232ed89ffececb20d0b43b8b283e091 to your computer and use it in GitHub Desktop.
Hard Thresholding is Non-Convex, Scaled
var lam = 1.75;
var stdDev1 = Math.sqrt(3 + 0.55 * Math.sqrt(3));
var sigma = 0.55/stdDev1;
var stdDev2 = Math.sqrt(4 + 0.70 * Math.sqrt(4));
var varsigma = 0.70/stdDev2;
var theta = 1/(1 + sigma**2);
var vartheta = 1/(1 + varsigma**2);
var MSE0 = 1;
var MSE1 = (1/2)*(1-theta**2) + (1/2);
var MSE2 = (1/6) + (2/3)*(1-vartheta**2) + (1/6);
var MSE3 = (1/2) + (1/2)*(1-theta**2);
var MSE12 = (1/6)*(1-theta**2) + (1/3)*([1-theta] - [0.5*(2-theta)*vartheta])**2 + (1/3)*(1-vartheta**2) + (1/6);
var MSE13 = (1/2)*(1-theta**2) + (1/2)*(1-theta**2);
var MSE23 = (1/6) + (1/3)*(1-vartheta**2) + (1/3)*([1-theta] - [0.5*(2-theta)*vartheta])**2 + (1/6)*(1-theta**2);
var MSE123 = (1/6)*(1-theta**2) + (2/3)*([1-theta] - [0.5*(2-theta)*vartheta])**2 + (1/6)*(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