This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using MeasureTheory | |
using MaskArrays | |
using Soss | |
using TransformVariables | |
a = rand(Cauchy() ^ 10) | |
b = rand(Cauchy() ^ 10) | |
x = a' .+ b .+ randn(10,10) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Soss | |
using MeasureTheory | |
minit = @model begin | |
s ~ Poisson(300_000_000) | |
i ~ Dirac(1) | |
r ~ Dirac(0) | |
d ~ Dirac(0) | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using DynamicIterators | |
using MeasureTheory | |
using ConcreteStructs | |
abstract type Step end | |
struct Sample <: Step end | |
sample = Sample() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
julia> using StructArrays | |
julia> using ForwardDiff | |
julia> function partiali(n,i) | |
ith = zeros(n) | |
ith[i] += 1 | |
function (f,x) | |
sa = StructArray{ForwardDiff.Dual{}}((x, ith)) | |
return f(sa) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using IRTools: @dynamo, IR, xcall, arguments, insertafter!, recurse!, self | |
mutable struct CallStack | |
count::Int | |
end | |
inc!(d::CallStack) = d.count += 1 | |
dec!(d::CallStack) = d.count -= 1 | |
function hook0(callstack::CallStack, f, args...) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This file is machine-generated - editing it directly is not advised | |
[[AbstractAlgebra]] | |
deps = ["InteractiveUtils", "LinearAlgebra", "Markdown", "Random", "RandomExtensions", "SparseArrays", "Test"] | |
git-tree-sha1 = "7df2949bfd757e426897a4b579fbd5dc776ff8c9" | |
uuid = "c3fe647b-3220-5bb0-a1ea-a7954cac585d" | |
version = "0.12.0" | |
[[AbstractLattices]] | |
git-tree-sha1 = "f35684b7349da49fcc8a9e520e30e45dbb077166" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Soss | |
using Distributions | |
mstep = @model pars,state begin | |
# Parameters | |
α = pars.α # Daily transmission rate | |
βγ = pars.βγ # Daily recovery rate, case fatality rate | |
# Starting counts | |
s0 = state.s # Susceptible |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
JuliaActuary/MortalityTables.jl | |
JuliaActuary/DynamicPolynomials.jl | |
JuliaActuary/FixedPolynomials.jl | |
JuliaActuary/MultivariateBases.jl | |
JuliaActuary/MultivariateMoments.jl | |
JuliaActuary/MultivariatePolynomials.jl | |
JuliaActuary/SemialgebraicSets.jl | |
JuliaActuary/StaticPolynomials.jl | |
JuliaActuary/TypedPolynomials.jl |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import PyCall,SymPy | |
using MLStyle | |
stats = PyCall.pyimport_conda("sympy.stats", "sympy"); | |
SymPy.import_from(stats) | |
sym(x) = SymPy.symbols(x); | |
macro ℓ(expr) | |
args = @match expr begin |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Transducers | |
T = Transducers | |
struct MeanVar <: Transducer | |
end | |
function T.start(rf::T.R_{MeanVar}, result) | |
private_state = (0, 0.0, 0.0) |