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> | |
| shell> cd example/phylo3/ | |
| /Users/smoritz/.julia/dev/MitosisStochasticDiffEq/example/phylo3 | |
| julia> include("phylo_autobffg3.jl") | |
| Activating environment at `~/.julia/dev/MitosisStochasticDiffEq/example/phylo3/Project.toml` | |
| Internal error: encountered unexpected error in runtime: | |
| BoundsError(a=Array{Int64, (30,)}[0, 0, 2, 2, 2, 1, 0, 0, 0, 0, 2, 2, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 3, 0, 0, 0, 1, 0, 0, 0], i=(66,)) | |
| jl_bounds_error_ints at /Applications/Julia-1.6.app/Contents/Resources/julia/lib/julia/libjulia-internal.1.6.dylib (unknown line) |
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 ZigZagBoomerang | |
| using SparseArrays | |
| using ForwardDiff | |
| using ForwardDiff: Dual, value, partials | |
| const D1 = Dual{Nothing, Float64, 1} | |
| const D𝕏 = typeof(D1.(zero(𝕏))) | |
| function partiali(F, z, i) | |
| z[i] = Dual(z[i], 1.0) | |
| r = partials(F(z))[] | |
| z[i] = Dual(z[i], 0.0) |
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
| d = 100 | |
| ts_ = range(0, 1, length=d+1)[2:end] | |
| Γ = SymTridiagonal([2.0ones(d-1); 1.0], -ones(d-1))/ts_[1] | |
| # Note the covariance matrix of B.M is | |
| ts = range(0, 1, length=d+1)[2:end] | |
| Γ0 = inv([min(i,j) for i in ts_, j in ts_]) | |
| @test norm(Γ0 - Γ) < 1e-7 |
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 ZigZagBoomerang | |
| using StaticArrays | |
| using LinearAlgebra | |
| using SparseArrays | |
| using Random | |
| using Test | |
| using Statistics | |
| Random.seed!(2) | |
| using StaticArrays |
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: logdensity, xform, ConditionalModel | |
| using ZigZagBoomerang | |
| using ForwardDiff | |
| using ForwardDiff: gradient! | |
| using LinearAlgebra | |
| using SparseArrays | |
| using StructArrays | |
| using TransformVariables |
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
| xnew = sample(A[x, :]) | |
| struct TransitionKernel | |
| A::Matrix | |
| end | |
| (kappa::TransitionKernel)(x) = kappa.A[x, :] | |
| A = [0.5 0.5 0 | |
| 0 0.3 0.7 |
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
| export basemeasure | |
| import MeasureTheory | |
| function MeasureTheory.basemeasure(c::ConditionalModel{A,B,M}, x=NamedTuple()) where {A,B,M} | |
| _basemeasure(M, Model(c), argvals(c), observations(c), x) | |
| end | |
| export sourceBasemeasure |
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 Mitosis | |
| using MeasureTheory | |
| using Random | |
| using Test | |
| n = 30 | |
| ρ = rand(n) | |
| struct PlusBernoulli{S,T} <: MeasureTheory.AbstractMeasure | |
| x::S |
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 ZigZagBoomerang | |
| using Distributions | |
| using SparseArrays | |
| using LinearAlgebra | |
| using Random | |
| Random.seed!(1) | |
| # Million data points, 5 parameters + intercept | |
| N = 1000000 | |
| k = 5; | |
| X = randn(N,k); |