{{ message }}

Instantly share code, notes, and snippets.

👶
I may be slow to respond.

# David Widmann devmotion

👶
I may be slow to respond.
Created Aug 30, 2021
View debug.txt
This file contains 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 DynamicPPL julia> @model function demo4(n, ::Type{TV}=Vector{Float64}) where {TV} m ~ Normal() x = TV(undef, n) @show __varinfo__ for i in eachindex(x) x[i] ~ Normal(m, 1.0) end end
Created Jun 1, 2021
View discrete1d_benchmarks.jl
This file contains 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 BenchmarkTools using Distances using Distributions using StatsBase using LinearAlgebra using SparseArrays function f( c, μ::DiscreteNonParametric, ν::DiscreteNonParametric, plan::SparseMatrixCSC
Created May 24, 2021
Discrete OT
View ot.jl
This file contains 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 Distributions using SparseArrays using LinearAlgebra using StatsBase function _ot_cost_plan(c, μ::DiscreteNonParametric, ν::DiscreteNonParametric; get=:plan) len_μ = length(μ.p) len_ν = length(ν.p) wi = μ.p[1] wj = ν.p[1]
Last active May 17, 2021
SDE inference (based on https://gist.github.com/mschauer/d1b95bc7031eb858e94de9fb86622c75)
View sde.jl
This file contains 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 AdvancedMH using ArraysOfArrays using CairoMakie using DiffEqNoiseProcess using Distributions using StochasticDiffEq using Turing using Random struct CrankNicolsonProposal{P,T} <: AdvancedMH.Proposal{P}
Created May 27, 2020
emcee
View emcee.ipynb
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Created Dec 28, 2019
View processes.jl
This file contains 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 Turing using Turing.RandomMeasures using Random function stickbreaking(rpm = DirichletProcess(0.25)) # Data data = [-2,2,-1.5,1.5] # Base distribution
Last active Dec 19, 2019
ESS examples
View examples.jl
This file contains 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 Turing using StatsPlots using Random using Statistics function demo(N::Int; n::Int = 10) # observation noise σ² = 0.3
Last active Nov 24, 2019
Elliptical slice sampling
View demo.jl
This file contains 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 Turing using StatsPlots using Random using Statistics function demo(N::Int; n::Int = 10) # observation noise σ² = 0.3
Last active Jul 31, 2019
DDE parameter estimation
View blackboxoptim.jl
This file contains 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 DelayDiffEq, DiffEqParamEstim, BlackBoxOptim, DataFrames, LsqFit using Plots gr() include("importData.jl") include("plot.jl") # import data from the path, in which: # pop: population data # g1, g2: g1 and g2 data
Created Aug 5, 2018
Interpolation benchmarks
View benchmark.jl
This file contains 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 MuladdMacro, EllipsisNotation, BenchmarkTools # In place @generated function f_loop!(out, dt, y, k, b, idxs::Nothing, ::Type{Val{N}}) where N sumexpr = :(+(\$((:(k[\$i][idx]*b[\$i]) for i in 1:N)...))) quote @muladd @inbounds for idx in eachindex(out) out[idx] = y[idx] + dt*\$sumexpr end