Skip to content

Instantly share code, notes, and snippets.

@simonbyrne
Last active October 24, 2018 05:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save simonbyrne/d077ea61cd3773fa2a0849414c76215c to your computer and use it in GitHub Desktop.
Save simonbyrne/d077ea61cd3773fa2a0849414c76215c to your computer and use it in GitHub Desktop.
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"using LinearAlgebra, Printf, Statistics\n",
"using ForwardDiff"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"gmc1 (generic function with 3 methods)"
]
},
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"function gmc1(logπ, M, N, T=100, ϵ=0.01)\n",
" X = zeros(2,N)\n",
" \n",
" x = randn(2)\n",
" x ./= norm(x)\n",
" \n",
" tol = sqrt(eps())\n",
"\n",
" for n = 1:N\n",
" x0 = x\n",
" \n",
" Π = I - x*x'\n",
" A = Π * M * Π\n",
"\n",
" Λ,U = eigen(A)\n",
" Λ = [abs(λ) < tol ? 0.0 : λ for λ in Λ]\n",
" invΛ = [abs(λ) < tol ? 0.0 : 1/λ for λ in Λ]\n",
"\n",
" A⁺ = U*Diagonal(invΛ)*U'\n",
" v = U * (sqrt.(invΛ).*randn(2))\n",
"\n",
" logDetA = sum(log(λ) for λ in Λ if abs(λ) >= tol)\n",
" e = -logπ(x) + logDetA + v'*A*v/2\n",
"\n",
" for t = 1:T\n",
" # 5\n",
" v += ϵ/2 * A⁺ * ( ForwardDiff.gradient(logπ, x) - A⁺*(Π*M*x))\n",
" # 6\n",
" vv = U * Diagonal(sqrt.(Λ)) * U' * v\n",
" # 7\n",
" α = norm(vv)\n",
" nvv = vv / α \n",
" x,nvv = cos(α*ϵ)*x+sin(α*ϵ)*nvv, -sin(α*ϵ)*x+cos(α*ϵ)*nvv\n",
" vv = nvv * α\n",
"\n",
" # recompute quantities\n",
" Π = I - x*x'\n",
" A = Π * M * Π\n",
" \n",
" Λ,U = eigen(A)\n",
" Λ = [abs(λ) < tol ? 0.0 : λ for λ in Λ]\n",
" invΛ = [abs(λ) < tol ? 0.0 : 1/λ for λ in Λ]\n",
"\n",
" A⁺ = U*Diagonal(invΛ)*U'\n",
"\n",
" # 8\n",
" v = U * Diagonal(sqrt.(invΛ)) * U' * vv\n",
" # 9\n",
" v += ϵ/2 * A⁺ * ( -A⁺*(Π*M*x))\n",
" end\n",
" logDetA = sum(log(λ) for λ in Λ if abs(λ) >= tol)\n",
" ee = -logπ(x) + logDetA + v'*A*v/2\n",
" acc_prob = exp(e-ee)\n",
" #@printf \"acc prob = %.3f\\n\" min(acc_prob,1)\n",
" if !(rand() < acc_prob)\n",
" x = x0\n",
" end\n",
" X[:,n] = x\n",
" end\n",
" X \n",
"end"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"gmc2 (generic function with 3 methods)"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"function gmc2(logπ, M, N, T=100, ϵ=0.01)\n",
" X = zeros(2,N)\n",
" \n",
" x = randn(2)\n",
" x ./= norm(x)\n",
" \n",
" tol = sqrt(eps())\n",
"\n",
" for n = 1:N\n",
" x0 = x\n",
" \n",
" Π = I - x*x'\n",
" A = Π * M * Π\n",
"\n",
" Λ,U = eigen(A)\n",
" Λ = [abs(λ) < tol ? 0.0 : λ for λ in Λ]\n",
" invΛ = [abs(λ) < tol ? 0.0 : 1/λ for λ in Λ]\n",
"\n",
" A⁺ = U*Diagonal(invΛ)*U'\n",
" v = U * (sqrt.(invΛ).*randn(2))\n",
"\n",
" e = -logπ(x) + v'*A*v/2\n",
"\n",
" for t = 1:T\n",
" # 5\n",
" v += ϵ/2 * A⁺ * (ForwardDiff.gradient(logπ, x) + A⁺*(Π*M*x))\n",
" # 6\n",
" vv = U * Diagonal(sqrt.(Λ)) * U' * v\n",
" # 7\n",
" α = norm(vv)\n",
" nvv = vv / α \n",
" x,nvv = cos(α*ϵ)*x+sin(α*ϵ)*nvv, -sin(α*ϵ)*x+cos(α*ϵ)*nvv\n",
" vv = nvv * α\n",
"\n",
" # recompute quantities\n",
" Π = I - x*x'\n",
" A = Π * M * Π\n",
" \n",
" Λ,U = eigen(A)\n",
" Λ = [abs(λ) < tol ? 0.0 : λ for λ in Λ]\n",
" invΛ = [abs(λ) < tol ? 0.0 : 1/λ for λ in Λ]\n",
"\n",
" A⁺ = U*Diagonal(invΛ)*U'\n",
"\n",
" # 8\n",
" v = U * Diagonal(sqrt.(invΛ)) * U' * vv\n",
" # 9\n",
" v += ϵ/2 * A⁺ * ( +A⁺*(Π*M*x))\n",
"\n",
" end\n",
" ee = -logπ(x) + v'*A*v/2\n",
" acc_prob = exp(e-ee)\n",
" #@printf \"acc prob = %.3f\\n\" min(acc_prob,1)\n",
" if !(rand() < acc_prob)\n",
" x = x0\n",
" end\n",
" X[:,n] = x\n",
" end\n",
" X \n",
"end"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": [
"using Plots"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"data": {
"image/svg+xml": [
"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n",
"<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"600\" height=\"400\" viewBox=\"0 0 2400 1600\">\n",
"<defs>\n",
" <clipPath id=\"clip0800\">\n",
" <rect x=\"0\" y=\"0\" width=\"2000\" height=\"2000\"/>\n",
" </clipPath>\n",
"</defs>\n",
"<defs>\n",
" <clipPath id=\"clip0801\">\n",
" <rect x=\"0\" y=\"0\" width=\"2400\" height=\"1600\"/>\n",
" </clipPath>\n",
"</defs>\n",
"<polygon clip-path=\"url(#clip0801)\" points=\"\n",
"0,1600 2400,1600 2400,0 0,0 \n",
" \" fill=\"#ffffff\" fill-opacity=\"1\"/>\n",
"<defs>\n",
" <clipPath id=\"clip0802\">\n",
" <rect x=\"480\" y=\"0\" width=\"1681\" height=\"1600\"/>\n",
" </clipPath>\n",
"</defs>\n",
"<polygon clip-path=\"url(#clip0801)\" points=\"\n",
"201.538,1503.47 2321.26,1503.47 2321.26,47.2441 201.538,47.2441 \n",
" \" fill=\"#ffffff\" fill-opacity=\"1\"/>\n",
"<defs>\n",
" <clipPath id=\"clip0803\">\n",
" <rect x=\"201\" y=\"47\" width=\"2121\" height=\"1457\"/>\n",
" </clipPath>\n",
"</defs>\n",
"<polyline clip-path=\"url(#clip0803)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 360.64,1503.47 360.64,47.2441 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip0803)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 660.893,1503.47 660.893,47.2441 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip0803)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 961.146,1503.47 961.146,47.2441 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip0803)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 1261.4,1503.47 1261.4,47.2441 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip0803)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 1561.65,1503.47 1561.65,47.2441 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip0803)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 1861.9,1503.47 1861.9,47.2441 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip0803)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 2162.16,1503.47 2162.16,47.2441 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip0803)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 201.538,1462.26 2321.26,1462.26 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip0803)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 201.538,1253.79 2321.26,1253.79 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip0803)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 201.538,1045.33 2321.26,1045.33 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip0803)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 201.538,836.857 2321.26,836.857 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip0803)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 201.538,628.39 2321.26,628.39 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip0803)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 201.538,419.922 2321.26,419.922 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip0803)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 201.538,211.454 2321.26,211.454 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip0801)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 201.538,1503.47 2321.26,1503.47 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip0801)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 201.538,1503.47 201.538,47.2441 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip0801)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 360.64,1503.47 360.64,1481.63 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip0801)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 660.893,1503.47 660.893,1481.63 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip0801)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 961.146,1503.47 961.146,1481.63 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip0801)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 1261.4,1503.47 1261.4,1481.63 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip0801)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 1561.65,1503.47 1561.65,1481.63 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip0801)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 1861.9,1503.47 1861.9,1481.63 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip0801)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 2162.16,1503.47 2162.16,1481.63 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip0801)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 201.538,1462.26 233.333,1462.26 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip0801)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 201.538,1253.79 233.333,1253.79 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip0801)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 201.538,1045.33 233.333,1045.33 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip0801)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 201.538,836.857 233.333,836.857 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip0801)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 201.538,628.39 233.333,628.39 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip0801)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 201.538,419.922 233.333,419.922 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip0801)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 201.538,211.454 233.333,211.454 \n",
" \"/>\n",
"<g clip-path=\"url(#clip0801)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:middle;\" transform=\"rotate(0, 360.64, 1557.47)\" x=\"360.64\" y=\"1557.47\">-3</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip0801)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:middle;\" transform=\"rotate(0, 660.893, 1557.47)\" x=\"660.893\" y=\"1557.47\">-2</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip0801)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:middle;\" transform=\"rotate(0, 961.146, 1557.47)\" x=\"961.146\" y=\"1557.47\">-1</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip0801)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:middle;\" transform=\"rotate(0, 1261.4, 1557.47)\" x=\"1261.4\" y=\"1557.47\">0</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip0801)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:middle;\" transform=\"rotate(0, 1561.65, 1557.47)\" x=\"1561.65\" y=\"1557.47\">1</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip0801)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:middle;\" transform=\"rotate(0, 1861.9, 1557.47)\" x=\"1861.9\" y=\"1557.47\">2</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip0801)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:middle;\" transform=\"rotate(0, 2162.16, 1557.47)\" x=\"2162.16\" y=\"1557.47\">3</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip0801)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:end;\" transform=\"rotate(0, 177.538, 1479.76)\" x=\"177.538\" y=\"1479.76\">0</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip0801)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:end;\" transform=\"rotate(0, 177.538, 1271.29)\" x=\"177.538\" y=\"1271.29\">200</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip0801)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:end;\" transform=\"rotate(0, 177.538, 1062.83)\" x=\"177.538\" y=\"1062.83\">400</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip0801)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:end;\" transform=\"rotate(0, 177.538, 854.357)\" x=\"177.538\" y=\"854.357\">600</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip0801)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:end;\" transform=\"rotate(0, 177.538, 645.89)\" x=\"177.538\" y=\"645.89\">800</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip0801)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:end;\" transform=\"rotate(0, 177.538, 437.422)\" x=\"177.538\" y=\"437.422\">1000</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip0801)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:end;\" transform=\"rotate(0, 177.538, 228.954)\" x=\"177.538\" y=\"228.954\">1200</text>\n",
"</g>\n",
"<polygon clip-path=\"url(#clip0803)\" points=\"\n",
"318.126,1350.73 318.126,1462.26 417.418,1462.26 417.418,1350.73 318.126,1350.73 318.126,1350.73 \n",
" \" fill=\"#009af9\" fill-opacity=\"1\"/>\n",
"<polyline clip-path=\"url(#clip0803)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 318.126,1350.73 318.126,1462.26 417.418,1462.26 417.418,1350.73 318.126,1350.73 \n",
" \"/>\n",
"<polygon clip-path=\"url(#clip0803)\" points=\"\n",
"417.418,1347.6 417.418,1462.26 516.71,1462.26 516.71,1347.6 417.418,1347.6 417.418,1347.6 \n",
" \" fill=\"#009af9\" fill-opacity=\"1\"/>\n",
"<polyline clip-path=\"url(#clip0803)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 417.418,1347.6 417.418,1462.26 516.71,1462.26 516.71,1347.6 417.418,1347.6 \n",
" \"/>\n",
"<polygon clip-path=\"url(#clip0803)\" points=\"\n",
"516.71,1358.03 516.71,1462.26 616.002,1462.26 616.002,1358.03 516.71,1358.03 516.71,1358.03 \n",
" \" fill=\"#009af9\" fill-opacity=\"1\"/>\n",
"<polyline clip-path=\"url(#clip0803)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 516.71,1358.03 516.71,1462.26 616.002,1462.26 616.002,1358.03 516.71,1358.03 \n",
" \"/>\n",
"<polygon clip-path=\"url(#clip0803)\" points=\"\n",
"616.002,1360.11 616.002,1462.26 715.293,1462.26 715.293,1360.11 616.002,1360.11 616.002,1360.11 \n",
" \" fill=\"#009af9\" fill-opacity=\"1\"/>\n",
"<polyline clip-path=\"url(#clip0803)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 616.002,1360.11 616.002,1462.26 715.293,1462.26 715.293,1360.11 616.002,1360.11 \n",
" \"/>\n",
"<polygon clip-path=\"url(#clip0803)\" points=\"\n",
"715.293,1325.71 715.293,1462.26 814.585,1462.26 814.585,1325.71 715.293,1325.71 715.293,1325.71 \n",
" \" fill=\"#009af9\" fill-opacity=\"1\"/>\n",
"<polyline clip-path=\"url(#clip0803)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 715.293,1325.71 715.293,1462.26 814.585,1462.26 814.585,1325.71 715.293,1325.71 \n",
" \"/>\n",
"<polygon clip-path=\"url(#clip0803)\" points=\"\n",
"814.585,1280.89 814.585,1462.26 913.877,1462.26 913.877,1280.89 814.585,1280.89 814.585,1280.89 \n",
" \" fill=\"#009af9\" fill-opacity=\"1\"/>\n",
"<polyline clip-path=\"url(#clip0803)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 814.585,1280.89 814.585,1462.26 913.877,1462.26 913.877,1280.89 814.585,1280.89 \n",
" \"/>\n",
"<polygon clip-path=\"url(#clip0803)\" points=\"\n",
"913.877,1194.38 913.877,1462.26 1013.17,1462.26 1013.17,1194.38 913.877,1194.38 913.877,1194.38 \n",
" \" fill=\"#009af9\" fill-opacity=\"1\"/>\n",
"<polyline clip-path=\"url(#clip0803)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 913.877,1194.38 913.877,1462.26 1013.17,1462.26 1013.17,1194.38 913.877,1194.38 \n",
" \"/>\n",
"<polygon clip-path=\"url(#clip0803)\" points=\"\n",
"1013.17,1028.65 1013.17,1462.26 1112.46,1462.26 1112.46,1028.65 1013.17,1028.65 1013.17,1028.65 \n",
" \" fill=\"#009af9\" fill-opacity=\"1\"/>\n",
"<polyline clip-path=\"url(#clip0803)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 1013.17,1028.65 1013.17,1462.26 1112.46,1462.26 1112.46,1028.65 1013.17,1028.65 \n",
" \"/>\n",
"<polygon clip-path=\"url(#clip0803)\" points=\"\n",
"1112.46,835.815 1112.46,1462.26 1211.75,1462.26 1211.75,835.815 1112.46,835.815 1112.46,835.815 \n",
" \" fill=\"#009af9\" fill-opacity=\"1\"/>\n",
"<polyline clip-path=\"url(#clip0803)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 1112.46,835.815 1112.46,1462.26 1211.75,1462.26 1211.75,835.815 1112.46,835.815 \n",
" \"/>\n",
"<polygon clip-path=\"url(#clip0803)\" points=\"\n",
"1211.75,517.902 1211.75,1462.26 1311.04,1462.26 1311.04,517.902 1211.75,517.902 1211.75,517.902 \n",
" \" fill=\"#009af9\" fill-opacity=\"1\"/>\n",
"<polyline clip-path=\"url(#clip0803)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 1211.75,517.902 1211.75,1462.26 1311.04,1462.26 1311.04,517.902 1211.75,517.902 \n",
" \"/>\n",
"<polygon clip-path=\"url(#clip0803)\" points=\"\n",
"1311.04,196.861 1311.04,1462.26 1410.34,1462.26 1410.34,196.861 1311.04,196.861 1311.04,196.861 \n",
" \" fill=\"#009af9\" fill-opacity=\"1\"/>\n",
"<polyline clip-path=\"url(#clip0803)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 1311.04,196.861 1311.04,1462.26 1410.34,1462.26 1410.34,196.861 1311.04,196.861 \n",
" \"/>\n",
"<polygon clip-path=\"url(#clip0803)\" points=\"\n",
"1410.34,88.4582 1410.34,1462.26 1509.63,1462.26 1509.63,88.4582 1410.34,88.4582 1410.34,88.4582 \n",
" \" fill=\"#009af9\" fill-opacity=\"1\"/>\n",
"<polyline clip-path=\"url(#clip0803)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 1410.34,88.4582 1410.34,1462.26 1509.63,1462.26 1509.63,88.4582 1410.34,88.4582 \n",
" \"/>\n",
"<polygon clip-path=\"url(#clip0803)\" points=\"\n",
"1509.63,91.5852 1509.63,1462.26 1608.92,1462.26 1608.92,91.5852 1509.63,91.5852 1509.63,91.5852 \n",
" \" fill=\"#009af9\" fill-opacity=\"1\"/>\n",
"<polyline clip-path=\"url(#clip0803)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 1509.63,91.5852 1509.63,1462.26 1608.92,1462.26 1608.92,91.5852 1509.63,91.5852 \n",
" \"/>\n",
"<polygon clip-path=\"url(#clip0803)\" points=\"\n",
"1608.92,330.281 1608.92,1462.26 1708.21,1462.26 1708.21,330.281 1608.92,330.281 1608.92,330.281 \n",
" \" fill=\"#009af9\" fill-opacity=\"1\"/>\n",
"<polyline clip-path=\"url(#clip0803)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 1608.92,330.281 1608.92,1462.26 1708.21,1462.26 1708.21,330.281 1608.92,330.281 \n",
" \"/>\n",
"<polygon clip-path=\"url(#clip0803)\" points=\"\n",
"1708.21,580.442 1708.21,1462.26 1807.5,1462.26 1807.5,580.442 1708.21,580.442 1708.21,580.442 \n",
" \" fill=\"#009af9\" fill-opacity=\"1\"/>\n",
"<polyline clip-path=\"url(#clip0803)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 1708.21,580.442 1708.21,1462.26 1807.5,1462.26 1807.5,580.442 1708.21,580.442 \n",
" \"/>\n",
"<polygon clip-path=\"url(#clip0803)\" points=\"\n",
"1807.5,863.958 1807.5,1462.26 1906.8,1462.26 1906.8,863.958 1807.5,863.958 1807.5,863.958 \n",
" \" fill=\"#009af9\" fill-opacity=\"1\"/>\n",
"<polyline clip-path=\"url(#clip0803)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 1807.5,863.958 1807.5,1462.26 1906.8,1462.26 1906.8,863.958 1807.5,863.958 \n",
" \"/>\n",
"<polygon clip-path=\"url(#clip0803)\" points=\"\n",
"1906.8,1097.44 1906.8,1462.26 2006.09,1462.26 2006.09,1097.44 1906.8,1097.44 1906.8,1097.44 \n",
" \" fill=\"#009af9\" fill-opacity=\"1\"/>\n",
"<polyline clip-path=\"url(#clip0803)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 1906.8,1097.44 1906.8,1462.26 2006.09,1462.26 2006.09,1097.44 1906.8,1097.44 \n",
" \"/>\n",
"<polygon clip-path=\"url(#clip0803)\" points=\"\n",
"2006.09,1210.01 2006.09,1462.26 2105.38,1462.26 2105.38,1210.01 2006.09,1210.01 2006.09,1210.01 \n",
" \" fill=\"#009af9\" fill-opacity=\"1\"/>\n",
"<polyline clip-path=\"url(#clip0803)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 2006.09,1210.01 2006.09,1462.26 2105.38,1462.26 2105.38,1210.01 2006.09,1210.01 \n",
" \"/>\n",
"<polygon clip-path=\"url(#clip0803)\" points=\"\n",
"2105.38,1300.7 2105.38,1462.26 2204.67,1462.26 2204.67,1300.7 2105.38,1300.7 2105.38,1300.7 \n",
" \" fill=\"#009af9\" fill-opacity=\"1\"/>\n",
"<polyline clip-path=\"url(#clip0803)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 2105.38,1300.7 2105.38,1462.26 2204.67,1462.26 2204.67,1300.7 2105.38,1300.7 \n",
" \"/>\n",
"<polygon clip-path=\"url(#clip0801)\" points=\"\n",
"1958.43,251.724 2249.26,251.724 2249.26,130.764 1958.43,130.764 \n",
" \" fill=\"#ffffff\" fill-opacity=\"1\"/>\n",
"<polyline clip-path=\"url(#clip0801)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 1958.43,251.724 2249.26,251.724 2249.26,130.764 1958.43,130.764 1958.43,251.724 \n",
" \"/>\n",
"<polygon clip-path=\"url(#clip0801)\" points=\"\n",
"1982.43,215.436 2126.43,215.436 2126.43,167.052 1982.43,167.052 1982.43,215.436 \n",
" \" fill=\"#009af9\" fill-opacity=\"1\"/>\n",
"<polyline clip-path=\"url(#clip0801)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 1982.43,215.436 2126.43,215.436 2126.43,167.052 1982.43,167.052 1982.43,215.436 \n",
" \"/>\n",
"<g clip-path=\"url(#clip0801)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:start;\" transform=\"rotate(0, 2150.43, 208.744)\" x=\"2150.43\" y=\"208.744\">y1</text>\n",
"</g>\n",
"</svg>\n"
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# Algorithm 1, identity matrix\n",
"X = gmc1(x->dot(x,[1,1]), [1.0 0.0; 0.0 1.0], 10_000)\n",
"A = vec(mapslices(x -> atan(x[1],x[2]), X, dims=1))\n",
"histogram(A, nbins=range(-pi,stop=pi,length=20))"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"data": {
"image/svg+xml": [
"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n",
"<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"600\" height=\"400\" viewBox=\"0 0 2400 1600\">\n",
"<defs>\n",
" <clipPath id=\"clip1000\">\n",
" <rect x=\"0\" y=\"0\" width=\"2000\" height=\"2000\"/>\n",
" </clipPath>\n",
"</defs>\n",
"<defs>\n",
" <clipPath id=\"clip1001\">\n",
" <rect x=\"0\" y=\"0\" width=\"2400\" height=\"1600\"/>\n",
" </clipPath>\n",
"</defs>\n",
"<polygon clip-path=\"url(#clip1001)\" points=\"\n",
"0,1600 2400,1600 2400,0 0,0 \n",
" \" fill=\"#ffffff\" fill-opacity=\"1\"/>\n",
"<defs>\n",
" <clipPath id=\"clip1002\">\n",
" <rect x=\"480\" y=\"0\" width=\"1681\" height=\"1600\"/>\n",
" </clipPath>\n",
"</defs>\n",
"<polygon clip-path=\"url(#clip1001)\" points=\"\n",
"201.538,1503.47 2321.26,1503.47 2321.26,47.2441 201.538,47.2441 \n",
" \" fill=\"#ffffff\" fill-opacity=\"1\"/>\n",
"<defs>\n",
" <clipPath id=\"clip1003\">\n",
" <rect x=\"201\" y=\"47\" width=\"2121\" height=\"1457\"/>\n",
" </clipPath>\n",
"</defs>\n",
"<polyline clip-path=\"url(#clip1003)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 360.64,1503.47 360.64,47.2441 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1003)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 660.893,1503.47 660.893,47.2441 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1003)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 961.146,1503.47 961.146,47.2441 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1003)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 1261.4,1503.47 1261.4,47.2441 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1003)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 1561.65,1503.47 1561.65,47.2441 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1003)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 1861.9,1503.47 1861.9,47.2441 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1003)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 2162.16,1503.47 2162.16,47.2441 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1003)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 201.538,1462.26 2321.26,1462.26 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1003)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 201.538,1215.35 2321.26,1215.35 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1003)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 201.538,968.442 2321.26,968.442 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1003)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 201.538,721.533 2321.26,721.533 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1003)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 201.538,474.624 2321.26,474.624 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1003)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 201.538,227.715 2321.26,227.715 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1001)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 201.538,1503.47 2321.26,1503.47 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1001)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 201.538,1503.47 201.538,47.2441 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1001)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 360.64,1503.47 360.64,1481.63 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1001)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 660.893,1503.47 660.893,1481.63 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1001)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 961.146,1503.47 961.146,1481.63 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1001)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 1261.4,1503.47 1261.4,1481.63 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1001)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 1561.65,1503.47 1561.65,1481.63 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1001)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 1861.9,1503.47 1861.9,1481.63 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1001)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 2162.16,1503.47 2162.16,1481.63 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1001)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 201.538,1462.26 233.333,1462.26 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1001)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 201.538,1215.35 233.333,1215.35 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1001)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 201.538,968.442 233.333,968.442 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1001)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 201.538,721.533 233.333,721.533 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1001)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 201.538,474.624 233.333,474.624 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1001)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 201.538,227.715 233.333,227.715 \n",
" \"/>\n",
"<g clip-path=\"url(#clip1001)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:middle;\" transform=\"rotate(0, 360.64, 1557.47)\" x=\"360.64\" y=\"1557.47\">-3</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip1001)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:middle;\" transform=\"rotate(0, 660.893, 1557.47)\" x=\"660.893\" y=\"1557.47\">-2</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip1001)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:middle;\" transform=\"rotate(0, 961.146, 1557.47)\" x=\"961.146\" y=\"1557.47\">-1</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip1001)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:middle;\" transform=\"rotate(0, 1261.4, 1557.47)\" x=\"1261.4\" y=\"1557.47\">0</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip1001)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:middle;\" transform=\"rotate(0, 1561.65, 1557.47)\" x=\"1561.65\" y=\"1557.47\">1</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip1001)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:middle;\" transform=\"rotate(0, 1861.9, 1557.47)\" x=\"1861.9\" y=\"1557.47\">2</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip1001)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:middle;\" transform=\"rotate(0, 2162.16, 1557.47)\" x=\"2162.16\" y=\"1557.47\">3</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip1001)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:end;\" transform=\"rotate(0, 177.538, 1479.76)\" x=\"177.538\" y=\"1479.76\">0</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip1001)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:end;\" transform=\"rotate(0, 177.538, 1232.85)\" x=\"177.538\" y=\"1232.85\">250</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip1001)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:end;\" transform=\"rotate(0, 177.538, 985.942)\" x=\"177.538\" y=\"985.942\">500</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip1001)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:end;\" transform=\"rotate(0, 177.538, 739.033)\" x=\"177.538\" y=\"739.033\">750</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip1001)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:end;\" transform=\"rotate(0, 177.538, 492.124)\" x=\"177.538\" y=\"492.124\">1000</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip1001)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:end;\" transform=\"rotate(0, 177.538, 245.215)\" x=\"177.538\" y=\"245.215\">1250</text>\n",
"</g>\n",
"<polygon clip-path=\"url(#clip1003)\" points=\"\n",
"318.126,1363.5 318.126,1462.26 417.418,1462.26 417.418,1363.5 318.126,1363.5 318.126,1363.5 \n",
" \" fill=\"#009af9\" fill-opacity=\"1\"/>\n",
"<polyline clip-path=\"url(#clip1003)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 318.126,1363.5 318.126,1462.26 417.418,1462.26 417.418,1363.5 318.126,1363.5 \n",
" \"/>\n",
"<polygon clip-path=\"url(#clip1003)\" points=\"\n",
"417.418,1377.32 417.418,1462.26 516.71,1462.26 516.71,1377.32 417.418,1377.32 417.418,1377.32 \n",
" \" fill=\"#009af9\" fill-opacity=\"1\"/>\n",
"<polyline clip-path=\"url(#clip1003)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 417.418,1377.32 417.418,1462.26 516.71,1462.26 516.71,1377.32 417.418,1377.32 \n",
" \"/>\n",
"<polygon clip-path=\"url(#clip1003)\" points=\"\n",
"516.71,1395.1 516.71,1462.26 616.002,1462.26 616.002,1395.1 516.71,1395.1 516.71,1395.1 \n",
" \" fill=\"#009af9\" fill-opacity=\"1\"/>\n",
"<polyline clip-path=\"url(#clip1003)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 516.71,1395.1 516.71,1462.26 616.002,1462.26 616.002,1395.1 516.71,1395.1 \n",
" \"/>\n",
"<polygon clip-path=\"url(#clip1003)\" points=\"\n",
"616.002,1390.16 616.002,1462.26 715.293,1462.26 715.293,1390.16 616.002,1390.16 616.002,1390.16 \n",
" \" fill=\"#009af9\" fill-opacity=\"1\"/>\n",
"<polyline clip-path=\"url(#clip1003)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 616.002,1390.16 616.002,1462.26 715.293,1462.26 715.293,1390.16 616.002,1390.16 \n",
" \"/>\n",
"<polygon clip-path=\"url(#clip1003)\" points=\"\n",
"715.293,1367.45 715.293,1462.26 814.585,1462.26 814.585,1367.45 715.293,1367.45 715.293,1367.45 \n",
" \" fill=\"#009af9\" fill-opacity=\"1\"/>\n",
"<polyline clip-path=\"url(#clip1003)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 715.293,1367.45 715.293,1462.26 814.585,1462.26 814.585,1367.45 715.293,1367.45 \n",
" \"/>\n",
"<polygon clip-path=\"url(#clip1003)\" points=\"\n",
"814.585,1297.33 814.585,1462.26 913.877,1462.26 913.877,1297.33 814.585,1297.33 814.585,1297.33 \n",
" \" fill=\"#009af9\" fill-opacity=\"1\"/>\n",
"<polyline clip-path=\"url(#clip1003)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 814.585,1297.33 814.585,1462.26 913.877,1462.26 913.877,1297.33 814.585,1297.33 \n",
" \"/>\n",
"<polygon clip-path=\"url(#clip1003)\" points=\"\n",
"913.877,1199.55 913.877,1462.26 1013.17,1462.26 1013.17,1199.55 913.877,1199.55 913.877,1199.55 \n",
" \" fill=\"#009af9\" fill-opacity=\"1\"/>\n",
"<polyline clip-path=\"url(#clip1003)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 913.877,1199.55 913.877,1462.26 1013.17,1462.26 1013.17,1199.55 913.877,1199.55 \n",
" \"/>\n",
"<polygon clip-path=\"url(#clip1003)\" points=\"\n",
"1013.17,1035.6 1013.17,1462.26 1112.46,1462.26 1112.46,1035.6 1013.17,1035.6 1013.17,1035.6 \n",
" \" fill=\"#009af9\" fill-opacity=\"1\"/>\n",
"<polyline clip-path=\"url(#clip1003)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 1013.17,1035.6 1013.17,1462.26 1112.46,1462.26 1112.46,1035.6 1013.17,1035.6 \n",
" \"/>\n",
"<polygon clip-path=\"url(#clip1003)\" points=\"\n",
"1112.46,842.025 1112.46,1462.26 1211.75,1462.26 1211.75,842.025 1112.46,842.025 1112.46,842.025 \n",
" \" fill=\"#009af9\" fill-opacity=\"1\"/>\n",
"<polyline clip-path=\"url(#clip1003)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 1112.46,842.025 1112.46,1462.26 1211.75,1462.26 1211.75,842.025 1112.46,842.025 \n",
" \"/>\n",
"<polygon clip-path=\"url(#clip1003)\" points=\"\n",
"1211.75,570.425 1211.75,1462.26 1311.04,1462.26 1311.04,570.425 1211.75,570.425 1211.75,570.425 \n",
" \" fill=\"#009af9\" fill-opacity=\"1\"/>\n",
"<polyline clip-path=\"url(#clip1003)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 1211.75,570.425 1211.75,1462.26 1311.04,1462.26 1311.04,570.425 1211.75,570.425 \n",
" \"/>\n",
"<polygon clip-path=\"url(#clip1003)\" points=\"\n",
"1311.04,225.74 1311.04,1462.26 1410.34,1462.26 1410.34,225.74 1311.04,225.74 1311.04,225.74 \n",
" \" fill=\"#009af9\" fill-opacity=\"1\"/>\n",
"<polyline clip-path=\"url(#clip1003)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 1311.04,225.74 1311.04,1462.26 1410.34,1462.26 1410.34,225.74 1311.04,225.74 \n",
" \"/>\n",
"<polygon clip-path=\"url(#clip1003)\" points=\"\n",
"1410.34,88.4582 1410.34,1462.26 1509.63,1462.26 1509.63,88.4582 1410.34,88.4582 1410.34,88.4582 \n",
" \" fill=\"#009af9\" fill-opacity=\"1\"/>\n",
"<polyline clip-path=\"url(#clip1003)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 1410.34,88.4582 1410.34,1462.26 1509.63,1462.26 1509.63,88.4582 1410.34,88.4582 \n",
" \"/>\n",
"<polygon clip-path=\"url(#clip1003)\" points=\"\n",
"1509.63,113.149 1509.63,1462.26 1608.92,1462.26 1608.92,113.149 1509.63,113.149 1509.63,113.149 \n",
" \" fill=\"#009af9\" fill-opacity=\"1\"/>\n",
"<polyline clip-path=\"url(#clip1003)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 1509.63,113.149 1509.63,1462.26 1608.92,1462.26 1608.92,113.149 1509.63,113.149 \n",
" \"/>\n",
"<polygon clip-path=\"url(#clip1003)\" points=\"\n",
"1608.92,367.959 1608.92,1462.26 1708.21,1462.26 1708.21,367.959 1608.92,367.959 1608.92,367.959 \n",
" \" fill=\"#009af9\" fill-opacity=\"1\"/>\n",
"<polyline clip-path=\"url(#clip1003)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 1608.92,367.959 1608.92,1462.26 1708.21,1462.26 1708.21,367.959 1608.92,367.959 \n",
" \"/>\n",
"<polygon clip-path=\"url(#clip1003)\" points=\"\n",
"1708.21,662.275 1708.21,1462.26 1807.5,1462.26 1807.5,662.275 1708.21,662.275 1708.21,662.275 \n",
" \" fill=\"#009af9\" fill-opacity=\"1\"/>\n",
"<polyline clip-path=\"url(#clip1003)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 1708.21,662.275 1708.21,1462.26 1807.5,1462.26 1807.5,662.275 1708.21,662.275 \n",
" \"/>\n",
"<polygon clip-path=\"url(#clip1003)\" points=\"\n",
"1807.5,878.567 1807.5,1462.26 1906.8,1462.26 1906.8,878.567 1807.5,878.567 1807.5,878.567 \n",
" \" fill=\"#009af9\" fill-opacity=\"1\"/>\n",
"<polyline clip-path=\"url(#clip1003)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 1807.5,878.567 1807.5,1462.26 1906.8,1462.26 1906.8,878.567 1807.5,878.567 \n",
" \"/>\n",
"<polygon clip-path=\"url(#clip1003)\" points=\"\n",
"1906.8,1147.2 1906.8,1462.26 2006.09,1462.26 2006.09,1147.2 1906.8,1147.2 1906.8,1147.2 \n",
" \" fill=\"#009af9\" fill-opacity=\"1\"/>\n",
"<polyline clip-path=\"url(#clip1003)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 1906.8,1147.2 1906.8,1462.26 2006.09,1462.26 2006.09,1147.2 1906.8,1147.2 \n",
" \"/>\n",
"<polygon clip-path=\"url(#clip1003)\" points=\"\n",
"2006.09,1257.82 2006.09,1462.26 2105.38,1462.26 2105.38,1257.82 2006.09,1257.82 2006.09,1257.82 \n",
" \" fill=\"#009af9\" fill-opacity=\"1\"/>\n",
"<polyline clip-path=\"url(#clip1003)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 2006.09,1257.82 2006.09,1462.26 2105.38,1462.26 2105.38,1257.82 2006.09,1257.82 \n",
" \"/>\n",
"<polygon clip-path=\"url(#clip1003)\" points=\"\n",
"2105.38,1326.95 2105.38,1462.26 2204.67,1462.26 2204.67,1326.95 2105.38,1326.95 2105.38,1326.95 \n",
" \" fill=\"#009af9\" fill-opacity=\"1\"/>\n",
"<polyline clip-path=\"url(#clip1003)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 2105.38,1326.95 2105.38,1462.26 2204.67,1462.26 2204.67,1326.95 2105.38,1326.95 \n",
" \"/>\n",
"<polygon clip-path=\"url(#clip1001)\" points=\"\n",
"1958.43,251.724 2249.26,251.724 2249.26,130.764 1958.43,130.764 \n",
" \" fill=\"#ffffff\" fill-opacity=\"1\"/>\n",
"<polyline clip-path=\"url(#clip1001)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 1958.43,251.724 2249.26,251.724 2249.26,130.764 1958.43,130.764 1958.43,251.724 \n",
" \"/>\n",
"<polygon clip-path=\"url(#clip1001)\" points=\"\n",
"1982.43,215.436 2126.43,215.436 2126.43,167.052 1982.43,167.052 1982.43,215.436 \n",
" \" fill=\"#009af9\" fill-opacity=\"1\"/>\n",
"<polyline clip-path=\"url(#clip1001)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 1982.43,215.436 2126.43,215.436 2126.43,167.052 1982.43,167.052 1982.43,215.436 \n",
" \"/>\n",
"<g clip-path=\"url(#clip1001)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:start;\" transform=\"rotate(0, 2150.43, 208.744)\" x=\"2150.43\" y=\"208.744\">y1</text>\n",
"</g>\n",
"</svg>\n"
]
},
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# Algorithm 2, identity matrix\n",
"X = gmc2(x->dot(x,[1,1]), [1.0 0.0; 0.0 1.0], 10_000)\n",
"A = vec(mapslices(x -> atan(x[1],x[2]), X, dims=1))\n",
"histogram(A, nbins=range(-pi,stop=pi,length=20))"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"data": {
"image/svg+xml": [
"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n",
"<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"600\" height=\"400\" viewBox=\"0 0 2400 1600\">\n",
"<defs>\n",
" <clipPath id=\"clip1200\">\n",
" <rect x=\"0\" y=\"0\" width=\"2000\" height=\"2000\"/>\n",
" </clipPath>\n",
"</defs>\n",
"<defs>\n",
" <clipPath id=\"clip1201\">\n",
" <rect x=\"0\" y=\"0\" width=\"2400\" height=\"1600\"/>\n",
" </clipPath>\n",
"</defs>\n",
"<polygon clip-path=\"url(#clip1201)\" points=\"\n",
"0,1600 2400,1600 2400,0 0,0 \n",
" \" fill=\"#ffffff\" fill-opacity=\"1\"/>\n",
"<defs>\n",
" <clipPath id=\"clip1202\">\n",
" <rect x=\"480\" y=\"0\" width=\"1681\" height=\"1600\"/>\n",
" </clipPath>\n",
"</defs>\n",
"<polygon clip-path=\"url(#clip1201)\" points=\"\n",
"201.538,1503.47 2321.26,1503.47 2321.26,47.2441 201.538,47.2441 \n",
" \" fill=\"#ffffff\" fill-opacity=\"1\"/>\n",
"<defs>\n",
" <clipPath id=\"clip1203\">\n",
" <rect x=\"201\" y=\"47\" width=\"2121\" height=\"1457\"/>\n",
" </clipPath>\n",
"</defs>\n",
"<polyline clip-path=\"url(#clip1203)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 360.64,1503.47 360.64,47.2441 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1203)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 660.893,1503.47 660.893,47.2441 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1203)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 961.146,1503.47 961.146,47.2441 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1203)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 1261.4,1503.47 1261.4,47.2441 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1203)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 1561.65,1503.47 1561.65,47.2441 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1203)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 1861.9,1503.47 1861.9,47.2441 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1203)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 2162.16,1503.47 2162.16,47.2441 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1203)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 201.538,1462.26 2321.26,1462.26 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1203)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 201.538,1077.01 2321.26,1077.01 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1203)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 201.538,691.76 2321.26,691.76 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1203)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 201.538,306.51 2321.26,306.51 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1201)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 201.538,1503.47 2321.26,1503.47 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1201)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 201.538,1503.47 201.538,47.2441 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1201)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 360.64,1503.47 360.64,1481.63 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1201)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 660.893,1503.47 660.893,1481.63 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1201)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 961.146,1503.47 961.146,1481.63 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1201)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 1261.4,1503.47 1261.4,1481.63 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1201)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 1561.65,1503.47 1561.65,1481.63 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1201)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 1861.9,1503.47 1861.9,1481.63 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1201)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 2162.16,1503.47 2162.16,1481.63 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1201)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 201.538,1462.26 233.333,1462.26 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1201)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 201.538,1077.01 233.333,1077.01 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1201)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 201.538,691.76 233.333,691.76 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1201)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 201.538,306.51 233.333,306.51 \n",
" \"/>\n",
"<g clip-path=\"url(#clip1201)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:middle;\" transform=\"rotate(0, 360.64, 1557.47)\" x=\"360.64\" y=\"1557.47\">-3</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip1201)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:middle;\" transform=\"rotate(0, 660.893, 1557.47)\" x=\"660.893\" y=\"1557.47\">-2</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip1201)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:middle;\" transform=\"rotate(0, 961.146, 1557.47)\" x=\"961.146\" y=\"1557.47\">-1</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip1201)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:middle;\" transform=\"rotate(0, 1261.4, 1557.47)\" x=\"1261.4\" y=\"1557.47\">0</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip1201)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:middle;\" transform=\"rotate(0, 1561.65, 1557.47)\" x=\"1561.65\" y=\"1557.47\">1</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip1201)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:middle;\" transform=\"rotate(0, 1861.9, 1557.47)\" x=\"1861.9\" y=\"1557.47\">2</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip1201)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:middle;\" transform=\"rotate(0, 2162.16, 1557.47)\" x=\"2162.16\" y=\"1557.47\">3</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip1201)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:end;\" transform=\"rotate(0, 177.538, 1479.76)\" x=\"177.538\" y=\"1479.76\">0</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip1201)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:end;\" transform=\"rotate(0, 177.538, 1094.51)\" x=\"177.538\" y=\"1094.51\">500</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip1201)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:end;\" transform=\"rotate(0, 177.538, 709.26)\" x=\"177.538\" y=\"709.26\">1000</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip1201)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:end;\" transform=\"rotate(0, 177.538, 324.01)\" x=\"177.538\" y=\"324.01\">1500</text>\n",
"</g>\n",
"<polygon clip-path=\"url(#clip1203)\" points=\"\n",
"318.126,1289.67 318.126,1462.26 417.418,1462.26 417.418,1289.67 318.126,1289.67 318.126,1289.67 \n",
" \" fill=\"#009af9\" fill-opacity=\"1\"/>\n",
"<polyline clip-path=\"url(#clip1203)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 318.126,1289.67 318.126,1462.26 417.418,1462.26 417.418,1289.67 318.126,1289.67 \n",
" \"/>\n",
"<polygon clip-path=\"url(#clip1203)\" points=\"\n",
"417.418,1388.29 417.418,1462.26 516.71,1462.26 516.71,1388.29 417.418,1388.29 417.418,1388.29 \n",
" \" fill=\"#009af9\" fill-opacity=\"1\"/>\n",
"<polyline clip-path=\"url(#clip1203)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 417.418,1388.29 417.418,1462.26 516.71,1462.26 516.71,1388.29 417.418,1388.29 \n",
" \"/>\n",
"<polygon clip-path=\"url(#clip1203)\" points=\"\n",
"516.71,1406.01 516.71,1462.26 616.002,1462.26 616.002,1406.01 516.71,1406.01 516.71,1406.01 \n",
" \" fill=\"#009af9\" fill-opacity=\"1\"/>\n",
"<polyline clip-path=\"url(#clip1203)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 516.71,1406.01 516.71,1462.26 616.002,1462.26 616.002,1406.01 516.71,1406.01 \n",
" \"/>\n",
"<polygon clip-path=\"url(#clip1203)\" points=\"\n",
"616.002,1412.95 616.002,1462.26 715.293,1462.26 715.293,1412.95 616.002,1412.95 616.002,1412.95 \n",
" \" fill=\"#009af9\" fill-opacity=\"1\"/>\n",
"<polyline clip-path=\"url(#clip1203)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 616.002,1412.95 616.002,1462.26 715.293,1462.26 715.293,1412.95 616.002,1412.95 \n",
" \"/>\n",
"<polygon clip-path=\"url(#clip1203)\" points=\"\n",
"715.293,1410.64 715.293,1462.26 814.585,1462.26 814.585,1410.64 715.293,1410.64 715.293,1410.64 \n",
" \" fill=\"#009af9\" fill-opacity=\"1\"/>\n",
"<polyline clip-path=\"url(#clip1203)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 715.293,1410.64 715.293,1462.26 814.585,1462.26 814.585,1410.64 715.293,1410.64 \n",
" \"/>\n",
"<polygon clip-path=\"url(#clip1203)\" points=\"\n",
"814.585,1402.93 814.585,1462.26 913.877,1462.26 913.877,1402.93 814.585,1402.93 814.585,1402.93 \n",
" \" fill=\"#009af9\" fill-opacity=\"1\"/>\n",
"<polyline clip-path=\"url(#clip1203)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 814.585,1402.93 814.585,1462.26 913.877,1462.26 913.877,1402.93 814.585,1402.93 \n",
" \"/>\n",
"<polygon clip-path=\"url(#clip1203)\" points=\"\n",
"913.877,1322.03 913.877,1462.26 1013.17,1462.26 1013.17,1322.03 913.877,1322.03 913.877,1322.03 \n",
" \" fill=\"#009af9\" fill-opacity=\"1\"/>\n",
"<polyline clip-path=\"url(#clip1203)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 913.877,1322.03 913.877,1462.26 1013.17,1462.26 1013.17,1322.03 913.877,1322.03 \n",
" \"/>\n",
"<polygon clip-path=\"url(#clip1203)\" points=\"\n",
"1013.17,1102.44 1013.17,1462.26 1112.46,1462.26 1112.46,1102.44 1013.17,1102.44 1013.17,1102.44 \n",
" \" fill=\"#009af9\" fill-opacity=\"1\"/>\n",
"<polyline clip-path=\"url(#clip1203)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 1013.17,1102.44 1013.17,1462.26 1112.46,1462.26 1112.46,1102.44 1013.17,1102.44 \n",
" \"/>\n",
"<polygon clip-path=\"url(#clip1203)\" points=\"\n",
"1112.46,801.942 1112.46,1462.26 1211.75,1462.26 1211.75,801.942 1112.46,801.942 1112.46,801.942 \n",
" \" fill=\"#009af9\" fill-opacity=\"1\"/>\n",
"<polyline clip-path=\"url(#clip1203)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 1112.46,801.942 1112.46,1462.26 1211.75,1462.26 1211.75,801.942 1112.46,801.942 \n",
" \"/>\n",
"<polygon clip-path=\"url(#clip1203)\" points=\"\n",
"1211.75,93.0812 1211.75,1462.26 1311.04,1462.26 1311.04,93.0812 1211.75,93.0812 1211.75,93.0812 \n",
" \" fill=\"#009af9\" fill-opacity=\"1\"/>\n",
"<polyline clip-path=\"url(#clip1203)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 1211.75,93.0812 1211.75,1462.26 1311.04,1462.26 1311.04,93.0812 1211.75,93.0812 \n",
" \"/>\n",
"<polygon clip-path=\"url(#clip1203)\" points=\"\n",
"1311.04,88.4582 1311.04,1462.26 1410.34,1462.26 1410.34,88.4582 1311.04,88.4582 1311.04,88.4582 \n",
" \" fill=\"#009af9\" fill-opacity=\"1\"/>\n",
"<polyline clip-path=\"url(#clip1203)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 1311.04,88.4582 1311.04,1462.26 1410.34,1462.26 1410.34,88.4582 1311.04,88.4582 \n",
" \"/>\n",
"<polygon clip-path=\"url(#clip1203)\" points=\"\n",
"1410.34,474.479 1410.34,1462.26 1509.63,1462.26 1509.63,474.479 1410.34,474.479 1410.34,474.479 \n",
" \" fill=\"#009af9\" fill-opacity=\"1\"/>\n",
"<polyline clip-path=\"url(#clip1203)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 1410.34,474.479 1410.34,1462.26 1509.63,1462.26 1509.63,474.479 1410.34,474.479 \n",
" \"/>\n",
"<polygon clip-path=\"url(#clip1203)\" points=\"\n",
"1509.63,736.449 1509.63,1462.26 1608.92,1462.26 1608.92,736.449 1509.63,736.449 1509.63,736.449 \n",
" \" fill=\"#009af9\" fill-opacity=\"1\"/>\n",
"<polyline clip-path=\"url(#clip1203)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 1509.63,736.449 1509.63,1462.26 1608.92,1462.26 1608.92,736.449 1509.63,736.449 \n",
" \"/>\n",
"<polygon clip-path=\"url(#clip1203)\" points=\"\n",
"1608.92,1016.14 1608.92,1462.26 1708.21,1462.26 1708.21,1016.14 1608.92,1016.14 1608.92,1016.14 \n",
" \" fill=\"#009af9\" fill-opacity=\"1\"/>\n",
"<polyline clip-path=\"url(#clip1203)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 1608.92,1016.14 1608.92,1462.26 1708.21,1462.26 1708.21,1016.14 1608.92,1016.14 \n",
" \"/>\n",
"<polygon clip-path=\"url(#clip1203)\" points=\"\n",
"1708.21,1148.67 1708.21,1462.26 1807.5,1462.26 1807.5,1148.67 1708.21,1148.67 1708.21,1148.67 \n",
" \" fill=\"#009af9\" fill-opacity=\"1\"/>\n",
"<polyline clip-path=\"url(#clip1203)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 1708.21,1148.67 1708.21,1462.26 1807.5,1462.26 1807.5,1148.67 1708.21,1148.67 \n",
" \"/>\n",
"<polygon clip-path=\"url(#clip1203)\" points=\"\n",
"1807.5,1230.34 1807.5,1462.26 1906.8,1462.26 1906.8,1230.34 1807.5,1230.34 1807.5,1230.34 \n",
" \" fill=\"#009af9\" fill-opacity=\"1\"/>\n",
"<polyline clip-path=\"url(#clip1203)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 1807.5,1230.34 1807.5,1462.26 1906.8,1462.26 1906.8,1230.34 1807.5,1230.34 \n",
" \"/>\n",
"<polygon clip-path=\"url(#clip1203)\" points=\"\n",
"1906.8,1257.31 1906.8,1462.26 2006.09,1462.26 2006.09,1257.31 1906.8,1257.31 1906.8,1257.31 \n",
" \" fill=\"#009af9\" fill-opacity=\"1\"/>\n",
"<polyline clip-path=\"url(#clip1203)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 1906.8,1257.31 1906.8,1462.26 2006.09,1462.26 2006.09,1257.31 1906.8,1257.31 \n",
" \"/>\n",
"<polygon clip-path=\"url(#clip1203)\" points=\"\n",
"2006.09,1252.68 2006.09,1462.26 2105.38,1462.26 2105.38,1252.68 2006.09,1252.68 2006.09,1252.68 \n",
" \" fill=\"#009af9\" fill-opacity=\"1\"/>\n",
"<polyline clip-path=\"url(#clip1203)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 2006.09,1252.68 2006.09,1462.26 2105.38,1462.26 2105.38,1252.68 2006.09,1252.68 \n",
" \"/>\n",
"<polygon clip-path=\"url(#clip1203)\" points=\"\n",
"2105.38,1243.44 2105.38,1462.26 2204.67,1462.26 2204.67,1243.44 2105.38,1243.44 2105.38,1243.44 \n",
" \" fill=\"#009af9\" fill-opacity=\"1\"/>\n",
"<polyline clip-path=\"url(#clip1203)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 2105.38,1243.44 2105.38,1462.26 2204.67,1462.26 2204.67,1243.44 2105.38,1243.44 \n",
" \"/>\n",
"<polygon clip-path=\"url(#clip1201)\" points=\"\n",
"1958.43,251.724 2249.26,251.724 2249.26,130.764 1958.43,130.764 \n",
" \" fill=\"#ffffff\" fill-opacity=\"1\"/>\n",
"<polyline clip-path=\"url(#clip1201)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 1958.43,251.724 2249.26,251.724 2249.26,130.764 1958.43,130.764 1958.43,251.724 \n",
" \"/>\n",
"<polygon clip-path=\"url(#clip1201)\" points=\"\n",
"1982.43,215.436 2126.43,215.436 2126.43,167.052 1982.43,167.052 1982.43,215.436 \n",
" \" fill=\"#009af9\" fill-opacity=\"1\"/>\n",
"<polyline clip-path=\"url(#clip1201)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 1982.43,215.436 2126.43,215.436 2126.43,167.052 1982.43,167.052 1982.43,215.436 \n",
" \"/>\n",
"<g clip-path=\"url(#clip1201)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:start;\" transform=\"rotate(0, 2150.43, 208.744)\" x=\"2150.43\" y=\"208.744\">y1</text>\n",
"</g>\n",
"</svg>\n"
]
},
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# Algorithm 1, non-identity matrix\n",
"X = gmc1(x->dot(x,[1,1]),[1.0 0.0; 0.0 4.0], 10_000)\n",
"A = vec(mapslices(x -> atan(x[1],x[2]), X, dims=1))\n",
"histogram(A, nbins=range(-pi,stop=pi,length=20))"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {},
"outputs": [
{
"data": {
"image/svg+xml": [
"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n",
"<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"600\" height=\"400\" viewBox=\"0 0 2400 1600\">\n",
"<defs>\n",
" <clipPath id=\"clip1600\">\n",
" <rect x=\"0\" y=\"0\" width=\"2000\" height=\"2000\"/>\n",
" </clipPath>\n",
"</defs>\n",
"<defs>\n",
" <clipPath id=\"clip1601\">\n",
" <rect x=\"0\" y=\"0\" width=\"2400\" height=\"1600\"/>\n",
" </clipPath>\n",
"</defs>\n",
"<polygon clip-path=\"url(#clip1601)\" points=\"\n",
"0,1600 2400,1600 2400,0 0,0 \n",
" \" fill=\"#ffffff\" fill-opacity=\"1\"/>\n",
"<defs>\n",
" <clipPath id=\"clip1602\">\n",
" <rect x=\"480\" y=\"0\" width=\"1681\" height=\"1600\"/>\n",
" </clipPath>\n",
"</defs>\n",
"<polygon clip-path=\"url(#clip1601)\" points=\"\n",
"201.538,1503.47 2321.26,1503.47 2321.26,47.2441 201.538,47.2441 \n",
" \" fill=\"#ffffff\" fill-opacity=\"1\"/>\n",
"<defs>\n",
" <clipPath id=\"clip1603\">\n",
" <rect x=\"201\" y=\"47\" width=\"2121\" height=\"1457\"/>\n",
" </clipPath>\n",
"</defs>\n",
"<polyline clip-path=\"url(#clip1603)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 360.64,1503.47 360.64,47.2441 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1603)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 660.893,1503.47 660.893,47.2441 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1603)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 961.146,1503.47 961.146,47.2441 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1603)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 1261.4,1503.47 1261.4,47.2441 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1603)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 1561.65,1503.47 1561.65,47.2441 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1603)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 1861.9,1503.47 1861.9,47.2441 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1603)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 2162.16,1503.47 2162.16,47.2441 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1603)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 201.538,1462.26 2321.26,1462.26 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1603)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 201.538,1217.99 2321.26,1217.99 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1603)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 201.538,973.711 2321.26,973.711 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1603)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 201.538,729.436 2321.26,729.436 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1603)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 201.538,485.161 2321.26,485.161 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1603)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 201.538,240.886 2321.26,240.886 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1601)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 201.538,1503.47 2321.26,1503.47 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1601)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 201.538,1503.47 201.538,47.2441 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1601)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 360.64,1503.47 360.64,1481.63 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1601)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 660.893,1503.47 660.893,1481.63 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1601)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 961.146,1503.47 961.146,1481.63 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1601)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 1261.4,1503.47 1261.4,1481.63 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1601)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 1561.65,1503.47 1561.65,1481.63 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1601)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 1861.9,1503.47 1861.9,1481.63 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1601)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 2162.16,1503.47 2162.16,1481.63 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1601)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 201.538,1462.26 233.333,1462.26 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1601)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 201.538,1217.99 233.333,1217.99 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1601)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 201.538,973.711 233.333,973.711 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1601)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 201.538,729.436 233.333,729.436 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1601)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 201.538,485.161 233.333,485.161 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1601)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 201.538,240.886 233.333,240.886 \n",
" \"/>\n",
"<g clip-path=\"url(#clip1601)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:middle;\" transform=\"rotate(0, 360.64, 1557.47)\" x=\"360.64\" y=\"1557.47\">-3</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip1601)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:middle;\" transform=\"rotate(0, 660.893, 1557.47)\" x=\"660.893\" y=\"1557.47\">-2</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip1601)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:middle;\" transform=\"rotate(0, 961.146, 1557.47)\" x=\"961.146\" y=\"1557.47\">-1</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip1601)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:middle;\" transform=\"rotate(0, 1261.4, 1557.47)\" x=\"1261.4\" y=\"1557.47\">0</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip1601)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:middle;\" transform=\"rotate(0, 1561.65, 1557.47)\" x=\"1561.65\" y=\"1557.47\">1</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip1601)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:middle;\" transform=\"rotate(0, 1861.9, 1557.47)\" x=\"1861.9\" y=\"1557.47\">2</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip1601)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:middle;\" transform=\"rotate(0, 2162.16, 1557.47)\" x=\"2162.16\" y=\"1557.47\">3</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip1601)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:end;\" transform=\"rotate(0, 177.538, 1479.76)\" x=\"177.538\" y=\"1479.76\">0</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip1601)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:end;\" transform=\"rotate(0, 177.538, 1235.49)\" x=\"177.538\" y=\"1235.49\">250</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip1601)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:end;\" transform=\"rotate(0, 177.538, 991.211)\" x=\"177.538\" y=\"991.211\">500</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip1601)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:end;\" transform=\"rotate(0, 177.538, 746.936)\" x=\"177.538\" y=\"746.936\">750</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip1601)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:end;\" transform=\"rotate(0, 177.538, 502.661)\" x=\"177.538\" y=\"502.661\">1000</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip1601)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:end;\" transform=\"rotate(0, 177.538, 258.386)\" x=\"177.538\" y=\"258.386\">1250</text>\n",
"</g>\n",
"<polygon clip-path=\"url(#clip1603)\" points=\"\n",
"318.126,1308.86 318.126,1462.26 417.418,1462.26 417.418,1308.86 318.126,1308.86 318.126,1308.86 \n",
" \" fill=\"#009af9\" fill-opacity=\"1\"/>\n",
"<polyline clip-path=\"url(#clip1603)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 318.126,1308.86 318.126,1462.26 417.418,1462.26 417.418,1308.86 318.126,1308.86 \n",
" \"/>\n",
"<polygon clip-path=\"url(#clip1603)\" points=\"\n",
"417.418,1370.41 417.418,1462.26 516.71,1462.26 516.71,1370.41 417.418,1370.41 417.418,1370.41 \n",
" \" fill=\"#009af9\" fill-opacity=\"1\"/>\n",
"<polyline clip-path=\"url(#clip1603)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 417.418,1370.41 417.418,1462.26 516.71,1462.26 516.71,1370.41 417.418,1370.41 \n",
" \"/>\n",
"<polygon clip-path=\"url(#clip1603)\" points=\"\n",
"516.71,1386.05 516.71,1462.26 616.002,1462.26 616.002,1386.05 516.71,1386.05 516.71,1386.05 \n",
" \" fill=\"#009af9\" fill-opacity=\"1\"/>\n",
"<polyline clip-path=\"url(#clip1603)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 516.71,1386.05 516.71,1462.26 616.002,1462.26 616.002,1386.05 516.71,1386.05 \n",
" \"/>\n",
"<polygon clip-path=\"url(#clip1603)\" points=\"\n",
"616.002,1386.05 616.002,1462.26 715.293,1462.26 715.293,1386.05 616.002,1386.05 616.002,1386.05 \n",
" \" fill=\"#009af9\" fill-opacity=\"1\"/>\n",
"<polyline clip-path=\"url(#clip1603)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 616.002,1386.05 616.002,1462.26 715.293,1462.26 715.293,1386.05 616.002,1386.05 \n",
" \"/>\n",
"<polygon clip-path=\"url(#clip1603)\" points=\"\n",
"715.293,1350.87 715.293,1462.26 814.585,1462.26 814.585,1350.87 715.293,1350.87 715.293,1350.87 \n",
" \" fill=\"#009af9\" fill-opacity=\"1\"/>\n",
"<polyline clip-path=\"url(#clip1603)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 715.293,1350.87 715.293,1462.26 814.585,1462.26 814.585,1350.87 715.293,1350.87 \n",
" \"/>\n",
"<polygon clip-path=\"url(#clip1603)\" points=\"\n",
"814.585,1309.83 814.585,1462.26 913.877,1462.26 913.877,1309.83 814.585,1309.83 814.585,1309.83 \n",
" \" fill=\"#009af9\" fill-opacity=\"1\"/>\n",
"<polyline clip-path=\"url(#clip1603)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 814.585,1309.83 814.585,1462.26 913.877,1462.26 913.877,1309.83 814.585,1309.83 \n",
" \"/>\n",
"<polygon clip-path=\"url(#clip1603)\" points=\"\n",
"913.877,1255.12 913.877,1462.26 1013.17,1462.26 1013.17,1255.12 913.877,1255.12 913.877,1255.12 \n",
" \" fill=\"#009af9\" fill-opacity=\"1\"/>\n",
"<polyline clip-path=\"url(#clip1603)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 913.877,1255.12 913.877,1462.26 1013.17,1462.26 1013.17,1255.12 913.877,1255.12 \n",
" \"/>\n",
"<polygon clip-path=\"url(#clip1603)\" points=\"\n",
"1013.17,1066.54 1013.17,1462.26 1112.46,1462.26 1112.46,1066.54 1013.17,1066.54 1013.17,1066.54 \n",
" \" fill=\"#009af9\" fill-opacity=\"1\"/>\n",
"<polyline clip-path=\"url(#clip1603)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 1013.17,1066.54 1013.17,1462.26 1112.46,1462.26 1112.46,1066.54 1013.17,1066.54 \n",
" \"/>\n",
"<polygon clip-path=\"url(#clip1603)\" points=\"\n",
"1112.46,853.527 1112.46,1462.26 1211.75,1462.26 1211.75,853.527 1112.46,853.527 1112.46,853.527 \n",
" \" fill=\"#009af9\" fill-opacity=\"1\"/>\n",
"<polyline clip-path=\"url(#clip1603)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 1112.46,853.527 1112.46,1462.26 1211.75,1462.26 1211.75,853.527 1112.46,853.527 \n",
" \"/>\n",
"<polygon clip-path=\"url(#clip1603)\" points=\"\n",
"1211.75,600.459 1211.75,1462.26 1311.04,1462.26 1311.04,600.459 1211.75,600.459 1211.75,600.459 \n",
" \" fill=\"#009af9\" fill-opacity=\"1\"/>\n",
"<polyline clip-path=\"url(#clip1603)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 1211.75,600.459 1211.75,1462.26 1311.04,1462.26 1311.04,600.459 1211.75,600.459 \n",
" \"/>\n",
"<polygon clip-path=\"url(#clip1603)\" points=\"\n",
"1311.04,302.443 1311.04,1462.26 1410.34,1462.26 1410.34,302.443 1311.04,302.443 1311.04,302.443 \n",
" \" fill=\"#009af9\" fill-opacity=\"1\"/>\n",
"<polyline clip-path=\"url(#clip1603)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 1311.04,302.443 1311.04,1462.26 1410.34,1462.26 1410.34,302.443 1311.04,302.443 \n",
" \"/>\n",
"<polygon clip-path=\"url(#clip1603)\" points=\"\n",
"1410.34,106.046 1410.34,1462.26 1509.63,1462.26 1509.63,106.046 1410.34,106.046 1410.34,106.046 \n",
" \" fill=\"#009af9\" fill-opacity=\"1\"/>\n",
"<polyline clip-path=\"url(#clip1603)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 1410.34,106.046 1410.34,1462.26 1509.63,1462.26 1509.63,106.046 1410.34,106.046 \n",
" \"/>\n",
"<polygon clip-path=\"url(#clip1603)\" points=\"\n",
"1509.63,88.4582 1509.63,1462.26 1608.92,1462.26 1608.92,88.4582 1509.63,88.4582 1509.63,88.4582 \n",
" \" fill=\"#009af9\" fill-opacity=\"1\"/>\n",
"<polyline clip-path=\"url(#clip1603)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 1509.63,88.4582 1509.63,1462.26 1608.92,1462.26 1608.92,88.4582 1509.63,88.4582 \n",
" \"/>\n",
"<polygon clip-path=\"url(#clip1603)\" points=\"\n",
"1608.92,373.771 1608.92,1462.26 1708.21,1462.26 1708.21,373.771 1608.92,373.771 1608.92,373.771 \n",
" \" fill=\"#009af9\" fill-opacity=\"1\"/>\n",
"<polyline clip-path=\"url(#clip1603)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 1608.92,373.771 1608.92,1462.26 1708.21,1462.26 1708.21,373.771 1608.92,373.771 \n",
" \"/>\n",
"<polygon clip-path=\"url(#clip1603)\" points=\"\n",
"1708.21,656.153 1708.21,1462.26 1807.5,1462.26 1807.5,656.153 1708.21,656.153 1708.21,656.153 \n",
" \" fill=\"#009af9\" fill-opacity=\"1\"/>\n",
"<polyline clip-path=\"url(#clip1603)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 1708.21,656.153 1708.21,1462.26 1807.5,1462.26 1807.5,656.153 1708.21,656.153 \n",
" \"/>\n",
"<polygon clip-path=\"url(#clip1603)\" points=\"\n",
"1807.5,952.214 1807.5,1462.26 1906.8,1462.26 1906.8,952.214 1807.5,952.214 1807.5,952.214 \n",
" \" fill=\"#009af9\" fill-opacity=\"1\"/>\n",
"<polyline clip-path=\"url(#clip1603)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 1807.5,952.214 1807.5,1462.26 1906.8,1462.26 1906.8,952.214 1807.5,952.214 \n",
" \"/>\n",
"<polygon clip-path=\"url(#clip1603)\" points=\"\n",
"1906.8,1122.23 1906.8,1462.26 2006.09,1462.26 2006.09,1122.23 1906.8,1122.23 1906.8,1122.23 \n",
" \" fill=\"#009af9\" fill-opacity=\"1\"/>\n",
"<polyline clip-path=\"url(#clip1603)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 1906.8,1122.23 1906.8,1462.26 2006.09,1462.26 2006.09,1122.23 1906.8,1122.23 \n",
" \"/>\n",
"<polygon clip-path=\"url(#clip1603)\" points=\"\n",
"2006.09,1233.62 2006.09,1462.26 2105.38,1462.26 2105.38,1233.62 2006.09,1233.62 2006.09,1233.62 \n",
" \" fill=\"#009af9\" fill-opacity=\"1\"/>\n",
"<polyline clip-path=\"url(#clip1603)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 2006.09,1233.62 2006.09,1462.26 2105.38,1462.26 2105.38,1233.62 2006.09,1233.62 \n",
" \"/>\n",
"<polygon clip-path=\"url(#clip1603)\" points=\"\n",
"2105.38,1289.31 2105.38,1462.26 2204.67,1462.26 2204.67,1289.31 2105.38,1289.31 2105.38,1289.31 \n",
" \" fill=\"#009af9\" fill-opacity=\"1\"/>\n",
"<polyline clip-path=\"url(#clip1603)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 2105.38,1289.31 2105.38,1462.26 2204.67,1462.26 2204.67,1289.31 2105.38,1289.31 \n",
" \"/>\n",
"<polygon clip-path=\"url(#clip1601)\" points=\"\n",
"1958.43,251.724 2249.26,251.724 2249.26,130.764 1958.43,130.764 \n",
" \" fill=\"#ffffff\" fill-opacity=\"1\"/>\n",
"<polyline clip-path=\"url(#clip1601)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 1958.43,251.724 2249.26,251.724 2249.26,130.764 1958.43,130.764 1958.43,251.724 \n",
" \"/>\n",
"<polygon clip-path=\"url(#clip1601)\" points=\"\n",
"1982.43,215.436 2126.43,215.436 2126.43,167.052 1982.43,167.052 1982.43,215.436 \n",
" \" fill=\"#009af9\" fill-opacity=\"1\"/>\n",
"<polyline clip-path=\"url(#clip1601)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 1982.43,215.436 2126.43,215.436 2126.43,167.052 1982.43,167.052 1982.43,215.436 \n",
" \"/>\n",
"<g clip-path=\"url(#clip1601)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:start;\" transform=\"rotate(0, 2150.43, 208.744)\" x=\"2150.43\" y=\"208.744\">y1</text>\n",
"</g>\n",
"</svg>\n"
]
},
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# Algorithm 2, non-identity matrix\n",
"X = gmc2(x->dot(x,[1,1]),[1.0 0.0; 0.0 16.0], 10_000)\n",
"A = vec(mapslices(x -> atan(x[1],x[2]), X, dims=1))\n",
"histogram(A, nbins=range(-pi,stop=pi,length=20))"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Julia 1.0.1",
"language": "julia",
"name": "julia-1.0"
},
"language_info": {
"file_extension": ".jl",
"mimetype": "application/julia",
"name": "julia",
"version": "1.0.1"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
[[Base64]]
uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
[[BinDeps]]
deps = ["Compat", "Libdl", "SHA", "URIParser"]
git-tree-sha1 = "12093ca6cdd0ee547c39b1870e0c9c3f154d9ca9"
uuid = "9e28174c-4ba2-5203-b857-d8d62c4213ee"
version = "0.8.10"
[[BinaryProvider]]
deps = ["Libdl", "Pkg", "SHA", "Test"]
git-tree-sha1 = "9930c1a6cd49d9fcd7218df6be417e6ae4f1468a"
uuid = "b99e7846-7c00-51b0-8f62-c81ae34c0232"
version = "0.5.2"
[[ColorTypes]]
deps = ["FixedPointNumbers", "Random", "Test"]
git-tree-sha1 = "f73b0e10f2a5756de7019818a41654686da06b09"
uuid = "3da002f7-5984-5a60-b8a6-cbb66c0b333f"
version = "0.7.5"
[[Colors]]
deps = ["ColorTypes", "FixedPointNumbers", "InteractiveUtils", "Pkg", "Printf", "Reexport", "Test"]
git-tree-sha1 = "8c89e0a9a583954eae3efcf6a531e51c02b38cee"
uuid = "5ae59095-9a9b-59fe-a467-6f913c188581"
version = "0.9.4"
[[CommonSubexpressions]]
deps = ["Test"]
git-tree-sha1 = "efdaf19ab11c7889334ca247ff4c9f7c322817b0"
uuid = "bbf7d656-a473-5ed7-a52c-81e309532950"
version = "0.2.0"
[[Compat]]
deps = ["Base64", "Dates", "DelimitedFiles", "Distributed", "InteractiveUtils", "LibGit2", "Libdl", "LinearAlgebra", "Markdown", "Mmap", "Pkg", "Printf", "REPL", "Random", "Serialization", "SharedArrays", "Sockets", "SparseArrays", "Statistics", "Test", "UUIDs", "Unicode"]
git-tree-sha1 = "2d9e14d19bad3f9ad5cc5e4cffabc3cfa59de825"
uuid = "34da2185-b29b-5c13-b0c7-acf172513d20"
version = "1.3.0"
[[Conda]]
deps = ["Compat", "JSON", "VersionParsing"]
git-tree-sha1 = "fb86fe40cb5b35990e368709bfdc1b46dbb99dac"
uuid = "8f4d0f93-b110-5947-807f-2305c1781a2d"
version = "1.1.1"
[[Contour]]
deps = ["LinearAlgebra", "StaticArrays", "Test"]
git-tree-sha1 = "b974e164358fea753ef853ce7bad97afec15bb80"
uuid = "d38c429a-6771-53c6-b99e-75d170b6e991"
version = "0.5.1"
[[DataStructures]]
deps = ["InteractiveUtils", "OrderedCollections", "REPL", "Random", "Serialization", "Test"]
git-tree-sha1 = "8fc6e166e24fda04b2b648d4260cdad241788c54"
uuid = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
version = "0.14.0"
[[Dates]]
deps = ["Printf"]
uuid = "ade2ca70-3891-5945-98fb-dc099432e06a"
[[DelimitedFiles]]
deps = ["Mmap"]
uuid = "8bb1440f-4735-579b-a4ab-409b98df4dab"
[[DiffResults]]
deps = ["Compat", "StaticArrays"]
git-tree-sha1 = "db8acf46717b13d6c48deb7a12007c7f85a70cf7"
uuid = "163ba53b-c6d8-5494-b064-1a9d43ac40c5"
version = "0.0.3"
[[DiffRules]]
deps = ["Random", "Test"]
git-tree-sha1 = "c49ec69428ffea0c1d1bbdc63d1a70f5df5860ad"
uuid = "b552c78f-8df3-52c6-915a-8e097449b14b"
version = "0.0.7"
[[Distributed]]
deps = ["LinearAlgebra", "Random", "Serialization", "Sockets"]
uuid = "8ba89e20-285c-5b6f-9357-94700520ee1b"
[[FileWatching]]
uuid = "7b1f6079-737a-58dc-b8bc-7a2ca5c1b5ee"
[[FixedPointNumbers]]
deps = ["Pkg", "Test"]
git-tree-sha1 = "b8045033701c3b10bf2324d7203404be7aef88ba"
uuid = "53c48c17-4a7d-5ca2-90c5-79b7896eea93"
version = "0.5.3"
[[ForwardDiff]]
deps = ["CommonSubexpressions", "DiffResults", "DiffRules", "InteractiveUtils", "LinearAlgebra", "NaNMath", "Pkg", "Random", "SparseArrays", "SpecialFunctions", "StaticArrays", "Test"]
git-tree-sha1 = "d8f3e0f19d0d546aa92eb1cd67cd3e515768d9f7"
uuid = "f6369f11-7733-5829-9624-2563aa707210"
version = "0.10.0"
[[GR]]
deps = ["Base64", "DelimitedFiles", "Pkg", "Random", "Serialization", "Sockets", "Test"]
git-tree-sha1 = "18e3aa0f988f6e94c90394deaa76cb095bf87469"
uuid = "28b8d3ca-fb5f-59d9-8090-bfdbd6d07a71"
version = "0.35.0"
[[IJulia]]
deps = ["Base64", "Compat", "Conda", "Dates", "InteractiveUtils", "JSON", "Markdown", "MbedTLS", "Pkg", "Printf", "REPL", "Random", "SoftGlobalScope", "Test", "UUIDs", "ZMQ"]
git-tree-sha1 = "7545d05fa0253aef6cc0728fddae44e6837619c8"
uuid = "7073ff75-c697-5162-941a-fcdaad2a7d2a"
version = "1.13.0"
[[InteractiveUtils]]
deps = ["LinearAlgebra", "Markdown"]
uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
[[JSON]]
deps = ["Dates", "Distributed", "Mmap", "Pkg", "Sockets", "Test", "Unicode"]
git-tree-sha1 = "fec8e4d433072731466d37ed0061b3ba7f70eeb9"
uuid = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
version = "0.19.0"
[[LibGit2]]
uuid = "76f85450-5226-5b5a-8eaa-529ad045b433"
[[Libdl]]
uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb"
[[LinearAlgebra]]
deps = ["Libdl"]
uuid = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
[[Logging]]
uuid = "56ddb016-857b-54e1-b83d-db4d58db5568"
[[Markdown]]
deps = ["Base64"]
uuid = "d6f4376e-aef5-505a-96c1-9c027394607a"
[[MbedTLS]]
deps = ["BinaryProvider", "Libdl", "Pkg", "Random", "Sockets", "Test"]
git-tree-sha1 = "4b890362c0c2fdb14a575ce927f1f4eeac6dda9f"
uuid = "739be429-bea8-5141-9913-cc70e7f3736d"
version = "0.6.4"
[[Measures]]
deps = ["Pkg", "Test"]
git-tree-sha1 = "ddfd6d13e330beacdde2c80de27c1c671945e7d9"
uuid = "442fdcdd-2543-5da2-b0f3-8c86c306513e"
version = "0.3.0"
[[Missings]]
deps = ["Dates", "InteractiveUtils", "SparseArrays", "Test"]
git-tree-sha1 = "adc26d2ee85a49c413464110d922cf21efc9d233"
uuid = "e1d29d7a-bbdc-5cf2-9ac0-f12de2c33e28"
version = "0.3.1"
[[Mmap]]
uuid = "a63ad114-7e13-5084-954f-fe012c677804"
[[NaNMath]]
deps = ["Compat"]
git-tree-sha1 = "ce3b85e484a5d4c71dd5316215069311135fa9f2"
uuid = "77ba4419-2d1f-58cd-9bb1-8ffee604a2e3"
version = "0.3.2"
[[OrderedCollections]]
deps = ["Pkg", "Random", "Serialization", "Test"]
git-tree-sha1 = "85619a3f3e17bb4761fe1b1fd47f0e979f964d5b"
uuid = "bac558e1-5e72-5ebc-8fee-abe8a469f55d"
version = "1.0.2"
[[Pkg]]
deps = ["Dates", "LibGit2", "Markdown", "Printf", "REPL", "Random", "SHA", "UUIDs"]
uuid = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
[[PlotThemes]]
deps = ["PlotUtils", "Requires", "Test"]
git-tree-sha1 = "f3afd2d58e1f6ac9be2cea46e4a9083ccc1d990b"
uuid = "ccf2f8ad-2431-5c83-bf29-c5338b663b6a"
version = "0.3.0"
[[PlotUtils]]
deps = ["Colors", "Dates", "Printf", "Random", "Reexport", "Test"]
git-tree-sha1 = "fd28f30a294a38ec847de95d8ac7ac916ccd7c06"
uuid = "995b91a9-d308-5afd-9ec6-746e21dbc043"
version = "0.5.5"
[[Plots]]
deps = ["Base64", "Contour", "Dates", "FixedPointNumbers", "GR", "JSON", "LinearAlgebra", "Measures", "NaNMath", "Pkg", "PlotThemes", "PlotUtils", "Printf", "Random", "RecipesBase", "Reexport", "Requires", "Showoff", "SparseArrays", "StaticArrays", "Statistics", "StatsBase", "Test", "UUIDs"]
git-tree-sha1 = "83f387a4989ab60dfb0bb3f52f3907a14acc1588"
uuid = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
version = "0.20.6"
[[Printf]]
deps = ["Unicode"]
uuid = "de0858da-6303-5e67-8744-51eddeeeb8d7"
[[REPL]]
deps = ["InteractiveUtils", "Markdown", "Sockets"]
uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb"
[[Random]]
deps = ["Serialization"]
uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
[[RecipesBase]]
deps = ["Pkg", "Random", "Test"]
git-tree-sha1 = "0b3cb370ee4dc00f47f1193101600949f3dcf884"
uuid = "3cdcf5f2-1ef4-517c-9805-6587b60abb01"
version = "0.6.0"
[[Reexport]]
deps = ["Pkg"]
git-tree-sha1 = "7b1d07f411bc8ddb7977ec7f377b97b158514fe0"
uuid = "189a3867-3050-52da-a836-e630ba90ab69"
version = "0.2.0"
[[Requires]]
deps = ["Test"]
git-tree-sha1 = "f6fbf4ba64d295e146e49e021207993b6b48c7d1"
uuid = "ae029012-a4dd-5104-9daa-d747884805df"
version = "0.5.2"
[[SHA]]
uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce"
[[Serialization]]
uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b"
[[SharedArrays]]
deps = ["Distributed", "Mmap", "Random", "Serialization"]
uuid = "1a1011a3-84de-559e-8e89-a11a2f7dc383"
[[Showoff]]
deps = ["Compat", "Pkg"]
git-tree-sha1 = "276b24f3ace98bec911be7ff2928d497dc759085"
uuid = "992d4aef-0814-514b-bc4d-f2e9a6c4116f"
version = "0.2.1"
[[Sockets]]
uuid = "6462fe0b-24de-5631-8697-dd941f90decc"
[[SoftGlobalScope]]
deps = ["Test"]
git-tree-sha1 = "97f6dfcf612b9a7260fde44170725d9ea34b1431"
uuid = "b85f4697-e234-5449-a836-ec8e2f98b302"
version = "1.0.7"
[[SortingAlgorithms]]
deps = ["DataStructures", "Random", "Test"]
git-tree-sha1 = "03f5898c9959f8115e30bc7226ada7d0df554ddd"
uuid = "a2af1166-a08f-5f64-846c-94a0d3cef48c"
version = "0.3.1"
[[SparseArrays]]
deps = ["LinearAlgebra", "Random"]
uuid = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
[[SpecialFunctions]]
deps = ["BinDeps", "BinaryProvider", "Libdl", "Test"]
git-tree-sha1 = "c35c9c76008babf4d658060fc64aeb369a41e7bd"
uuid = "276daf66-3868-5448-9aa4-cd146d93841b"
version = "0.7.1"
[[StaticArrays]]
deps = ["InteractiveUtils", "LinearAlgebra", "Random", "Statistics", "Test"]
git-tree-sha1 = "d432c79bef174a830304f8601427a4357dfdbfb7"
uuid = "90137ffa-7385-5640-81b9-e52037218182"
version = "0.8.3"
[[Statistics]]
deps = ["LinearAlgebra", "SparseArrays"]
uuid = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
[[StatsBase]]
deps = ["DataStructures", "LinearAlgebra", "Missings", "Printf", "Random", "SortingAlgorithms", "SparseArrays", "Statistics", "Test"]
git-tree-sha1 = "723193a13e8078cec6dcd0b8fe245c8bfd81690e"
uuid = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
version = "0.25.0"
[[Test]]
deps = ["Distributed", "InteractiveUtils", "Logging", "Random"]
uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
[[URIParser]]
deps = ["Test", "Unicode"]
git-tree-sha1 = "6ddf8244220dfda2f17539fa8c9de20d6c575b69"
uuid = "30578b45-9adc-5946-b283-645ec420af67"
version = "0.4.0"
[[UUIDs]]
deps = ["Random"]
uuid = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"
[[Unicode]]
uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5"
[[VersionParsing]]
deps = ["Compat"]
git-tree-sha1 = "c9d5aa108588b978bd859554660c8a5c4f2f7669"
uuid = "81def892-9a0e-5fdd-b105-ffc91e053289"
version = "1.1.3"
[[ZMQ]]
deps = ["BinaryProvider", "FileWatching", "Libdl", "Sockets", "Test"]
git-tree-sha1 = "34e7ac2d1d59d19d0e86bde99f1f02262bfa1613"
uuid = "c2297ded-f4af-51ae-bb23-16f91089e4e1"
version = "1.0.0"
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
[deps]
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
IJulia = "7073ff75-c697-5162-941a-fcdaad2a7d2a"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment