{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"using Mamba"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"Dict{Symbol,Any} with 3 entries:\n",
" :J => 8\n",
" :y => [28, 8, -3, 7, -1, 1, 18, 12]\n",
" :sigma => [15, 10, 16, 11, 9, 11, 10, 18]"
]
},
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# Data\n",
"schools_dat = Dict{Symbol, Any}(\n",
" :J => 8,\n",
" :y => [28, 8, -3, 7, -1, 1, 18, 12],\n",
" :sigma => [15, 10, 16, 11, 9, 11, 10, 18])"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"Object of type \"Mamba.Model\"\n",
"-------------------------------------------------------------------------------\n",
"y:\n",
"An unmonitored node of type \"0-element Mamba.ArrayStochastic{1}\"\n",
"Float64[]\n",
"-------------------------------------------------------------------------------\n",
"eta:\n",
"A monitored node of type \"0-element Mamba.ArrayStochastic{1}\"\n",
"Float64[]\n",
"-------------------------------------------------------------------------------\n",
"mu:\n",
"A monitored node of type \"Mamba.ScalarStochastic\"\n",
"NaN\n",
"-------------------------------------------------------------------------------\n",
"theta:\n",
"An unmonitored node of type \"0-element Mamba.ArrayLogical{1}\"\n",
"Float64[]\n",
"-------------------------------------------------------------------------------\n",
"tau:\n",
"A monitored node of type \"Mamba.ScalarStochastic\"\n",
"NaN\n"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# Model\n",
"model = Model(\n",
" y = Stochastic(1,\n",
" (theta, sigma)->MvNormal(theta, sigma),\n",
" false\n",
" ),\n",
" theta = Logical(1,(mu, tau, eta)->mu + tau*eta,false),\n",
" eta = Stochastic(1, ()-> MvNormal(8, 1.0)),\n",
" mu = Stochastic(()-> Normal(0, 100)),\n",
" tau = Stochastic(() -> Rayleigh(100))\n",
")"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"4-element Array{Dict{Symbol,Any},1}:\n",
" Dict{Symbol,Any}(Pair{Symbol,Any}(:y, [28, 8, -3, 7, -1, 1, 18, 12]),Pair{Symbol,Any}(:eta, [0.468247, 0.466959, 1.7241, 1.63449, 0.466135, 0.575605, -0.100683, -0.160592]),Pair{Symbol,Any}(:mu, 0.867688),Pair{Symbol,Any}(:tau, 2.25625)) \n",
" Dict{Symbol,Any}(Pair{Symbol,Any}(:y, [28, 8, -3, 7, -1, 1, 18, 12]),Pair{Symbol,Any}(:eta, [-1.00713, 1.24793, 0.262724, -0.446687, 1.1828, -0.961785, 0.148227, -0.995843]),Pair{Symbol,Any}(:mu, 0.389412),Pair{Symbol,Any}(:tau, 0.365725)) \n",
" Dict{Symbol,Any}(Pair{Symbol,Any}(:y, [28, 8, -3, 7, -1, 1, 18, 12]),Pair{Symbol,Any}(:eta, [-0.272355, -1.39426, 1.51095, -0.352887, -0.0123941, 1.31394, -0.583011, 0.545557]),Pair{Symbol,Any}(:mu, -0.0108867),Pair{Symbol,Any}(:tau, 1.55082))\n",
" Dict{Symbol,Any}(Pair{Symbol,Any}(:y, [28, 8, -3, 7, -1, 1, 18, 12]),Pair{Symbol,Any}(:eta, [-1.25073, -0.709787, 0.397141, 0.848035, 0.874183, 1.48974, 2.59394, -0.640735]),Pair{Symbol,Any}(:mu, -1.67913),Pair{Symbol,Any}(:tau, 0.561097)) "
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# Initial Values\n",
"inits = [\n",
" Dict(:y=>schools_dat[:y],\n",
" :eta=>rand(Normal(0,1),8),\n",
" :mu =>rand(Normal(0,1)),\n",
" :tau => rand(Rayleigh(1))\n",
" )for i in 1:4\n",
"]"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"Object of type \"Mamba.Model\"\n",
"-------------------------------------------------------------------------------\n",
"y:\n",
"An unmonitored node of type \"0-element Mamba.ArrayStochastic{1}\"\n",
"Float64[]\n",
"-------------------------------------------------------------------------------\n",
"eta:\n",
"A monitored node of type \"0-element Mamba.ArrayStochastic{1}\"\n",
"Float64[]\n",
"-------------------------------------------------------------------------------\n",
"mu:\n",
"A monitored node of type \"Mamba.ScalarStochastic\"\n",
"NaN\n",
"-------------------------------------------------------------------------------\n",
"theta:\n",
"An unmonitored node of type \"0-element Mamba.ArrayLogical{1}\"\n",
"Float64[]\n",
"-------------------------------------------------------------------------------\n",
"tau:\n",
"A monitored node of type \"Mamba.ScalarStochastic\"\n",
"NaN\n"
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"## Sampling Scheme\n",
"scheme = [NUTS([:mu,:eta]),Slice(:tau,3)]\n",
"setsamplers!(model, scheme)"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"MCMC Simulation of 1000 Iterations x 4 Chains...\n",
"\n",
"Chain 1: 1% [0:05:59 of 0:06:03 remaining]\n",
"Chain 1: 10% [0:00:34 of 0:00:38 remaining]\n",
"Chain 1: 20% [0:00:16 of 0:00:20 remaining]\n",
"Chain 1: 30% [0:00:10 of 0:00:14 remaining]\n",
"Chain 1: 40% [0:00:07 of 0:00:11 remaining]\n",
"Chain 1: 50% [0:00:05 of 0:00:09 remaining]\n",
"Chain 1: 60% [0:00:03 of 0:00:08 remaining]\n",
"Chain 1: 70% [0:00:02 of 0:00:07 remaining]\n",
"Chain 1: 80% [0:00:01 of 0:00:07 remaining]\n",
"Chain 1: 90% [0:00:01 of 0:00:06 remaining]\n",
"Chain 1: 100% [0:00:00 of 0:00:06 remaining]\n",
"\n",
"Chain 2: 1% [0:00:02 of 0:00:02 remaining]\n",
"Chain 2: 10% [0:00:01 of 0:00:02 remaining]\n",
"Chain 2: 20% [0:00:01 of 0:00:02 remaining]\n",
"Chain 2: 30% [0:00:01 of 0:00:02 remaining]\n",
"Chain 2: 40% [0:00:01 of 0:00:02 remaining]\n",
"Chain 2: 50% [0:00:01 of 0:00:01 remaining]\n",
"Chain 2: 60% [0:00:01 of 0:00:01 remaining]\n",
"Chain 2: 70% [0:00:00 of 0:00:01 remaining]\n",
"Chain 2: 80% [0:00:00 of 0:00:01 remaining]\n",
"Chain 2: 90% [0:00:00 of 0:00:01 remaining]\n",
"Chain 2: 100% [0:00:00 of 0:00:01 remaining]\n",
"\n",
"Chain 3: 1% [0:00:02 of 0:00:02 remaining]\n",
"Chain 3: 10% [0:00:01 of 0:00:02 remaining]\n",
"Chain 3: 20% [0:00:01 of 0:00:02 remaining]\n",
"Chain 3: 30% [0:00:01 of 0:00:02 remaining]\n",
"Chain 3: 40% [0:00:01 of 0:00:02 remaining]\n",
"Chain 3: 50% [0:00:01 of 0:00:02 remaining]\n",
"Chain 3: 60% [0:00:01 of 0:00:02 remaining]\n",
"Chain 3: 70% [0:00:01 of 0:00:02 remaining]\n",
"Chain 3: 80% [0:00:00 of 0:00:02 remaining]\n",
"Chain 3: 90% [0:00:00 of 0:00:02 remaining]\n",
"Chain 3: 100% [0:00:00 of 0:00:02 remaining]\n",
"\n",
"Chain 4: 1% [0:00:02 of 0:00:02 remaining]\n",
"Chain 4: 10% [0:00:02 of 0:00:02 remaining]\n",
"Chain 4: 20% [0:00:01 of 0:00:02 remaining]\n",
"Chain 4: 30% [0:00:01 of 0:00:02 remaining]\n",
"Chain 4: 40% [0:00:01 of 0:00:02 remaining]\n",
"Chain 4: 50% [0:00:01 of 0:00:02 remaining]\n",
"Chain 4: 60% [0:00:01 of 0:00:02 remaining]\n",
"Chain 4: 70% [0:00:01 of 0:00:02 remaining]\n",
"Chain 4: 80% [0:00:00 of 0:00:02 remaining]\n",
"Chain 4: 90% [0:00:00 of 0:00:02 remaining]\n",
"Chain 4: 100% [0:00:00 of 0:00:02 remaining]\n",
"\n",
"Iterations = 501:1000\n",
"Thinning interval = 1\n",
"Chains = 1,2,3,4\n",
"Samples per chain = 500\n",
"\n",
"Empirical Posterior Estimates:\n",
" Mean SD Naive SE MCSE ESS \n",
" tau 11.973184934 7.11380920 0.159069609 1.355458557 27.544313\n",
" mu 5.383857841 8.33140697 0.186295923 1.518361677 30.108300\n",
"eta[1] 0.689808179 0.86688345 0.019384103 0.082986222 109.121277\n",
"eta[2] 0.053703914 0.72766689 0.016271126 0.052481258 192.245755\n",
"eta[3] -0.292673712 0.83395925 0.018647896 0.048122119 300.331012\n",
"eta[4] 0.067606021 0.78853122 0.017632094 0.070188465 126.213641\n",
"eta[5] -0.222602894 0.89875205 0.020096707 0.125052049 51.653311\n",
"eta[6] -0.189599057 0.73919283 0.016528854 0.055794386 175.523185\n",
"eta[7] 0.558052649 0.72465191 0.016203709 0.060600547 142.990042\n",
"eta[8] 0.109216120 0.82952584 0.018548762 0.043986389 355.650334\n",
"\n",
"Quantiles:\n",
" 2.5% 25.0% 50.0% 75.0% 97.5% \n",
" tau 1.5725862 6.351361252 10.413302141 16.97363892 27.2000793\n",
" mu -10.4120857 -0.067713166 6.905032150 10.84400497 18.8816636\n",
"eta[1] -1.1728667 0.127502592 0.761832699 1.45184594 2.2259377\n",
"eta[2] -1.5722271 -0.330428430 0.165527304 0.38331406 1.5034164\n",
"eta[3] -1.9701499 -0.838346301 -0.226005597 0.22082322 1.4088399\n",
"eta[4] -1.5492714 -0.408090584 0.188031876 0.42874867 1.6458610\n",
"eta[5] -1.9629868 -0.956440458 -0.235636020 0.61545328 1.1176237\n",
"eta[6] -1.7834951 -0.641866111 -0.042730689 0.17197250 1.1906110\n",
"eta[7] -1.0552292 0.125584701 0.651236802 1.03628935 1.8405283\n",
"eta[8] -1.7019302 -0.265362431 0.008813590 0.61733141 1.7965113\n",
"\n"
]
}
],
"source": [
"## MCMC Simulations\n",
"sim = mcmc(model, schools_dat, inits, 1000,burnin=500,thin=1, chains=4)\n",
"describe(sim)"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"image/svg+xml": [
"\n",
"\n"
],
"text/html": [
"\n",
"\n"
],
"text/plain": [
"Compose.SVG(203.2mm, 203.2mm, IOBuffer(data=UInt8[...], readable=true, writable=true, seekable=true, append=false, size=137559, maxsize=Inf, ptr=137560, mark=-1), nothing, \"img-92ee4c93\", 0, Compose.SVGPropertyFrame[], Dict{Type,Union{Compose.Property, Void}}(Pair{Type,Union{Compose.Property, Void}}(Compose.Property{Compose.SVGClassPrimitive}, nothing),Pair{Type,Union{Compose.Property, Void}}(Compose.Property{Compose.StrokePrimitive}, nothing)), Dict{Compose.ClipPrimitive,String}(Pair{Compose.ClipPrimitive,String}(Compose.ClipPrimitive{Tuple{Measures.Length{:mm,Float64},Measures.Length{:mm,Float64}}}(Tuple{Measures.Length{:mm,Float64},Measures.Length{:mm,Float64}}[(17.9583mm, 10.6117mm), (96.6mm, 10.6117mm), (96.6mm, 48.4483mm), (17.9583mm, 48.4483mm)]), \"img-92ee4c93-69\"),Pair{Compose.ClipPrimitive,String}(Compose.ClipPrimitive{Tuple{Measures.Length{:mm,Float64},Measures.Length{:mm,Float64}}}(Tuple{Measures.Length{:mm,Float64},Measures.Length{:mm,Float64}}[(117.885mm, 146.078mm), (198.2mm, 146.078mm), (198.2mm, 183.915mm), (117.885mm, 183.915mm)]), \"img-92ee4c93-4\"),Pair{Compose.ClipPrimitive,String}(Compose.ClipPrimitive{Tuple{Measures.Length{:mm,Float64},Measures.Length{:mm,Float64}}}(Tuple{Measures.Length{:mm,Float64},Measures.Length{:mm,Float64}}[(121.905mm, 10.6117mm), (198.2mm, 10.6117mm), (198.2mm, 48.4483mm), (121.905mm, 48.4483mm)]), \"img-92ee4c93-56\"),Pair{Compose.ClipPrimitive,String}(Compose.ClipPrimitive{Tuple{Measures.Length{:mm,Float64},Measures.Length{:mm,Float64}}}(Tuple{Measures.Length{:mm,Float64},Measures.Length{:mm,Float64}}[(121.905mm, 78.345mm), (198.2mm, 78.345mm), (198.2mm, 116.182mm), (121.905mm, 116.182mm)]), \"img-92ee4c93-30\"),Pair{Compose.ClipPrimitive,String}(Compose.ClipPrimitive{Tuple{Measures.Length{:mm,Float64},Measures.Length{:mm,Float64}}}(Tuple{Measures.Length{:mm,Float64},Measures.Length{:mm,Float64}}[(17.3983mm, 146.078mm), (96.6mm, 146.078mm), (96.6mm, 183.915mm), (17.3983mm, 183.915mm)]), \"img-92ee4c93-17\"),Pair{Compose.ClipPrimitive,String}(Compose.ClipPrimitive{Tuple{Measures.Length{:mm,Float64},Measures.Length{:mm,Float64}}}(Tuple{Measures.Length{:mm,Float64},Measures.Length{:mm,Float64}}[(19.0717mm, 78.345mm), (96.6mm, 78.345mm), (96.6mm, 116.182mm), (19.0717mm, 116.182mm)]), \"img-92ee4c93-43\")), Tuple{Compose.FormPrimitive,String}[], Set{AbstractString}(), true, false, nothing, true, \"img-92ee4c93-78\", false, 78, AbstractString[\"C:\\\\Users\\\\Takeshi\\\\.julia\\\\v0.6\\\\Gadfly\\\\src\\\\gadfly.js\", \"C:\\\\Users\\\\Takeshi\\\\.julia\\\\v0.6\\\\Gadfly\\\\src\\\\gadfly.js\", \"C:\\\\Users\\\\Takeshi\\\\.julia\\\\v0.6\\\\Gadfly\\\\src\\\\gadfly.js\", \"C:\\\\Users\\\\Takeshi\\\\.julia\\\\v0.6\\\\Gadfly\\\\src\\\\gadfly.js\", \"C:\\\\Users\\\\Takeshi\\\\.julia\\\\v0.6\\\\Gadfly\\\\src\\\\gadfly.js\", \"C:\\\\Users\\\\Takeshi\\\\.julia\\\\v0.6\\\\Gadfly\\\\src\\\\gadfly.js\"], Tuple{AbstractString,AbstractString}[(\"Snap.svg\", \"Snap\"), (\"Gadfly\", \"Gadfly\"), (\"Gadfly\", \"Gadfly\"), (\"Gadfly\", \"Gadfly\"), (\"Gadfly\", \"Gadfly\"), (\"Gadfly\", \"Gadfly\"), (\"Gadfly\", \"Gadfly\")], AbstractString[\"fig.select(\\\"#img-92ee4c93-5\\\")\\n .init_gadfly();\", \"fig.select(\\\"#img-92ee4c93-18\\\")\\n .init_gadfly();\", \"fig.select(\\\"#img-92ee4c93-31\\\")\\n .init_gadfly();\", \"fig.select(\\\"#img-92ee4c93-44\\\")\\n .init_gadfly();\", \"fig.select(\\\"#img-92ee4c93-57\\\")\\n .init_gadfly();\", \"fig.select(\\\"#img-92ee4c93-70\\\")\\n .init_gadfly();\"], false, :none)"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Press ENTER to draw next plot\n",
"STDIN> \n"
]
},
{
"data": {
"image/svg+xml": [
"\n",
"\n"
],
"text/html": [
"\n",
"\n"
],
"text/plain": [
"Compose.SVG(203.2mm, 203.2mm, IOBuffer(data=UInt8[...], readable=true, writable=true, seekable=true, append=false, size=137957, maxsize=Inf, ptr=137958, mark=-1), nothing, \"img-20052038\", 0, Compose.SVGPropertyFrame[], Dict{Type,Union{Compose.Property, Void}}(Pair{Type,Union{Compose.Property, Void}}(Compose.Property{Compose.SVGClassPrimitive}, nothing),Pair{Type,Union{Compose.Property, Void}}(Compose.Property{Compose.StrokePrimitive}, nothing)), Dict{Compose.ClipPrimitive,String}(Pair{Compose.ClipPrimitive,String}(Compose.ClipPrimitive{Tuple{Measures.Length{:mm,Float64},Measures.Length{:mm,Float64}}}(Tuple{Measures.Length{:mm,Float64},Measures.Length{:mm,Float64}}[(117.885mm, 146.078mm), (198.2mm, 146.078mm), (198.2mm, 183.915mm), (117.885mm, 183.915mm)]), \"img-20052038-4\"),Pair{Compose.ClipPrimitive,String}(Compose.ClipPrimitive{Tuple{Measures.Length{:mm,Float64},Measures.Length{:mm,Float64}}}(Tuple{Measures.Length{:mm,Float64},Measures.Length{:mm,Float64}}[(17.3983mm, 78.345mm), (96.6mm, 78.345mm), (96.6mm, 116.182mm), (17.3983mm, 116.182mm)]), \"img-20052038-43\"),Pair{Compose.ClipPrimitive,String}(Compose.ClipPrimitive{Tuple{Measures.Length{:mm,Float64},Measures.Length{:mm,Float64}}}(Tuple{Measures.Length{:mm,Float64},Measures.Length{:mm,Float64}}[(17.3983mm, 10.6117mm), (96.6mm, 10.6117mm), (96.6mm, 48.4483mm), (17.3983mm, 48.4483mm)]), \"img-20052038-69\"),Pair{Compose.ClipPrimitive,String}(Compose.ClipPrimitive{Tuple{Measures.Length{:mm,Float64},Measures.Length{:mm,Float64}}}(Tuple{Measures.Length{:mm,Float64},Measures.Length{:mm,Float64}}[(117.885mm, 78.345mm), (198.2mm, 78.345mm), (198.2mm, 116.182mm), (117.885mm, 116.182mm)]), \"img-20052038-30\"),Pair{Compose.ClipPrimitive,String}(Compose.ClipPrimitive{Tuple{Measures.Length{:mm,Float64},Measures.Length{:mm,Float64}}}(Tuple{Measures.Length{:mm,Float64},Measures.Length{:mm,Float64}}[(117.885mm, 10.6117mm), (198.2mm, 10.6117mm), (198.2mm, 48.4483mm), (117.885mm, 48.4483mm)]), \"img-20052038-56\"),Pair{Compose.ClipPrimitive,String}(Compose.ClipPrimitive{Tuple{Measures.Length{:mm,Float64},Measures.Length{:mm,Float64}}}(Tuple{Measures.Length{:mm,Float64},Measures.Length{:mm,Float64}}[(17.3983mm, 146.078mm), (96.6mm, 146.078mm), (96.6mm, 183.915mm), (17.3983mm, 183.915mm)]), \"img-20052038-17\")), Tuple{Compose.FormPrimitive,String}[], Set{AbstractString}(), true, false, nothing, true, \"img-20052038-78\", false, 78, AbstractString[\"C:\\\\Users\\\\Takeshi\\\\.julia\\\\v0.6\\\\Gadfly\\\\src\\\\gadfly.js\", \"C:\\\\Users\\\\Takeshi\\\\.julia\\\\v0.6\\\\Gadfly\\\\src\\\\gadfly.js\", \"C:\\\\Users\\\\Takeshi\\\\.julia\\\\v0.6\\\\Gadfly\\\\src\\\\gadfly.js\", \"C:\\\\Users\\\\Takeshi\\\\.julia\\\\v0.6\\\\Gadfly\\\\src\\\\gadfly.js\", \"C:\\\\Users\\\\Takeshi\\\\.julia\\\\v0.6\\\\Gadfly\\\\src\\\\gadfly.js\", \"C:\\\\Users\\\\Takeshi\\\\.julia\\\\v0.6\\\\Gadfly\\\\src\\\\gadfly.js\"], Tuple{AbstractString,AbstractString}[(\"Snap.svg\", \"Snap\"), (\"Gadfly\", \"Gadfly\"), (\"Gadfly\", \"Gadfly\"), (\"Gadfly\", \"Gadfly\"), (\"Gadfly\", \"Gadfly\"), (\"Gadfly\", \"Gadfly\"), (\"Gadfly\", \"Gadfly\")], AbstractString[\"fig.select(\\\"#img-20052038-5\\\")\\n .init_gadfly();\", \"fig.select(\\\"#img-20052038-18\\\")\\n .init_gadfly();\", \"fig.select(\\\"#img-20052038-31\\\")\\n .init_gadfly();\", \"fig.select(\\\"#img-20052038-44\\\")\\n .init_gadfly();\", \"fig.select(\\\"#img-20052038-57\\\")\\n .init_gadfly();\", \"fig.select(\\\"#img-20052038-70\\\")\\n .init_gadfly();\"], false, :none)"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Press ENTER to draw next plot\n",
"STDIN> \n"
]
},
{
"data": {
"image/svg+xml": [
"\n",
"\n"
],
"text/html": [
"\n",
"\n"
],
"text/plain": [
"Compose.SVG(203.2mm, 203.2mm, IOBuffer(data=UInt8[...], readable=true, writable=true, seekable=true, append=false, size=138407, maxsize=Inf, ptr=138408, mark=-1), nothing, \"img-18584ec1\", 0, Compose.SVGPropertyFrame[], Dict{Type,Union{Compose.Property, Void}}(Pair{Type,Union{Compose.Property, Void}}(Compose.Property{Compose.SVGClassPrimitive}, nothing),Pair{Type,Union{Compose.Property, Void}}(Compose.Property{Compose.StrokePrimitive}, nothing)), Dict{Compose.ClipPrimitive,String}(Pair{Compose.ClipPrimitive,String}(Compose.ClipPrimitive{Tuple{Measures.Length{:mm,Float64},Measures.Length{:mm,Float64}}}(Tuple{Measures.Length{:mm,Float64},Measures.Length{:mm,Float64}}[(119.558mm, 146.078mm), (198.2mm, 146.078mm), (198.2mm, 183.915mm), (119.558mm, 183.915mm)]), \"img-18584ec1-4\"),Pair{Compose.ClipPrimitive,String}(Compose.ClipPrimitive{Tuple{Measures.Length{:mm,Float64},Measures.Length{:mm,Float64}}}(Tuple{Measures.Length{:mm,Float64},Measures.Length{:mm,Float64}}[(17.3983mm, 146.078mm), (96.6mm, 146.078mm), (96.6mm, 183.915mm), (17.3983mm, 183.915mm)]), \"img-18584ec1-17\"),Pair{Compose.ClipPrimitive,String}(Compose.ClipPrimitive{Tuple{Measures.Length{:mm,Float64},Measures.Length{:mm,Float64}}}(Tuple{Measures.Length{:mm,Float64},Measures.Length{:mm,Float64}}[(117.885mm, 78.345mm), (198.2mm, 78.345mm), (198.2mm, 116.182mm), (117.885mm, 116.182mm)]), \"img-18584ec1-30\"),Pair{Compose.ClipPrimitive,String}(Compose.ClipPrimitive{Tuple{Measures.Length{:mm,Float64},Measures.Length{:mm,Float64}}}(Tuple{Measures.Length{:mm,Float64},Measures.Length{:mm,Float64}}[(120.232mm, 10.6117mm), (198.2mm, 10.6117mm), (198.2mm, 48.4483mm), (120.232mm, 48.4483mm)]), \"img-18584ec1-56\"),Pair{Compose.ClipPrimitive,String}(Compose.ClipPrimitive{Tuple{Measures.Length{:mm,Float64},Measures.Length{:mm,Float64}}}(Tuple{Measures.Length{:mm,Float64},Measures.Length{:mm,Float64}}[(17.3983mm, 10.6117mm), (96.6mm, 10.6117mm), (96.6mm, 48.4483mm), (17.3983mm, 48.4483mm)]), \"img-18584ec1-69\"),Pair{Compose.ClipPrimitive,String}(Compose.ClipPrimitive{Tuple{Measures.Length{:mm,Float64},Measures.Length{:mm,Float64}}}(Tuple{Measures.Length{:mm,Float64},Measures.Length{:mm,Float64}}[(17.3983mm, 78.345mm), (96.6mm, 78.345mm), (96.6mm, 116.182mm), (17.3983mm, 116.182mm)]), \"img-18584ec1-43\")), Tuple{Compose.FormPrimitive,String}[], Set{AbstractString}(), true, false, nothing, true, \"img-18584ec1-78\", false, 78, AbstractString[\"C:\\\\Users\\\\Takeshi\\\\.julia\\\\v0.6\\\\Gadfly\\\\src\\\\gadfly.js\", \"C:\\\\Users\\\\Takeshi\\\\.julia\\\\v0.6\\\\Gadfly\\\\src\\\\gadfly.js\", \"C:\\\\Users\\\\Takeshi\\\\.julia\\\\v0.6\\\\Gadfly\\\\src\\\\gadfly.js\", \"C:\\\\Users\\\\Takeshi\\\\.julia\\\\v0.6\\\\Gadfly\\\\src\\\\gadfly.js\", \"C:\\\\Users\\\\Takeshi\\\\.julia\\\\v0.6\\\\Gadfly\\\\src\\\\gadfly.js\", \"C:\\\\Users\\\\Takeshi\\\\.julia\\\\v0.6\\\\Gadfly\\\\src\\\\gadfly.js\"], Tuple{AbstractString,AbstractString}[(\"Snap.svg\", \"Snap\"), (\"Gadfly\", \"Gadfly\"), (\"Gadfly\", \"Gadfly\"), (\"Gadfly\", \"Gadfly\"), (\"Gadfly\", \"Gadfly\"), (\"Gadfly\", \"Gadfly\"), (\"Gadfly\", \"Gadfly\")], AbstractString[\"fig.select(\\\"#img-18584ec1-5\\\")\\n .init_gadfly();\", \"fig.select(\\\"#img-18584ec1-18\\\")\\n .init_gadfly();\", \"fig.select(\\\"#img-18584ec1-31\\\")\\n .init_gadfly();\", \"fig.select(\\\"#img-18584ec1-44\\\")\\n .init_gadfly();\", \"fig.select(\\\"#img-18584ec1-57\\\")\\n .init_gadfly();\", \"fig.select(\\\"#img-18584ec1-70\\\")\\n .init_gadfly();\"], false, :none)"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Press ENTER to draw next plot\n",
"STDIN> \n"
]
},
{
"data": {
"image/svg+xml": [
"\n",
"\n"
],
"text/html": [
"\n",
"\n"
],
"text/plain": [
"Compose.SVG(203.2mm, 203.2mm, IOBuffer(data=UInt8[...], readable=true, writable=true, seekable=true, append=false, size=44730, maxsize=Inf, ptr=44731, mark=-1), nothing, \"img-17555fa0\", 0, Compose.SVGPropertyFrame[], Dict{Type,Union{Compose.Property, Void}}(Pair{Type,Union{Compose.Property, Void}}(Compose.Property{Compose.SVGClassPrimitive}, nothing),Pair{Type,Union{Compose.Property, Void}}(Compose.Property{Compose.StrokePrimitive}, nothing)), Dict{Compose.ClipPrimitive,String}(Pair{Compose.ClipPrimitive,String}(Compose.ClipPrimitive{Tuple{Measures.Length{:mm,Float64},Measures.Length{:mm,Float64}}}(Tuple{Measures.Length{:mm,Float64},Measures.Length{:mm,Float64}}[(17.3983mm, 10.6117mm), (96.6mm, 10.6117mm), (96.6mm, 48.4483mm), (17.3983mm, 48.4483mm)]), \"img-17555fa0-17\"),Pair{Compose.ClipPrimitive,String}(Compose.ClipPrimitive{Tuple{Measures.Length{:mm,Float64},Measures.Length{:mm,Float64}}}(Tuple{Measures.Length{:mm,Float64},Measures.Length{:mm,Float64}}[(117.885mm, 10.6117mm), (198.2mm, 10.6117mm), (198.2mm, 48.4483mm), (117.885mm, 48.4483mm)]), \"img-17555fa0-4\")), Tuple{Compose.FormPrimitive,String}[], Set{AbstractString}(), true, false, nothing, true, \"img-17555fa0-26\", false, 26, AbstractString[\"C:\\\\Users\\\\Takeshi\\\\.julia\\\\v0.6\\\\Gadfly\\\\src\\\\gadfly.js\", \"C:\\\\Users\\\\Takeshi\\\\.julia\\\\v0.6\\\\Gadfly\\\\src\\\\gadfly.js\"], Tuple{AbstractString,AbstractString}[(\"Snap.svg\", \"Snap\"), (\"Gadfly\", \"Gadfly\"), (\"Gadfly\", \"Gadfly\")], AbstractString[\"fig.select(\\\"#img-17555fa0-5\\\")\\n .init_gadfly();\", \"fig.select(\\\"#img-17555fa0-18\\\")\\n .init_gadfly();\"], false, :none)"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"p=plot(sim)\n",
"draw(p)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Julia 0.6.1",
"language": "julia",
"name": "julia-0.6"
},
"language_info": {
"file_extension": ".jl",
"mimetype": "application/julia",
"name": "julia",
"version": "0.6.1"
}
},
"nbformat": 4,
"nbformat_minor": 2
}