import mir.test: shouldApprox; cauchyPDF(-3.0).shouldApprox == 0.03183099; cauchyPDF(-2.0).shouldApprox == 0.06366198; cauchyPDF(-1.0).shouldApprox == 0.1591549; cauchyPDF(0.0).shouldApprox == 0.3183099; cauchyPDF(1.0).shouldApprox == 0.1591549; cauchyPDF(2.0).shouldApprox == 0.06366198; cauchyPDF(3.0).shouldApprox == 0.03183099; // Can include location/scale cauchyPDF(-3.0, 1, 2).shouldApprox == 0.03183099; cauchyPDF(-2.0, 1, 2).shouldApprox == 0.04897075; cauchyPDF(-1.0, 1, 2).shouldApprox == 0.07957747; cauchyPDF(0.0, 1, 2).shouldApprox == 0.127324; cauchyPDF(1.0, 1, 2).shouldApprox == 0.1591549; cauchyPDF(2.0, 1, 2).shouldApprox == 0.127324; cauchyPDF(3.0, 1, 2).shouldApprox == 0.07957747;
Ditto, with location and scale parameters (by standardizing x).