text:
if !(VERSION.major == 0 && VERSION.minor <= 6)
    using Test
else
    using Base.Test
end
using FinancialToolbox

print_colored("Starting Complex Number Test\n", :green)

#Test Parameters
testToll = 1e-14;
spot = 10;
K = 10;
r = 0.02;
T = 2.0;
sigma = 0.2;
d = 0.01;
assert_(value, toll) = @test abs(value) < toll

#EuropeanCall Option
PriceCall = blsprice(spot, K, r, T, sigma, d);
DeltaCall = blsdelta(spot, K, r, T, sigma, d);
ThetaCall = blstheta(spot, K, r, T, sigma, d);
LambdaCall = blslambda(spot, K, r, T, sigma, d);
RhoCall = blsrho(spot, K, r, T, sigma, d);

#EuropeanPut Option
PricePut = blsprice(spot, K, r, T, sigma, d, false);
DeltaPut = blsdelta(spot, K, r, T, sigma, d, false);
ThetaPut = blstheta(spot, K, r, T, sigma, d, false);
RhoPut = blsrho(spot, K, r, T, sigma, d, false);
LambdaPut = blslambda(spot, K, r, T, sigma, d, false);

#Equals for both Options
Gamma = blsgamma(spot, K, r, T, sigma, d);
Vega = blsvega(spot, K, r, T, sigma, d);

## Complex Test with Complex Step Approximation for European Call
#Test parameters
DerToll = 1e-13;
di = 1e-15;
df(f, x) = f(x + 1im * di) / di;
#Function definition
Fcall1(spot) = blsprice(spot, K, r, T, sigma, d);
Gcall1(r) = blsprice(spot, K, r, T, sigma, d);
Hcall1(T) = blsprice(spot, K, r, T, sigma, d);
Lcall1(sigma) = blsprice(spot, K, r, T, sigma, d);
Pcall1(spot) = blsprice(spot, K, r, T, sigma, d) * spot.re / blsprice(spot.re, K, r, T, sigma, d);
#TEST
print_colored("--- European Call Sensitivities: Complex Step Approximation\n", :yellow)
print_colored("-----Testing Delta\n", :blue);
assert_(df(Fcall1, spot).im - DeltaCall, DerToll)
print_colored("-----Testing Rho\n", :blue);
assert_(df(Gcall1, r).im - RhoCall, DerToll)
print_colored("-----Testing Theta\n", :blue);
assert_(-df(Hcall1, T).im - ThetaCall, DerToll)
print_colored("-----Testing Lambda\n", :blue);
assert_(df(Pcall1, spot).im - LambdaCall, DerToll)

## Complex Test with Complex Step Approximation for European Put
#Function definition
Fput1(spot) = blsprice(spot, K, r, T, sigma, d, false);
Gput1(r) = blsprice(spot, K, r, T, sigma, d, false);
Hput1(T) = blsprice(spot, K, r, T, sigma, d, false);
Pput1(spot) = blsprice(spot, K, r, T, sigma, d, false) * spot.re / blsprice(spot.re, K, r, T, sigma, d, false);
#TEST
print_colored("--- European Put Sensitivities: Complex Step Approximation\n", :yellow)
print_colored("-----Testing Delta\n", :blue);
assert_(df(Fput1, spot).im - DeltaPut, DerToll)
print_colored("-----Testing Rho\n", :blue);
assert_(df(Gput1, r).im - RhoPut, DerToll)
print_colored("-----Testing Theta\n", :blue);
assert_(-df(Hput1, T).im - ThetaPut, DerToll)
print_colored("-----Testing Lambda\n", :blue);
assert_(df(Pput1, spot).im - LambdaPut, DerToll)

print_colored("-----Testing Vega\n", :blue);
assert_(df(Lcall1, sigma).im - Vega, DerToll)
print_colored("Complex Number Test Passed\n", :green)
println("")

#TEST OF INPUT VALIDATION
print_colored("Starting Input Validation Test Complex\n", :magenta)
print_colored("----Testing Negative  Spot Price \n", :cyan)
@test_throws(ErrorException, blsprice(-spot + 1im, K, r, T, sigma, d))
@test_throws(ErrorException, blkprice(-spot + 1im, K, r, T, sigma))
@test_throws(ErrorException, blsdelta(-spot + 1im, K, r, T, sigma, d))
@test_throws(ErrorException, blsgamma(-spot + 1im, K, r, T, sigma, d))
@test_throws(ErrorException, blstheta(-spot + 1im, K, r, T, sigma, d))
@test_throws(ErrorException, blsrho(-spot + 1im, K, r, T, sigma, d))
@test_throws(ErrorException, blspsi(-spot + 1im, K, r, T, sigma, d))
@test_throws(ErrorException, blslambda(-spot + 1im, K, r, T, sigma, d))
@test_throws(ErrorException, blsvanna(-spot + 1im, K, r, T, sigma, d))
@test_throws(ErrorException, blsvega(-spot + 1im, K, r, T, sigma, d))

print_colored("----Testing Negative  Strike Price \n", :cyan)
@test_throws(ErrorException, blsprice(spot, -K + 1im, r, T, sigma, d))
@test_throws(ErrorException, blkprice(spot, -K + 1im, r, T, sigma))
@test_throws(ErrorException, blsdelta(spot, -K + 1im, r, T, sigma, d))
@test_throws(ErrorException, blsgamma(spot, -K + 1im, r, T, sigma, d))
@test_throws(ErrorException, blstheta(spot, -K + 1im, r, T, sigma, d))
@test_throws(ErrorException, blsrho(spot, -K + 1im, r, T, sigma, d))
@test_throws(ErrorException, blspsi(spot, -K + 1im, r, T, sigma, d))
@test_throws(ErrorException, blslambda(spot, -K + 1im, r, T, sigma, d))
@test_throws(ErrorException, blsvanna(spot, -K + 1im, r, T, sigma, d))
@test_throws(ErrorException, blsvega(spot, -K + 1im, r, T, sigma, d))

print_colored("----Testing Negative  Time to Maturity \n", :cyan)
@test_throws(ErrorException, blsprice(spot, K, r, -T + 1im, sigma, d))
@test_throws(ErrorException, blkprice(spot, K, r, -T + 1im, sigma))
@test_throws(ErrorException, blsdelta(spot, K, r, -T + 1im, sigma, d))
@test_throws(ErrorException, blsgamma(spot, K, r, -T + 1im, sigma, d))
@test_throws(ErrorException, blstheta(spot, K, r, -T + 1im, sigma, d))
@test_throws(ErrorException, blsrho(spot, K, r, -T + 1im, sigma, d))
@test_throws(ErrorException, blspsi(spot, K, r, -T + 1im, sigma, d))
@test_throws(ErrorException, blslambda(spot, K, r, -T + 1im, sigma, d))
@test_throws(ErrorException, blsvanna(spot, K, r, -T + 1im, sigma, d))
@test_throws(ErrorException, blsvega(spot, K, r, -T + 1im, sigma, d))

print_colored("----Testing Negative  Volatility \n", :cyan)
@test_throws(ErrorException, blsprice(spot, K, r, T, -sigma + 1im, d))
@test_throws(ErrorException, blkprice(spot, K, r, T, -sigma + 1im))
@test_throws(ErrorException, blsdelta(spot, K, r, T, -sigma + 1im, d))
@test_throws(ErrorException, blsgamma(spot, K, r, T, -sigma + 1im, d))
@test_throws(ErrorException, blstheta(spot, K, r, T, -sigma + 1im, d))
@test_throws(ErrorException, blsrho(spot, K, r, T, -sigma + 1im, d))
@test_throws(ErrorException, blspsi(spot, K, r, T, -sigma + 1im, d))
@test_throws(ErrorException, blslambda(spot, K, r, T, -sigma + 1im, d))
@test_throws(ErrorException, blsvanna(spot, K, r, T, -sigma + 1im, d))
@test_throws(ErrorException, blsvega(spot, K, r, T, -sigma + 1im, d))

print_colored("Complex Input Validation Test Passed\n", :magenta)


text:
F(x) = sin(x[1])*cos(x[2])
npts = 1000
rng = MersenneTwister(1)
X = 2π*rand(rng, npts, 2) .- π
y = [F(X[i,:]) for i = 1:npts]

P = ShepardInterpolator(X, y)
Q = RBFInterpolator(X, y, 1.0)

x = LinRange(-π, π, 10)
y = copy(x)

errp = zeros(length(x), length(x))
errq = zeros(length(x), length(x))
for i ∈ eachindex(x)
    for j ∈ eachindex(y)
        f = F((x[i], y[j]))
        errp[i,j] = abs(P(x[i], y[j]) - f)
        errq[i,j] = abs(Q(x[i], y[j]) - f)
    end
end

@test maximum(errp) < 1
@test maximum(errq) < 0.1

ext: jl


text:
function ueberpruefeAbstand(SPX1,SPX2,dist,a,b)
eps = 1e-7;
Abstand = zeros(size(SPX1,1)-1,size(SPX1,2));

for Z = 3
    for S = 4
        if dist(3,4) == sqrt((SPX1[Z+1,S]-SPX1[Z,S])^2+(SPX2[Z+1,S]-SPX2[Z,S])^2)
            println("Eure verallgemeinerte Berechnung für den Abstand ist korrekt!")
            for Spalte = 1:size(SPX1,2)
                counter = 1;
                Schreiben = 1;
                for Zeile = 1:size(SPX1,1)-2
                    if (almostequal(SPX1[Zeile+1,Spalte], 0) && almostequal(SPX1[Zeile+2,Spalte], 0)) || (SPX1[Zeile,Spalte] <= a-eps) || (SPX2[Zeile,Spalte] <= a-eps) || (SPX1[Zeile+1,Spalte] <= a-eps) || (SPX2[Zeile+1,Spalte] <= a-eps) || (SPX1[Zeile,Spalte] >= b+eps) || (SPX2[Zeile,Spalte] >= b+eps) || (SPX1[Zeile+1,Spalte] >= b+eps) || (SPX2[Zeile+1,Spalte] >= b+eps)

                        counter = counter+1;
                    else
                        Abstand[Schreiben,Spalte] = dist(Zeile,Spalte);
                        Schreiben = Schreiben+1;
                    end
                end
                for Zeile = size(SPX1,1)-1
                    if counter >= 3

                        counter = counter+1;
                    else
                        Abstand[Schreiben,Spalte] = dist(Zeile,Spalte);
                        Schreiben = Schreiben+1;
                    end
                end
            end
            Abstand
        elseif distance(3,4) == sqrt(SPX1[Z,S+1]-SPX1[Z,S])^2+(SPX2[Z,S+1]-SPX2[Z,S])^2
            println("Die Grundidee eurer Formel ist korrekt, jedoch stehen die Schnittpunkte für einen Strahl in einer Spalte und nicht in einer Zeile.")
        end
    end
end
print("Abstand: ");
show(stdout,"text/plain",Abstand);

return Abstand;

end


text:
# Configuration for running spatial simulation
export simtype
#global simtype=1 # means spatial structure by fitness or selection coefficient adjustment
@everywhere simtype = 2
const num_trials = 1
@everywhere const N_list = [16]        # Meta-population size
#mutation_stddev_list = [0.005,0.01, 0.02, 0.05,0.1]
N_mut_list = [1.0, 2.0]
const num_subpops = 1                    # Number of subpopulations
const num_attributes_list = [1,5,10,50]        # number attributes for quantitative representation
const ngens = 200       # Generations after burn-in
const burn_in= 2.0    # generations of burn_in as a multiple of N
const ideal = 1.0
const fit_slope = 1.0
const neutral = false


text:
using MelissasModule

imprecise_trebuchet = Trebuchet(500.0, 0.25pi)
environment = Environment(5, 100)
precise_trebuchet = aim(imprecise_trebuchet, environment)
shoot_distance(precise_trebuchet, environment)


text:
using SparseSpatialPrecisionMatrices
using Plots
using TriangleMesh
using Clustering
using LinearAlgebra, SparseArrays
using Distributions
using PDMats
using Random

Random.seed!(1)
n = 2_000
pts = 100 * rand(n-4, 2)

nodes = collect(kmeans(pts', 500).centers')
# corners = [-20 -20; 120 -20; 120 120; -20 120]
corners = [0 0; 100 0; 100 100; 0 100]

mesh = create_mesh([nodes; corners])
mesh = refine(mesh, divide_cell_into=4, voronoi=true)
scatter(mesh.point[1, :], mesh.point[2, :])

r = 15 # decorrelation range
σ = 5 # marginal variance
ν = 2  # smoothness parameter

Q = precision_matrix(mesh, r, σ, ν)
isposdef(Q)
length(nnz(Q.data)) / length(Q)

U = cholesky(Q).PtL'

x = U \ randn(mesh.n_point)
surface(mesh.point[1, :], mesh.point[2, :], x, zlim=4*[-σ, σ], camera=(45, 80))

xg = U \ rand(Gamma(0.1, 100), mesh.n_point)
surface(mesh.point[1, :], mesh.point[2, :], xg, camera=(45, 80))

D = MvNormalCanon(PDSparseMat(sparse(Q)))
logpdf(D, x)


text:
function sqarea_triangle(a::T,b::T,c::T) where {T <: Real}
# How to compute (twice) area squared of triangle with
# high precision (Goldberg 1991):
a,b,c=reverse(sort([a,b,c]))
area = (a+(b+c))*(c-(a-b))*(c+(a-b))*(a+(b-c))
return area
end

# Shows the overlap area accuracy for the two formulae:

# 1). Mandel & Agol:

function circle_overlap(r,b)
kap1 = acos((1-r^2+b^2)/(2*b))
kap0 = acos((r^2+b^2-1)/(2*b*r))
akite = sqrt((4*b^2-(1+b^2-r^2)^2)/4)
area = r^2*kap0+kap1-akite

# 2). Luger & Agol:

kite_area2 = sqrt(sqarea_triangle(one(r),b,r))
# Angle of section for occultor:
kap0  = atan(kite_area2,(r-1)*(r+1)+b^2)
# Angle of section for source:
kap1 = atan(kite_area2,-((r-1)*(r+1)-b^2))
# Flux of visible uniform disk:
sn = kap1 + r^2*kap0 - .5*kite_area2

# Now at high precision:
r_big = big(r); b_big=big(b)
kite_area2_big = sqrt(sqarea_triangle(big(1.0),b_big,r_big))
# Angle of section for occultor:
kap0_big  = atan(kite_area2,(r_big-1)*(r_big+1)+b_big^2)
# Angle of section for source:
kap1_big = atan(kite_area2_big,-((r_big-1)*(r_big+1)-b_big^2))
# Flux of visible uniform disk:
sn_big = kap1_big + r_big^2*kap0_big - 0.5*kite_area2_big

return area,sn,sn_big
end

using PyPlot
fig,axes = subplots(2,2,figsize=(12, 7))
fig[:subplots_adjust](wspace=0.25)

r = 0.1
nb = 1000
db = 10 .^ range(-15, stop=-2, length=nb)
b = 1 - r .+ db
area=zeros(nb); sn=zeros(nb); sn_big=zeros(BigFloat,nb)
for i=1:nb
  area[i],sn[i],sn_big[i] = circle_overlap(r,b[i])
end

ax = axes[1]
ax[:plot](db,abs.(pi*r^2 .- area),label=L"$r=0.1$, MA (2002)",lw=2)
ax[:plot](db,abs.(pi*r^2 .- sn),label=L"$r=0.1$, ALFM (2019)",".")
ax[:plot](db,abs.(convert(Array{Float64,1},pi*big(r)^2 .- sn_big)),label=L"$r=0.1$, BigFloat",linestyle="--",lw=2)
ax[:set_ylabel](L"$\pi r^2 - A_\mathrm{overlap}$", fontsize=16)
ax[:legend](loc="lower right",fontsize=11)
ax[:set_xscale]("log")
ax[:set_yscale]("log")
ax[:axis]([1e-15,1e-2,1e-25,1e-2])
ax[:plot]([1e-16,1e-2],[1,1]*(pi*0.1^2/2^53),c="grey",linestyle="-.")

ax = fig[:add_axes]((0.25, 0.925, 0.1, 0.1))
t1 = range(0, stop=2pi, length=100)
x1 = cos.(t1); y1 = sin.(t1)
x2 = 0.8 .+ 0.2 * cos.(t1); y2 = 0.2 * sin.(t1)
ax[:plot](x1,y1,"k-",lw=1.5)
ax[:fill_between](x2,0,y2,facecolor="k")
ax[:set_aspect](1)
ax[:axis]("off")

ax = fig[:add_axes]((0.685, 0.925, 0.1, 0.1))
x1 = cos.(t1); y1 = sin.(t1)
x2 = 1.2 .+ 0.2 * cos.(t1); y2 = 0.2 * sin.(t1)
ax[:plot](x1,y1,"k-",lw=1.5)
ax[:fill_between](x2,0,y2,facecolor="k")
ax[:set_aspect](1)
ax[:axis]("off")

ax = axes[2]
ax[:plot](db,abs.(area-convert(Array{Float64,1},sn_big)),label=L"$r=0.1$, MA (2002)",lw=2)
ax[:plot](db,abs.(sn-convert(Array{Float64,1},sn_big)),label=L"$r=0.1$, ALFM (2019)",".")
ax[:set_xlabel](L"$b-(1-r)$", fontsize=14)
ax[:set_ylabel]("error", fontsize=14)
ax[:legend](loc="upper right",fontsize=11)
ax[:set_xscale]("log")
ax[:set_yscale]("log")
ax[:axis]([1e-15,1e-2,1e-25,1e-2])
ax[:plot]([1e-16,1e-2],[1,1]*(pi*0.1^2/2^53),c="grey",linestyle="-.")

b = 1 + r .- db
area=zeros(nb); sn=zeros(nb); sn_big=zeros(BigFloat,nb)
for i=1:nb
  area[i],sn[i],sn_big[i] = circle_overlap(r,b[i])
end

ax = axes[3]
mask = area .> 0.0
ax[:plot](db[mask],area[mask],label=L"$r=0.1$, MA (2002)",lw=2)
ax[:plot](db,sn,label=L"$r=0.1$, ALFM (2019)",".")
ax[:plot](db,convert(Array{Float64,1},sn_big),label=L"$r=0.1$, BigFloat",linestyle="--",lw=2)
ax[:set_ylabel](L"$A_\mathrm{overlap}$", fontsize=16)
ax[:legend](loc="lower right",fontsize=11)
ax[:set_xscale]("log")
ax[:set_yscale]("log")
ax[:axis]([1e-15,1e-2,1e-25,1e-2])

ax = axes[4]
ax[:plot](db,abs.(area-convert(Array{Float64,1},sn_big)),label=L"$r=0.1$, MA (2002)",lw=2)
ax[:plot](db,abs.(sn-convert(Array{Float64,1},sn_big)),label=L"$r=0.1$, ALFM (2019)",".")
ax[:set_ylabel]("error", fontsize=14)
ax[:set_xscale]("log")
ax[:set_yscale]("log")
ax[:set_xlabel](L"$1+r-b$", fontsize=14)
ax[:legend](loc="upper right",fontsize=11)
ax[:axis]([1e-15,1e-2,1e-25,1e-2])
savefig("area_of_overlap_r01.pdf", bbox_inches="tight")

max_stars_repo_name: dfm/limbdark

max_issues_repo_name: dfm/limbdark

max_forks_repo_name: dfm/limbdark


text:
@testset "StateSpace" begin
    @test_throws ArgumentError StateSpace([0], 1, [0.1, 1], 1)
    @test_throws ArgumentError StateSpace([1,2], -1, [0.1, 1], 1)
    @test_throws ArgumentError StateSpace([1,2], 0, [0.1, 1], 1)

    @test_throws ArgumentError StateSpace([1,2], 1, [1], 1)
    @test_throws ArgumentError StateSpace([1,2], 1, [0.1, 1], -1)
    @test_throws ArgumentError StateSpace([1,2], 1, [0.1, 1], 0)
    @test_throws ArgumentError StateSpace([1,2], 2, [0.1, 1], 1)

    let space = StateSpace([1,2], 1, [0.1, 1.0], 1)
        @test space.basis == [(1,1)]
        @test space.energy ≈ [1.1]
        @test space.deg == [1]
    end

    let space = StateSpace([1,2], 1, [0.1, 1.0], 2)
        @test space.basis == [(1,2,1)]
        @test space.energy ≈ [2.1]
        @test space.deg == [2]
    end

    let space = StateSpace([1,2], 1, [0.1, 1.0, 10.0], 2)
        @test space.basis == [(1,3,1), (1,2,1)]
        @test space.energy ≈ [11.1, 2.1]
        @test space.deg == [2,2]
    end

    let space = StateSpace([1,2], 2, [0.1, 1.0], 2)
        @test space.basis == [(2,2,2,1), (1,1,1,1)]
        @test space.energy ≈ [5.1, 2.2]
        @test space.deg == [2,1]
    end

    let space = StateSpace([1,2], 2, [0.1, 1.0, 10.0], 2)
        @test space.basis == [(2,2,3,1), (2,2,2,1), (1,1,1,1)]
        @test space.energy ≈ [14.1, 5.1, 2.2]
        @test space.deg == [2,2,1]
    end

    let space = StateSpace([1,2], 2, [0.1, 1.0], 3)
        @test space.basis == [(2,2,2,2,1), (1,1,2,1,1)]
        @test space.energy ≈ [6.1, 3.2]
        @test space.deg == [3,3]
    end

    let space = StateSpace([1,2], 2, [0.1, 1.0, 10.0], 3)
        @test space.basis == [(2,2,3,3,1), (2,2,3,2,1), (2,2,2,2,1), (1,1,3,1,1), (1,1,2,1,1)]
        @test space.energy ≈ [24.1, 15.1, 6.1, 12.2, 3.2]
        @test space.deg ==   [3,6,3,3,3]
    end

    let space = StateSpace([1,2], 3, [0.1, 1.0], 3)
        @test space.basis == [(2,2,1,2,1,1), (1,1,1,1,1,1)]
        @test space.energy ≈ [6.2, 3.3]
        @test space.deg == [9,1]
    end

    let space = StateSpace([1,2], 3, [0.1, 1.0, 10.0], 3)
        @test space.basis == [(2,2,1,3,1,1), (2,2,1,2,1,1), (1,1,1,1,1,1)]
        @test space.energy ≈ [15.2, 6.2, 3.3]
        @test space.deg == [9, 9, 1]
    end

    let space = StateSpace([1,2,3], 3, [0.1, 1.0], 3)
        @test space.basis == [(3,3,3,2,2,1), (2,2,1,2,1,1), (1,1,1,1,1,1)]
        @test space.energy ≈ [11.1, 6.2, 3.3]
        @test space.deg == [9, 9, 1]
    end

    let space = StateSpace([1,2,3], 3, [0.1, 1.0, 10.0], 3)
        @test space.basis == [(3,3,3,3,3,1), (3,3,3,3,2,1), (3,3,3,2,2,1), (2,2,1,3,1,1),
                              (2,2,1,2,1,1), (1,1,1,1,1,1)]
        @test space.energy ≈ [29.1, 20.1, 11.1, 15.2, 6.2, 3.3]
        @test space.deg == [9, 18, 9, 9, 9, 1]
    end

    let space = StateSpace([1,2,3,4], 4, [0.1, 1.0], 4)
        @test space.basis == [(4,4,4,4,2,2,2,1), (3,3,3,1,2,2,1,1),
                              (2,2,2,2,2,2,1,1), (2,2,1,1,2,1,1,1),
                              (1,1,1,1,1,1,1,1)]
        @test space.energy ≈ [19.1, 12.2, 10.2, 7.3, 4.4]
        @test space.deg == [48, 72, 18, 24, 1]
    end

    let space = StateSpace([1,2,3,4], 4, [0.1, 1.0, 10.0], 4)
        @test space.basis == [(4,4,4,4,3,3,3,1), (4,4,4,4,3,3,2,1), (4,4,4,4,3,2,2,1),
                              (4,4,4,4,2,2,2,1), (3,3,3,1,3,3,1,1), (3,3,3,1,3,2,1,1),
                              (3,3,3,1,2,2,1,1), (2,2,2,2,3,3,1,1), (2,2,2,2,3,2,1,1),
                              (2,2,2,2,2,2,1,1), (2,2,1,1,3,1,1,1), (2,2,1,1,2,1,1,1),
                              (1,1,1,1,1,1,1,1)]
        @test space.energy ≈ [46.1, 37.1, 28.1, 19.1, 30.2, 21.2, 12.2, 28.2, 19.2, 10.2, 16.3,
                              7.3, 4.4]
        @test space.deg == [48, 144, 144, 48, 72, 144, 72, 18, 36, 18, 24, 24, 1]
    end

    let space = StateSpace([1,2,3,4,5], 5, [0.1, 1.0], 5)
        @test space.basis == [(5,5,5,5,5,2,2,2,2,1), (4,4,4,4,1,2,2,2,1,1), (3,3,3,2,2,2,2,2,1,1),
                              (3,3,3,1,1,2,2,1,1,1), (2,2,2,2,1,2,2,1,1,1), (2,2,1,1,1,2,1,1,1,1),
                              (1,1,1,1,1,1,1,1,1,1)]
         @test space.energy ≈ [29.1, 20.2, 16.2, 13.3, 11.3, 8.4, 5.5]
        @test space.deg == [300, 600, 300, 300, 150, 50, 1]
    end
end

@testset "Degeneracies" begin
    let sys = StateSpace([1,2], 2, [0.1, 1.0], 2)
        deg, probs, pid = degeneracies(sys, sys)
        @test deg == [((1,2), (2,1))]
        @test probs ≈ [1/3]
        @test sum(probs) + pid ≈ 1.0
    end
    let sys = StateSpace([1,2], 4, [0.1, 1.0], 4)
        deg, probs, pid = degeneracies(sys, sys)
        @test deg == [((1,2), (2,1)), ((1,3), (3,1)), ((2,3), (3,2))]
        @test probs ≈ [186624, 324, 576] / 592500
        @test sum(probs) + pid ≈ 1.0
    end
    let sys = StateSpace(1:5, 5, [0.1, 1.0], 5)
        deg, probs, pid = degeneracies(sys, sys)
        @test deg == [((1, 2), (2, 1)), ((1, 3), (3, 1)), ((1, 4), (4, 1)), ((1, 5),
        (5, 1)), ((1, 6), (6, 1)), ((1, 7), (7, 1)), ((2, 3), (3, 2)), ((2, 4), (4, 2)),
        ((2, 5), (5, 2)), ((2, 6), (6, 2)), ((2, 7), (7, 2)), ((3, 4), (4, 3)), ((3, 5),
        (5, 3)), ((3, 6), (4, 5)), ((3, 6), (5, 4)), ((3, 6), (6, 3)), ((3, 7), (7, 3)),
        ((4, 5), (5, 4)), ((4, 5), (6, 3)), ((4, 6), (6, 4)), ((4, 7), (7, 4)), ((5, 4),
        (6, 3)), ((5, 6), (6, 5)), ((5, 7), (6, 6)), ((5, 7), (7, 5)), ((6, 6), (7, 5)),
        ((6, 7), (7, 6))]
        @test isapprox(probs, [0.0913913, 0.0228478, 0.0228478, 0.00571196, 0.000634662,
        2.53865e-7, 0.0913913, 0.0913913, 0.0228478, 0.00253865, 1.01546e-6, 0.0228478,
        0.00571196, 0.00190399, 0.00190399, 0.000634662, 2.53865e-7, 0.00571196,
        0.00190399, 0.000634662, 2.53865e-7, 0.00190399, 0.000158666, 1.05777e-6,
        6.34662e-8, 1.05777e-6, 7.0518e-9]; atol=1e-7)
        @test sum(probs) + pid ≈ 1.0
    end
end


text:
# S(u)_function.jl

"""
Implementation of FHIP's susceptibility formula S(u) for the Optical Absorption of Polarons.

See FHIP 1962, equation (36):
https://link.aps.org/doi/10.1103/PhysRev.127.1004.
"""

# Calculate the modulus-squared of the complex function D(u) from equation (35c) in FHIP.

mod_squared_D(x, y, v, w, β) = abs2(D(x, y, v, w, β))

# Calculate the complex argument of the complex function D(u) from equation (35c) in FHIP.

arg_D(x, y, v, w, β) = angle(D(x, y, v, w, β))

"""
ℜS(x::Float64, y::Float64, v::Float64, w::Float64, β::Float64, α::Float64)

    Calculate the real part of S(u) (equation (36) in FHIP) for a complex argument u = x + iy. v and w are the variational Polaron parameters that minimise the free energy, for the supplied α Frohlich coupling. β is the reduced thermodynamical beta = ħω/kT with k being Boltzman's constant.
"""
function ℜS(x, y, v, w, β, α)
    P = 1 / (exp(β) - 1)
    (2 * α / (3 * sqrt(π))) * (
        exp(-y) * (1 + P) * cos(x - 3 * arg_D(x, y, v, w, β) / 2) +
        exp(y) * P * cos(x + 3 * arg_D(x, y, v, w, β) / 2)
    ) / (mod_squared_D(x, y, v, w, β))^(3 / 4)
end

"""
ℑS(x::Float64, y::Float64, v::Float64, w::Float64, β::Float64, α::Float64)

    Calculate the imaginary part of S(u) (equation (36) in FHIP) for a complex argument u = x + iy. v and w are the variational Polaron parameters that minimise the free energy, for the supplied α Frohlich coupling. β is the reduced thermodynamical beta = ħω/kT with k being Boltzman's constant.
"""
function ℑS(x, y, v, w, β, α)
    P = 1 / (exp(β) - 1)
    (2 * α / (3 * sqrt(π))) * (
        exp(-y) * (1 + P) * sin(x - 3 * arg_D(x, y, v, w, β) / 2) -
        exp(y) * P * sin(x + 3 * arg_D(x, y, v, w, β) / 2)
    ) / (mod_squared_D(x, y, v, w, β))^(3 / 4)
end

# Create a complex number from the real and imaginary parts of S(u).

S(x, y, v, w, β, α) = ℜS(x, y, v, w, β, α) + 1im * ℑS(x, y, v, w, β, α)


text:
#
# Copyright (c) 2021 Tobias Thummerer, Lars Mikelsons
# Licensed under the MIT license. See LICENSE file in the project root for details.
#

using FMI
using Flux
using DifferentialEquations: Tsit5

import Random
Random.seed!(1234);

modelFMUPath = joinpath(dirname(@__FILE__), "..", "model", "BouncingBall1D.fmu")
realFMUPath = joinpath(dirname(@__FILE__), "..", "model", "BouncingBall1D.fmu")

t_start = 0.0
t_step = 0.1
t_stop = 3.0
tData = t_start:t_step:t_stop

# generate training data
realFMU = fmiLoad(realFMUPath)
fmiInstantiate!(realFMU; loggingOn=false)
fmiSetupExperiment(realFMU, t_start, t_stop)
fmiEnterInitializationMode(realFMU)
fmiExitInitializationMode(realFMU)
x0 = fmiGetContinuousStates(realFMU)
_, realSimData = fmiSimulateCS(realFMU, t_start, t_stop; recordValues=["mass_s", "mass_v"], setup=false, reset=false, saveat=tData)

# setup traing data
posData = collect(data[1] for data in realSimData.saveval)
velData = collect(data[2] for data in realSimData.saveval)

# loss function for training
function losssum()
    global problem, x0, posData
    solution = problem(x0)

    posNet = collect(data[1] for data in solution.u)
    velNet = collect(data[2] for data in solution.u)

    Flux.Losses.mse(posNet, posData) + Flux.Losses.mse(velNet, velData)
end

# callback function for training
global iterCB = 0
global lastLoss = 0.0
function callb()
    global iterCB += 1
    global lastLoss

    if iterCB % 1 == 0
        loss = losssum()
        @info "Loss: $loss"

        # This test condition is weak, because when the FMU passes an event, the error might increase.
        # ToDo: More intelligent testing condition.
        @test loss < lastLoss*2.0
        lastLoss = loss
    end
end

vr = fmi2StringToValueReference(realFMU, "mass_m")

numStates = fmiGetNumberOfStates(realFMU)

# some NeuralFMU setups
nets = []

1 # default ME-NeuralFMU (learn dynamics and states, almost-neutral setup, parameter count << 100)
net = Chain(Dense( [1.0 0.0; 0.0 1.0] + rand(numStates,numStates)*0.01, zeros(numStates), tanh),
            states ->  fmiEvaluateME(realFMU, states),
            Dense( [1.0 0.0; 0.0 1.0] + rand(numStates,numStates)*0.01, zeros(numStates), identity))
push!(nets, net)

# 2 # default ME-NeuralFMU (learn dynamics)
net = Chain(states ->  fmiEvaluateME(realFMU, states),
            Dense(numStates, 16, tanh),
            Dense(16, 16, tanh),
            Dense(16, numStates))
push!(nets, net)

# 3 # default ME-NeuralFMU (learn states)
net = Chain(Dense(numStates, 16, tanh),
            Dense(16, 16, tanh),
            Dense(16, numStates),
            states -> fmiEvaluateME(realFMU, states))
push!(nets, net)

# 4 # default ME-NeuralFMU (learn dynamics and states)
net = Chain(Dense(numStates, 16, leakyrelu),
            Dense(16, 16, leakyrelu),
            Dense(16, numStates),
            states -> fmiEvaluateME(realFMU, states),
            Dense(numStates, 16, tanh),
            Dense(16, 16, tanh),
            Dense(16, numStates))
push!(nets, net)

# 5 # NeuralFMU with hard setting time to 0.0
net = Chain(states ->  fmiEvaluateME(realFMU, states), # not supported by this FMU:   states ->  fmiEvaluateME(realFMU, states, 0.0),
            Dense(numStates, 8, tanh),
            Dense(8, 16, tanh),
            Dense(16, numStates))
push!(nets, net)

# 6 # NeuralFMU with additional getter
getVRs = [fmi2StringToValueReference(realFMU, "mass_m")]
numGetVRs = length(getVRs)
net = Chain(states ->  fmiEvaluateME(realFMU, states, -1.0, fmi2ValueReference[], Real[], getVRs),
            Dense(numStates+numGetVRs, 8, tanh),
            Dense(8, 16, tanh),
            Dense(16, numStates))
push!(nets, net)

# 7 # NeuralFMU with additional setter
setVRs = [fmi2StringToValueReference(realFMU, "mass_m")]
numSetVRs = length(setVRs)
net = Chain(states ->  fmiEvaluateME(realFMU, states, -1.0, setVRs, [1.1]),
            Dense(numStates, 8, tanh),
            Dense(8, 16, tanh),
            Dense(16, numStates))
push!(nets, net)

# 8 # NeuralFMU with additional setter and getter
net = Chain(states ->  fmiEvaluateME(realFMU, states, -1.0, setVRs, [1.1], getVRs),
            Dense(numStates+numGetVRs, 8, tanh),
            Dense(8, 16, tanh),
            Dense(16, numStates))
push!(nets, net)

optim = ADAM(1e-4)
for i in 1:length(nets)
    @testset "Net setup #$i" begin
        global nets, problem, lastLoss, iterCB
        net = nets[i]
        problem = ME_NeuralFMU(realFMU, net, (t_start, t_stop), Tsit5(); saveat=tData, rootSearchInterpolationPoints=1000)
        problem.handleEvents = true
        @test problem != nothing

        solutionBefore = problem(x0)
        @test length(solutionBefore.t) == length(tData)
        @test solutionBefore.t[1] == t_start
        @test solutionBefore.t[end] == t_stop

        # train it ...
        p_net = Flux.params(problem)

        iterCB = 0
        lastLoss = losssum()
        @info "Start-Loss for net #$i: $lastLoss"
        Flux.train!(losssum, p_net, Iterators.repeated((), 1), optim; cb=callb)  #60

        # check results
        solutionAfter = problem(x0)
        @test length(solutionAfter.t) == length(tData)
        @test solutionAfter.t[1] == t_start
        @test solutionAfter.t[end] == t_stop
    end
end

fmiUnload(realFMU)


text:
# This file is a part of BAT.jl, licensed under the MIT License (MIT).

using BAT
using Test

using LinearAlgebra
using ArraysOfArrays, ValueShapes, Distributions

@testset "const_density" begin
    gen_density_1() =  BAT.ConstDensity(LogDVal(0), BAT.HyperRectBounds{Float64}(BAT.HyperRectVolume([-1., 0.5], [2.,1])))

    gen_density_n() = BAT.ConstDensity(normalize, BAT.HyperRectBounds([-1., 0.5], [2.,1]))

    @testset "BAT.ConstDensity" begin
        density = @inferred gen_density_1()
        @test typeof(density) == ConstDensity{Int,BAT.HyperRectBounds{Float64}}
        @test density.value == LogDVal(zero(Int))

        density = @inferred gen_density_n()
        @test logvalof(density.value) ≈ -0.4054651081081644

        pbounds = @inferred BAT.var_bounds(density)
        @test pbounds.vol.lo ≈ [-1., 0.5]
        @test totalndof(density) == 2
    end

    @testset "convert" begin
        cdensity = @inferred BAT.ConstDensity(normalize, BAT.HyperRectBounds([-1., 0.5], [2.,1]))
        @test typeof(cdensity) <: BAT.ConstDensity
    end

    @testset "BAT.eval_logval_unchecked" begin
        density = gen_density_n()
        @test BAT.eval_logval_unchecked(density, [1.,2.]) ≈ -0.4054651081081644
    end

    @testset "sampler" begin
        density = gen_density_n()

        s = @inferred sampler(density)
        @test typeof(s) <: BAT.SpatialVolume
        @test s.lo ≈ [-1., 0.5]
        @test s.hi ≈ [2., 1.]
    end
end


text:
# ==================================================================================
# Interface for Base and AbstractTrees

# nextsibling, parentlinks, siblinglinks, children, StoredParents, StoredSiblings

#----------------------------------------------------------------------------------
# Implement iteration over the immediate children of a node
function Base.iterate(node::AbstractBinaryNode)
    !isnull(node.left) && return (node.left, false)
    !isnull(node.right) && return (node.right, true)
    nothing
end
function Base.iterate(node::AbstractBinaryNode, state::Bool)
    state && return nothing
    !isnull(node.right) && return (node.right, true)
    nothing
end
Base.IteratorSize(::Type{<: HBN})  = Base.SizeUnknown()
Base.IteratorSize(::Type{<: SBN})  = Base.SizeUnknown()

#-----------------------------------------------------------------------------------
# Implement eltype, size and length
"""
    eltype(::Type{<: AbstractTree})

The type of nodes.
"""
Base.eltype(::Type{T}) where {T <: AbstractTree{N}} where N = N
Base.eltype(::Type{N}) where {N <: AbstractNode{T}} where T = N
"""
    size(tree::AbstractTree)

`size(tree) === tree.size`
"""
Base.size(tree::AbstractTree) = tree.size

"""
    length(tree::AbstractTree)
    length(node::HeightBinaryNode)

The height of tree and node.
"""
Base.length(tree::AbstractTree) = tree.height
Base.length(node::HeightBinaryNode) = node.height

# -----------------------------------------------------------------------------------
# Things we need to define to leverage the native iterator over children
# for the purposes of AbstractTrees.

Base.eltype(::Type{<: TreeIterator{N}}) where {N <: AbstractBinaryNode{T}} where T = N
Base.IteratorEltype(::Type{<: TreeIterator{<: AbstractBinaryNode}}) = Base.HasEltype()
AbstractTrees.parentlinks(::Type{<: AbstractBinaryNode}) = AbstractTrees.StoredParents()
AbstractTrees.siblinglinks(::Type{<: AbstractBinaryNode}) = AbstractTrees.StoredSiblings()

# Use the native iteration for the children
AbstractTrees.children(node::AbstractBinaryNode) = node

Base.parent(::AbstractBinaryNode, node::AbstractBinaryNode) = node.parent
Base.parent(root::AbstractBinaryNode, ::AbstractTrees.ImplicitRootState) = root

function AbstractTrees.nextsibling(::AbstractBinaryNode, child::AbstractBinaryNode)
    !isnull(child.parent) || return nothing
    p = child.parent
    if !isnull(p.right)
        child === p.right && return nothing
        return p.right
    end
    nothing
end

pairs(node::AbstractBinaryNode) = enumerate(node)

# ---------------------------------------------------------------------------------
# IO
# print data in node
printnode(io::IO, node::AbstractBinaryNode) = print(io, node.data)

# Specific order generators
PostOrderDFS(tree::AbstractTree) = PostOrderDFS(tree.root)
PreOrderDFS(tree::AbstractTree) = PreOrderDFS(tree.root)

# show tree
print_tree(io::IO, tree::AbstractTree) = print_tree(io, tree.root)
Base.show(io::IO, tree::AbstractTree) = print_tree(io, tree)

Base.show(io::IO, ::MIME"text/plain", tree::BST{N}) where N =
    print(io, "BinarySearchTree{$N}($(tree.size), $(tree.height)):", "\n", tree)

Base.show(io::IO, ::MIME"text/plain", tree::AVLTree{N}) where N =
    print(io, "AVLTree{$N}($(tree.size), $(tree.height)):", "\n", tree)

Base.show(io::IO, ::MIME"text/plain", tree::SplayTree{N}) where N =
    print(io, "SplayTree{$N}($(tree.size)):", "\n", tree)

# show node
Base.show(io::IO, node::HBN) = print(io, " data: $(node.data)\n", " parent: $(node.parent.data)\n",
                                            " left: $(node.left.data)\n", " right: $(node.right.data)\n",
                                            " height: $(node.height)")
Base.show(io::IO, node::SBN) = print(io, " data: $(node.data)\n", " parent: $(node.parent.data)\n",
                                            " left: $(node.left.data)\n", " right: $(node.right.data)\n")

Base.show(::IO, ::NullNode) = nothing

Base.show(io::IO, ::MIME"text/plain", node::NullNode) = print(io, "NullNode")

Base.show(io::IO, ::MIME"text/plain", node::HeightBinaryNode{T}) where T =
    print(io, "HeightBinaryNode{$T}", "\n$node")
Base.show(io::IO, ::MIME"text/plain", node::SimpleBinaryNode{T}) where T =
    print(io, "SimpleBinaryNode{$T}", "\n$node")

# --------------------------------------------------------------------------------------------------------------------
# Equality
function ==(node1::AbstractBinaryNode, node2::AbstractBinaryNode)
    node1.data == node2.data && (getproperty(node1, :left) == getproperty(node2, :left)) && (getproperty(node1, :right) == getproperty(node2, :right))
end

==(node1::AbstractNode, node2::NullNode) = false
==(node1::NullNode, node2::AbstractNode) = false
==(node1::NullNode, node2::NullNode) = true

==(tree1::AbstractTree, tree2::AbstractTree) =
    tree1.root == tree2.root


text:
using POMDPModelChecking
using POMDPs
using POMDPModels
using DiscreteValueIteration
using QMDP
using POMDPTesting
using Spot
using Test

# test state indexing
function test_stateindexing(problem::Union{ProductMDP, ProductPOMDP})
    for (i,s) in enumerate(states(problem))
        si = stateindex(problem, s)
        if si != i
            return false
        end
    end
    return true
end

@testset "MDP reachability" begin
    mdp = SimpleGridWorld(size=(10,10), terminate_from=Set([GWPos(9,3), GWPos(4,3)]), tprob=0.7)
    reach = Set([GWPos(10,1)])
    avoid = mdp.terminate_from
    solver = ReachabilitySolver(reach, avoid, ValueIterationSolver())
    policy = solve(solver, mdp)
    @test value(policy, GWPos(10,1)) == 1.
    @test value(policy, GWPos(4,3)) == 0.
    @test value(policy, GWPos(9,3)) == 0.
    @test action(policy, GWPos(9,1)) == :right
end

@testset "POMDP reachability" begin
    include("blind_gridworld.jl")
    pomdp = BlindGridWorld(size=(10,10),
                           exit=GWPos(10,1),
                           simple_gw=SimpleGridWorld(size=(10,10), terminate_from=Set([GWPos(9,3), GWPos(4,3)]), tprob=0.7))
    reach = Set([GWPos(10,1)])
    avoid = pomdp.simple_gw.terminate_from
    solver = ReachabilitySolver(reach, avoid, QMDPSolver())
    policy = solve(solver, pomdp)
    @test value(policy, deterministic_belief(pomdp, GWPos(10,1))) == 0. # terminal state in QMDP value function is 0.
    @test value(policy, deterministic_belief(pomdp, GWPos(4,3))) == 0.
    @test value(policy, deterministic_belief(pomdp, GWPos(9,3))) == 0.
    @test action(policy, deterministic_belief(pomdp, GWPos(9,1))) == :right
end

@testset "Product" begin
    mdp = SimpleGridWorld(size=(10,10), terminate_from=Set([]), tprob=0.7);

    LABELLED_STATES = Dict(GWPos(3,7) => :a, GWPos(8,5) => :b, GWPos(4,3) => :c)

    function POMDPModelChecking.labels(mdp::SimpleGridWorld, s, a)
        if haskey(LABELLED_STATES, s)
            return tuple(LABELLED_STATES[s])
        else
            return ()
        end
    end

    dra = DeterministicRabinAutomata(ltl"(!c U b) & (!c U a)")
    pmdp = ProductMDP(mdp, dra, Set{ProductState{GWPos, Int64}}(), ProductState(GWPos(1,1), -1), 1.0)
    state_space = states(pmdp)
    action_space = actions(pmdp)
    @test isapprox(discount(pmdp), 1.0)
    @test length(state_space) == length(states(mdp))*num_states(dra) + 1
    @test statetype(pmdp) == ProductState{GWPos, Int64}
    @test actiontype(pmdp) == Symbol
    @test test_stateindexing(pmdp)
    @test has_consistent_transition_distributions(pmdp)

    include("blind_gridworld.jl")
    POMDPModelChecking.labels(pomdp::BlindGridWorld, s, a) = labels(pomdp.simple_gw, s, a)
    pomdp = BlindGridWorld(size=(10,10),
                           exit=GWPos(10,1),
                           simple_gw=SimpleGridWorld(size=(10,10), terminate_from=Set([GWPos(9,3), GWPos(4,3)]), tprob=0.7))
    ppomdp = ProductPOMDP(pomdp, dra, Set{ProductState{GWPos, Int64}}(), ProductState(GWPos(1,1), -1), 1.0)
    state_space = states(ppomdp)
    action_space = actions(ppomdp)
    observation_space = observations(ppomdp)
    @test isapprox(discount(pomdp), 1.0)
    @test length(state_space) == length(states(pomdp))*num_states(dra) + 1
    @test statetype(ppomdp) == ProductState{GWPos, Int64}
    @test actiontype(ppomdp) == Symbol
    @test length(observations(pomdp)) == length(observation_space)
    @test obstype(ppomdp) == obstype(pomdp)
    @test test_stateindexing(ppomdp)
    @test has_consistent_transition_distributions(ppomdp)
    @test has_consistent_observation_distributions(ppomdp)
end

@testset begin "MDP Model Checking"
    mdp = SimpleGridWorld(size=(10,10), terminate_from=Set([]), tprob=0.7);

    LABELLED_STATES = Dict(GWPos(3,7) => :a, GWPos(8,5) => :b, GWPos(4,3) => :c)

    function POMDPModelChecking.labels(mdp::SimpleGridWorld, s, a)
        if haskey(LABELLED_STATES, s)
            return tuple(LABELLED_STATES[s])
        else
            return ()
        end
    end

    solver = ModelCheckingSolver(property=ltl"(!c U b) & (!c U a)", solver=ValueIterationSolver(), verbose=true)
    policy = solve(solver, mdp)
end


text:
using ClimateMachine.Mesh.Grids: _x1, _x2, _x3, VerticalDirection

abstract type AbstractSimulation end

struct Simulation{𝒯, 𝒰, 𝒱, 𝒲, 𝒳, 𝒴, L} <: AbstractSimulation
    model::𝒯
    grid::L
    timestepper::𝒰
    time::𝒱
    callbacks::𝒲
    rhs::𝒳
    state::𝒴
end

function Simulation(model::ModelSetup; grid, timestepper, time, callbacks)
    rhs = DGModel(
        model,
        grid.numerical,
        model.numerics.flux,
        CentralNumericalFluxSecondOrder(),
        CentralNumericalFluxGradient(),
    )

    FT = eltype(rhs.grid.vgeo)
    state = init_ode_state(rhs, FT(0); init_on_cpu = true)

    return Simulation(model, grid, timestepper, time, callbacks, rhs, state)
end

function Simulation(model::DryAtmosModel; grid, timestepper, time, callbacks)
    rhs = ESDGModel(
        model,
        grid.numerical,
        surface_numerical_flux_first_order = model.numerics.flux,
        volume_numerical_flux_first_order = KGVolumeFlux(),
    )

    FT = eltype(rhs.grid.vgeo)
    state = init_ode_state(rhs, FT(0); init_on_cpu = true)

    return Simulation(model, grid, timestepper, time, callbacks, rhs, state)
end

function Simulation(model::Tuple; grid, timestepper, time, callbacks)
    rhs = []
    for item in model
        if typeof(item) <: DryAtmosModel
            tmp = ESDGModel(
                item,
                grid.numerical,
                surface_numerical_flux_first_order = item.numerics.flux,
                volume_numerical_flux_first_order = KGVolumeFlux(),
            )
            push!(rhs, tmp)
        elseif typeof(item) <: DryAtmosLinearModel
            tmp = DGModel(
                item,
                grid.numerical,
                item.numerics.flux,
                CentralNumericalFluxSecondOrder(),
                CentralNumericalFluxGradient();
                direction = item.numerics.direction,
            )
            push!(rhs, tmp)
        end
    end
    rhs = Tuple(rhs)

    FT = eltype(rhs[1].grid.vgeo)
    state = init_ode_state(rhs[1], FT(0); init_on_cpu = true)

    return Simulation(model, grid, timestepper, time, callbacks, rhs, state)
end

struct CplSimulation{𝒯, 𝒰, 𝒱, 𝒲, 𝒳, 𝒴, L, B, CBV} <: AbstractSimulation
    model::𝒯
    grid::L
    odesolver::𝒰
    time::𝒱
    callbacks::𝒲
    rhs::𝒳
    state::𝒴
    nsteps::Int
    boundary::B
    cbvector::CBV
end

function CplSimulation(model; grid, timestepper, time, boundary_z = nothing, nsteps, callbacks)
    rhs = DGModel(
        model,
        grid.numerical,
        model.numerics.flux,
        model.numerics.flux_second_order,
        CentralNumericalFluxGradient(),
        direction = model.numerics.direction,
    )

    FT = eltype(rhs.grid.vgeo)
    state = init_ode_state(rhs, FT(0); init_on_cpu = true)

    xc = grid.numerical.vgeo[:, _x1:_x1, :]
    yc = grid.numerical.vgeo[:, _x2:_x2, :]
    zc = grid.numerical.vgeo[:, _x3:_x3, :]

    boundary(boundary_z, xc, yc, zc) = isnothing(boundary_z) ? zc .^ 2 .< eps(FT) : boundary_z(param_set, xc, yc, zc)
    boundary = boundary(boundary_z, xc, yc, zc)

    simulation = Simulation(model, grid, timestepper, time, callbacks, rhs, state)
    t0 = simulation.time.start
    Δt = timestepper.timestep

    # Instantiate time stepping method
    odesolver = timestepper.method(rhs, state, dt = Δt, t0 = t0)

    # Make callbacks from callbacks tuple
    cbvector = create_callbacks(simulation, odesolver)

    return CplSimulation(model, grid, odesolver, time, callbacks, rhs, state, nsteps, boundary, cbvector)
end

function CplSimulation(model::Tuple; grid, timestepper, time, boundary_z = nothing, nsteps, callbacks)
    rhs = []
    for item in model
        if typeof(item) <: DryAtmosModel
            tmp = ESDGModel(
                item,
                grid.numerical,
                surface_numerical_flux_first_order = item.numerics.flux,
                volume_numerical_flux_first_order = KGVolumeFlux(),
            )
            push!(rhs, tmp)
        elseif typeof(item) <: DryAtmosLinearModel
            tmp = DGModel(
                item,
                grid.numerical,
                item.numerics.flux,
                CentralNumericalFluxSecondOrder(),
                CentralNumericalFluxGradient();
                direction = item.numerics.direction,
            )
            push!(rhs, tmp)
        end
    end
    rhs = Tuple(rhs)

    xc = grid.numerical.vgeo[:, _x1:_x1, :]
    yc = grid.numerical.vgeo[:, _x2:_x2, :]
    zc = grid.numerical.vgeo[:, _x3:_x3, :]

    boundary(boundary_z, xc, yc, zc) = isnothing(boundary_z) ? zc .^ 2 .< eps(FT) : boundary_z(param_set, xc, yc, zc)
    boundary = boundary(boundary_z, xc, yc, zc)

    FT = eltype(rhs[1].grid.vgeo)
    state = init_ode_state(rhs[1], FT(0); init_on_cpu = true)

    simulation = Simulation(model[1], grid, timestepper, time, callbacks, rhs, state)
    t0 = simulation.time.start
    tend = simulation.time.finish
    Δt = timestepper.timestep

    # Instantiate time stepping method
    odesolver = timestepper.method(
        rhs[1],
        rhs[2],
        LinearBackwardEulerSolver(ManyColumnLU(); isadjustable = false),
        state;
        dt = Δt,
        t0 = t0,
        split_explicit_implicit = false,
    )

    # Make callbacks from callbacks tuple
    cbvector = create_callbacks(simulation, odesolver)

    return CplSimulation(model, grid, odesolver, time, callbacks, rhs, state, nsteps, boundary, cbvector)
end

function initialize!(simulation::Simulation; overwrite = false)
    if overwrite
        simulation = Simulation(
            model = simulation.model,
            timestepper = simulation.timestepper,
            time = simulation.time,
            callbacks = simulation.callbacks,
        )
    end

    return nothing
end

function evolve!(simulation::Simulation; refDat = ())
    # Unpack everything we need in this routine here
    timestepper = simulation.timestepper
    state = simulation.state
    rhs = simulation.rhs
    grid = simulation.grid

    npoly = convention(grid.resolution.polynomial_order, Val(ndims(grid.domain)))

    t0 = simulation.time.start
    tend = simulation.time.finish
    Δt = timestepper.timestep

    # Set up overintegration and polynomial order-based spatial staggering
    if haskey(grid.resolution, :overintegration_order)
        nover = convention(grid.resolution.overintegration_order, Val(ndims(grid.domain)))
    else
        nover = (0, 0, 0)
    end
    staggering = get(simulation.model.numerics, :staggering, false)

    # Perform overintegration filtering (only works if nover > 0)
    overintegration_filter!(state, rhs, npoly, nover)

    # Make right-hand side function with built-in filters
    rhs = rhs_closure(rhs, npoly, nover, staggering = staggering)

    # Instantiate time stepping method
    odesolver = timestepper.method(rhs, state, dt = Δt, t0 = t0)

    # Make callbacks from callbacks tuple
    cbvector = create_callbacks(simulation, odesolver)

    # Perform evolution of simulations
    if isempty(cbvector)
        solve!(state, odesolver; timeend = tend)
    else
        solve!(state, odesolver; timeend = tend, callbacks = cbvector)
    end

    # Check results against reference if StateCheck callback is used
    # TODO: TB: I don't think this should live within this function
    if any(typeof.(simulation.callbacks) .<: StateCheck)
        check_inds = findall(typeof.(simulation.callbacks) .<: StateCheck)
        @assert length(check_inds) == 1 "Only use one StateCheck in callbacks!"

        ClimateMachine.StateCheck.scprintref(cbvector[check_inds[1]])
        if length(refDat) > 0
            @test ClimateMachine.StateCheck.scdocheck(cbvector[check_inds[1]], refDat)
        end
    end

    return nothing
end

function evolve!(cpl_solver, numberofsteps; refDat = ())

    # Perform evolution of simulations
    solve!(
        nothing,
        cpl_solver;
        numberofsteps = numberofsteps,
        callbacks = cpl_solver.component_list.domainAtmos.component_model.cbvector,
    )

    # Check results against reference if StateCheck callback is used
    # TODO: TB: I don't think this should live within this function
    # if any(typeof.(simulation.callbacks) .<: StateCheck)
    #   check_inds = findall(typeof.(simulation.callbacks) .<: StateCheck)
    #   @assert length(check_inds) == 1 "Only use one StateCheck in callbacks!"

    #   ClimateMachine.StateCheck.scprintref(cbvector[check_inds[1]])
    #   if length(refDat) > 0
    #     @test ClimateMachine.StateCheck.scdocheck(cbvector[check_inds[1]], refDat)
    #   end
    # end

    return nothing
end

function rhs_closure(rhs, npoly, nover; staggering = false)
    if staggering
        function rhs_staggered(state_array, args...; kwargs...)
            rhs(state_array, args...; kwargs...)
            overintegration_filter!(state_array, rhs, npoly, nover)
            staggering_filter!(state_array, rhs, npoly, nover)
            return nothing
        end

        rhs_filtered = rhs_staggered
    else
        function rhs_unstaggered(state_array, args...; kwargs...)
            rhs(state_array, args...; kwargs...)
            overintegration_filter!(state_array, rhs, npoly, nover)
            return nothing
        end

        rhs_filtered = rhs_unstaggered
    end

    return rhs_filtered
end # returns a closure

function evolve!(simulation::Simulation{<:Tuple}; refDat = ())
    # Unpack everything we need in this routine here
    model = simulation.model[1]
    state = simulation.state
    rhs = simulation.rhs
    grid = simulation.grid.numerical
    timestepper = simulation.timestepper
    t0 = simulation.time.start
    tend = simulation.time.finish
    Δt = timestepper.timestep

    # Instantiate time stepping method
    odesolver = timestepper.method(
        rhs[1],
        rhs[2],
        LinearBackwardEulerSolver(ManyColumnLU(); isadjustable = false),
        state;
        dt = Δt,
        t0 = t0,
        split_explicit_implicit = false,
    )

    # Make callbacks from callbacks tuple
    cbvector = create_callbacks(simulation, odesolver)

    # Perform evolution of simulations
    if isempty(cbvector)
        solve!(state, odesolver; timeend = tend, adjustfinalstep = false)
    else
        solve!(state, odesolver; timeend = tend, callbacks = cbvector, adjustfinalstep = false)
    end

    # Check results against reference if StateCheck callback is used
    # TODO: TB: I don't think this should live within this function
    if any(typeof.(simulation.callbacks) .<: StateCheck)
        check_inds = findall(typeof.(simulation.callbacks) .<: StateCheck)
        @assert length(check_inds) == 1 "Only use one StateCheck in callbacks!"

        ClimateMachine.StateCheck.scprintref(cbvector[check_inds[1]])
        if length(refDat) > 0
            @test ClimateMachine.StateCheck.scdocheck(cbvector[check_inds[1]], refDat)
        end
    end

    return nothing
end

function overintegration_filter!(state_array, rhs, npoly, nover)
    if sum(nover) > 0
        cutoff_order = npoly .+ 1 # yes this is confusing
        cutoff = MassPreservingCutoffFilter(rhs.grid, cutoff_order)
        num_state_prognostic = number_states(rhs.balance_law, Prognostic())
        filterstates = 1:num_state_prognostic
        ClimateMachine.Mesh.Filters.apply!(state_array, filterstates, rhs.grid, cutoff)
    end

    return nothing
end

function staggering_filter!(state_array, rhs, npoly, nover)
    if sum(nover) > 0
        cutoff_order = npoly .+ 0 # one polynomial order less than scalars
        cutoff = MassPreservingCutoffFilter(rhs.grid, cutoff_order)
        num_state_prognostic = number_states(rhs.balance_law, Prognostic())
        filterstates = 2:4
        ClimateMachine.Mesh.Filters.apply!(state_array, filterstates, rhs.grid, cutoff)

    end

    return nothing
end

max_stars_repo_name: CliMA/CouplerMachine

max_issues_repo_name: CliMA/CouplerMachine


text:
@testset "Normalization" begin
    k = 2
    @test wz(;k=k)(+1) > 0
    @test wz(;k=k)(-1) > 0
    @test αp(1, logwz(;k=k)) ≈ αp(-1, logwz(;k=k)) atol = 1e-14
    @test αp(4, logwz(;k=k)) ≈ αp(-4, logwz(;k=k)) atol = 1e-14
end

@testset "Herglotz densities" begin
    @test ãp(2)(1,π/2) ≈ 1 / ãp(-2)(1,π/2) atol = 1e-14
end

max_stars_repo_name: EmileParolin/STrAW

max_issues_repo_name: EmileParolin/STrAW

max_forks_repo_name: EmileParolin/STrAW


text:
using ModelingToolkit
using Test

# Define some variables
@parameters t σ ρ β
@variables x(t) y(t) z(t)
@derivatives D'~t

# Define a differential equation
eqs = [D(x) ~ σ*(y-x),
       D(y) ~ x*(ρ-z)-y,
       D(z) ~ x*y - β*z]
de = DiffEqSystem(eqs,t,[x,y,z],[σ,ρ,β])
generate_function(de)
generate_function(de;version=ModelingToolkit.SArrayFunction)
jac_expr = generate_jacobian(de)
jac = calculate_jacobian(de)
f = ODEFunction(de)
ModelingToolkit.generate_ode_iW(de)

# Differential equation with automatic extraction of variables
de2 = DiffEqSystem(eqs, t)

function test_vars_extraction(de, de2)
    @test isequal(de.iv, de2.iv)
    for el in (:dvs, :ps)
        names2 = sort(collect(var.name for var in getfield(de2,el)))
        names = sort(collect(var.name for var in getfield(de,el)))
        @test names2 == names
    end
end
test_vars_extraction(de, de2)

@testset "time-varying parameters" begin
    @parameters σ′(t)
    eqs = [D(x) ~ σ′*(y-x),
           D(y) ~ x*(ρ-z)-y,
           D(z) ~ x*y - β*z]
    de = DiffEqSystem(eqs,t,[x,y,z],[σ′,ρ,β])
    @test begin
        f = eval(generate_function(de))
        du = [0.0,0.0,0.0]
        f(du, [1.0,2.0,3.0], [x->x+7,2,3], 5.0)
        du ≈ [12, -3, -7]
    end
end

# Conversion to first-order ODEs #17
@derivatives D3'''~t
@derivatives D2''~t
@variables u(t) u_tt(t) u_t(t) x_t(t)
eqs = [D3(u) ~ 2(D2(u)) + D(u) + D(x) + 1
       D2(x) ~ D(x) + 2]
de = DiffEqSystem(eqs, t)
de1 = ode_order_lowering(de)
lowered_eqs = [D(u_tt) ~ 2u_tt + u_t + x_t + 1
               D(x_t)  ~ x_t + 2
               D(u_t)  ~ u_tt
               D(u)    ~ u_t
               D(x)    ~ x_t]
@test de1.eqs == convert.(ModelingToolkit.DiffEq, lowered_eqs)
@test isequal(de1.dvs, [u_tt, x_t, u_t, u, x])
@test isequal(de1.iv, t)
du = zeros(5)
ODEFunction(de1)(du, ones(5), nothing, 0.1)
@test du == [5.0, 3.0, 1.0, 1.0, 1.0]

# Internal calculations
a = y - x
eqs = [D(x) ~ σ*a,
       D(y) ~ x*(ρ-z)-y,
       D(z) ~ x*y - β*z]
de = DiffEqSystem(eqs,t,[x,y,z],[σ,ρ,β])
generate_function(de)
jac = calculate_jacobian(de)
f = ODEFunction(de)

# Define a nonlinear system
eqs = [0 ~ σ*(y-x),
       0 ~ x*(ρ-z)-y,
       0 ~ x*y - β*z]
ns = NonlinearSystem(eqs,[x,y,z],[t,σ,ρ,β])
ns2 = NonlinearSystem(eqs)
for el in (:vs, :ps)
    names2 = sort(collect(var.name for var in getfield(ns2,el)))
    names = sort(collect(var.name for var in getfield(ns,el)))
    @test names2 == names
end

generate_function(ns)

@derivatives D'~t
@parameters A B C
_x = y / C
eqs = [D(x) ~ -A*x,
       D(y) ~ A*x - B*_x]
de = DiffEqSystem(eqs,t,[x,y],[A,B,C])
test_vars_extraction(de, DiffEqSystem(eqs,t))
test_vars_extraction(de, DiffEqSystem(eqs))
@test begin
    f = eval(generate_function(de))
    du = [0.0,0.0]
    f(du, [1.0,2.0], [1,2,3], 0.0)
    du ≈ [-1, -1/3]
end

# Now nonlinear system with only variables
@variables x y z
@parameters σ ρ β

# Define a nonlinear system
eqs = [0 ~ σ*(y-x),
       0 ~ x*(ρ-z)-y,
       0 ~ x*y - β*z]
ns = NonlinearSystem(eqs, [x,y,z], [σ,ρ,β])
jac = calculate_jacobian(ns)
@testset "nlsys jacobian" begin
    @test isequal(jac[1,1], σ * -1)
    @test isequal(jac[1,2], σ)
    @test isequal(jac[1,3], 0)
    @test isequal(jac[2,1], ρ - z)
    @test isequal(jac[2,2], -1)
    @test isequal(jac[2,3], x * -1)
    @test isequal(jac[3,1], y)
    @test isequal(jac[3,2], x)
    @test isequal(jac[3,3], -1 * β)
end
nlsys_func = generate_function(ns)
jac_func = generate_jacobian(ns)
f = @eval eval(nlsys_func)

# Intermediate calculations
# Define a nonlinear system
eqs = [0 ~ σ*a,
       0 ~ x*(ρ-z)-y,
       0 ~ x*y - β*z]
ns = NonlinearSystem(eqs,[x,y,z],[σ,ρ,β])
nlsys_func = generate_function(ns)
jac = calculate_jacobian(ns)
jac = generate_jacobian(ns)


text:
### A Pluto.jl notebook ###
# v0.16.0

using Markdown
using InteractiveUtils

# This Pluto notebook uses @bind for interactivity. When running this notebook outside of Pluto, the following 'mock version' of @bind gives bound variables a default value (instead of an error).
macro bind(def, element)
    quote
        local el = $(esc(element))
        global $(esc(def)) = Core.applicable(Base.get, el) ? Base.get(el) : missing
        el
    end
end

# ╔═╡ b7ac3efc-8bda-41d9-b3d5-147591bac4b4
begin
	using PlutoUI
	using MixedModelsSim
	using MixedModelsPermutations
	using MixedModels
	using DataFrames
	using StatsModels
	using Plots
	using Random
	using LinearAlgebra
	using StaticArrays #
	using BlockDiagonals
	using ProgressMeter

end

# ╔═╡ 72f5e910-e40d-11eb-3725-f19a95c9b3c1
include("../src/sim_utilities.jl");

# ╔═╡ eef54200-4ccc-4d08-83b0-b277489f2bff

# ╔═╡ 0cbf776c-8e56-4d32-8a55-da22f8bf1940
f =  @formula(dv ~ 1 + condition  + (1+condition|subj));

# ╔═╡ 3f4afdc8-04af-45b6-aadf-a72ca1ff158c
blup_method = olsranef;

# ╔═╡ 6917ddd6-6ef3-43a5-83f1-ef6583be54f3
residual_method = :signflip;

# ╔═╡ cbecd90f-b262-4bbd-8a55-177f3e40ae50
β = [0., 0.]

# ╔═╡ 55e97ef0-0f23-48a6-8229-7f1b6ca3d044
md"seed $(@bind seed_val Slider(1:100; default=1., show_value=true))"

# ╔═╡ 2141edd4-c8ed-4d1b-a5ec-9913b19a2d4a
	md"Subjects: $(@bind nsub Slider(2:2:50; default=30, show_value=true))"

# ╔═╡ bac32d2f-fb1f-4f02-b2f5-49df029b7b92
md"Items per Subject: $(@bind nitem Slider(2:2:50; default=30, show_value=true))"

# ╔═╡ 0eaf2824-dd65-4dfb-905e-96d8a1754e08
begin
	contrasts = Dict(
			:age=>EffectsCoding,
			:stimType=>EffectsCoding(),
			:condition=>EffectsCoding()
			);
	dat = DataFrame(sim_model_getData(nsub,nitem));
end;

# ╔═╡ eccf3c09-aa58-4c7c-8e43-364309df6885
@bind bootPerm Radio([
		"0"=>"Bootstrap",
		"1"=>"Permutation",
		],"1")

# ╔═╡ e132bb53-9b6c-4d61-bb45-d5d9209ff4da
@bind reml Radio([
		"0"=>"ML",
		"1"=>"REML",
		#"3"=>"experimental"
		],"1")

# ╔═╡ acc913dd-b17c-4137-83f4-7df179bdc3a1
@bind res Radio([
		"1"=>"residuals(x)",
		"2"=>"residuals(x,olsranef)",
		#"3"=>"experimental"
		],"1")

# ╔═╡ 968e3f53-055c-4dc0-b4e3-1217e511b3b4
# radio button to function
begin
	if res == "1"
		residual_function = x->residuals(x)
	elseif res == "2"
		residual_function = x->residuals(x,olsranef(x))
	elseif res == "3"
		residual_function = x->residuals(x,ranef(x))
	end
end;

# ╔═╡ 2776e7cf-ee8f-421e-98ed-fa03ecdbee68
md"σ-intercept: $(@bind σ1 Slider(0:0.1:5; default=0., show_value=true))"

# ╔═╡ 629d660c-6a13-422c-8acc-6c3b8d37acaa
md"σ-test: $(@bind σ2 Slider(0:0.1:10; default=4., show_value=true))"

# ╔═╡ 21664a88-30fd-4829-a70d-e727a5f5b66b
σs = [σ1,σ2,0.2]

# ╔═╡ cfd225bb-1eec-41b1-b6c1-ebc036b7e1d2
begin
# generate simulated "y" vector
simMod = fit(MixedModel, f, dat,contrasts=contrasts,REML=reml=="1")
simMod = MixedModelsSim.update!(simMod,[create_re(x...) for x in σs]...)
simMod = simulate!(MersenneTwister(Int(seed_val)),simMod, β = β, σ = 1.)

# fit a LMM mod to the y (separate models to maybe have separate formulas later
datSim = dat
datSim.dv = simMod.y
simMod2 = MixedModels.fit(MixedModel,f ,datSim,contrasts=contrasts,REML=reml=="1")
end;

# ╔═╡ d8335805-d7e3-45db-989b-0ed6f9a08525
test = MixedModelsPermutations.nonparametricbootstrap(20,simMod2)

# ╔═╡ 58fa0d39-65e0-4ec7-aeb0-e8bde381379a
begin
H0 = coef(simMod2)
H0[2] = 0.0

	morig = simMod2
	βsc, θsc = similar(morig.β), similar(morig.θ)
    p, k = length(βsc), length(θsc)
    m = deepcopy(morig)

    β_names = (Symbol.(fixefnames(morig))..., )

#	perm = permutation(Random.MersenneTwister(2),20, simMod2; β = H0,residual_method=residual_method,blup_method=blup_method,infla)
perm = []
for p = 1:20
		if bootPerm == "0"
			# boot strap

			model = MixedModelsPermutations.resample!(MersenneTwister(p+1),deepcopy(morig);
                  blups=ranef(simMod2),
                  resids=residual_function(simMod2),
                  scalings= MixedModelsPermutations.inflation_factor(morig, ranef(simMod2), residual_function(simMod2))
	)
		else
			#permutation
	model = MixedModelsPermutations.permute!(MersenneTwister(p+1),deepcopy(morig);
                  β = H0,
                  blups=olsranef(simMod2),
                  resids=residual_function(simMod2),
			      residual_method = residual_method,
                  scalings=I(length(β)),
	)
		end
	refit!(model)
	res=	(
	 objective = model.objective,
	 σ = model.σ,
	 β = NamedTuple{β_names}(MixedModels.fixef!(βsc, model)),
	 #se = SVector{p,Float64}(MixedModels.stderror!(βsc, model)),
	 θ = SVector{k,Float64}(MixedModels.getθ!(θsc, model)),
	)
	append!(perm,[res])
end
end

# ╔═╡ 64d2509b-d94e-4e48-8f81-fa13d5f9e9be
let
	Plots.plot(DataFrame(perm).σ,label="permutation")
	hline!([1.],label="theoretical σ")
	hline!([simMod2.σ],label="empirical σ")
	ylims!((1. *0.8,1. *1.2))
	ylabel!("residual σ")
	xlabel!("permutation")
end

# ╔═╡ 3fb9f0ef-af34-4624-8ce6-88d71711d005
function residuals2(model::LinearMixedModel{T}, blups::Vector{<:AbstractMatrix{T}}) where T
    # XXX This is kinda type piracy, if it weren't developed by one of the MixedModels.jl devs....

    y = response(model) # we are now modifying the model

    ŷ = zeros(T, length(y))
	scalings=MixedModelsPermutations.inflation_factor(model)

	 for (inflation, re, trm) in zip(scalings, blups, model.reterms)
        npreds, ngrps = size(re)
        # sign flipping
        newre = re * diagm(rand(MersenneTwister(1), (-1,1), ngrps))

        # our RE are actually already scaled, but this method (of unscaledre!)
        # isn't dependent on the scaling (only the RNG methods are)
        # this just multiplies the Z matrices by the BLUPs
        # and add that to y
        MixedModels.unscaledre!(y, trm, lmul!(inflation, newre))
        # XXX inflation is resampling invariant -- should we move it out?
    end
    # TODO: do this inplace to avoid an allocation
    return y .- ŷ
end

# ╔═╡ 00000000-0000-0000-0000-000000000001
PLUTO_PROJECT_TOML_CONTENTS = """
[deps]
BlockDiagonals = "0a1fb500-61f7-11e9-3c65-f5ef3456f9f0"
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
MixedModels = "ff71e718-51f3-5ec2-a782-8ffcbfa3c316"
MixedModelsPermutations = "647c4018-d7ef-4d03-a0cc-8889a722319e"
MixedModelsSim = "d5ae56c5-23ca-4a1f-b505-9fc4796fc1fe"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
PlutoUI = "7f904dfe-b85e-4ff6-b463-dae2292396a8"
ProgressMeter = "92933f4c-e287-5a05-a399-4b506db050ca"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
StatsModels = "3eaba693-59b7-5ba5-a881-562e759f1c8d"

[compat]
BlockDiagonals = "~0.1.19"
DataFrames = "~1.2.0"
MixedModels = "~3.9.0"
MixedModelsPermutations = "~0.1.2"
MixedModelsSim = "~0.2.3"
Plots = "~1.18.2"
PlutoUI = "~0.7.9"
ProgressMeter = "~1.7.1"
StaticArrays = "~1.2.6"
StatsModels = "~0.6.23"
"""

# ╔═╡ 00000000-0000-0000-0000-000000000002
PLUTO_MANIFEST_TOML_CONTENTS = """
# This file is machine-generated - editing it directly is not advised

[[Adapt]]
deps = ["LinearAlgebra"]
git-tree-sha1 = "84918055d15b3114ede17ac6a7182f68870c16f7"
uuid = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
version = "3.3.1"

[[ArgTools]]
uuid = "0dad84c5-d112-42e6-8d28-ef12dabb789f"

[[Arrow]]
deps = ["ArrowTypes", "BitIntegers", "CodecLz4", "CodecZstd", "DataAPI", "Dates", "Mmap", "PooledArrays", "SentinelArrays", "Tables", "TimeZones", "UUIDs"]
git-tree-sha1 = "ca0abf8290cf219aa96a5c89c8210bbf498fecf2"
uuid = "69666777-d1a9-59fb-9406-91d4454c9d45"
version = "1.6.0"

[[ArrowTypes]]
deps = ["UUIDs"]
git-tree-sha1 = "88f8d727e612e3cd5b91c6906b10f25e7821d8d4"
uuid = "31f734f8-188a-4ce0-8406-c8a06bd891cd"
version = "1.1.0"

[[Artifacts]]
uuid = "56f22d72-fd6d-98f1-02f0-08ddc0907c33"

[[Base64]]
uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"

[[BenchmarkTools]]
deps = ["JSON", "Logging", "Printf", "Statistics", "UUIDs"]
git-tree-sha1 = "ffabdf5297c9038973a0a3724132aa269f38c448"
uuid = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
version = "1.1.0"

[[BitIntegers]]
deps = ["Random"]
git-tree-sha1 = "f0853a9d2cf2cf4f9fbd98c6e19ff1627e65a9a7"
uuid = "c3b6d118-76ef-56ca-8cc7-ebb389d030a1"
version = "0.2.4"

[[BlockArrays]]
deps = ["LinearAlgebra"]
git-tree-sha1 = "b9e7e450038d9f1277723ff34a6731d559972576"
uuid = "8e7c35d0-a365-5155-bbbb-fb81a777f24e"
version = "0.11.2"

[[BlockDiagonals]]
deps = ["ChainRulesCore", "FillArrays", "FiniteDifferences", "LinearAlgebra"]
git-tree-sha1 = "54476dbb545f6dadd0cce251a5ae87c9c3d99804"
uuid = "0a1fb500-61f7-11e9-3c65-f5ef3456f9f0"
version = "0.1.19"

[[Bzip2_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "c3598e525718abcc440f69cc6d5f60dda0a1b61e"
uuid = "6e34b625-4abd-537c-b88f-471c36dfa7a0"
version = "1.0.6+5"

[[Cairo_jll]]
deps = ["Artifacts", "Bzip2_jll", "Fontconfig_jll", "FreeType2_jll", "Glib_jll", "JLLWrappers", "LZO_jll", "Libdl", "Pixman_jll", "Pkg", "Xorg_libXext_jll", "Xorg_libXrender_jll", "Zlib_jll", "libpng_jll"]
git-tree-sha1 = "e2f47f6d8337369411569fd45ae5753ca10394c6"
uuid = "83423d85-b0ee-5818-9007-b63ccbeb887a"
version = "1.16.0+6"

[[ChainRulesCore]]
deps = ["Compat", "LinearAlgebra", "SparseArrays"]
git-tree-sha1 = "dcc25ff085cf548bc8befad5ce048391a7c07d40"
uuid = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"
version = "0.10.11"

[[CodecBzip2]]
deps = ["Bzip2_jll", "Libdl", "TranscodingStreams"]
git-tree-sha1 = "2e62a725210ce3c3c2e1a3080190e7ca491f18d7"
uuid = "523fee87-0ab8-5b00-afb7-3ecf72e48cfd"
version = "0.7.2"

[[CodecLz4]]
deps = ["Lz4_jll", "TranscodingStreams"]
git-tree-sha1 = "59fe0cb37784288d6b9f1baebddbf75457395d40"
uuid = "5ba52731-8f18-5e0d-9241-30f10d1ec561"
version = "0.4.0"

[[CodecZlib]]
deps = ["TranscodingStreams", "Zlib_jll"]
git-tree-sha1 = "ded953804d019afa9a3f98981d99b33e3db7b6da"
uuid = "944b1d66-785c-5afd-91f1-9de20f533193"
version = "0.7.0"

[[CodecZstd]]
deps = ["TranscodingStreams", "Zstd_jll"]
git-tree-sha1 = "d19cd9ae79ef31774151637492291d75194fc5fa"
uuid = "6b39b394-51ab-5f42-8807-6242bab2b4c2"
version = "0.7.0"

[[ColorSchemes]]
deps = ["ColorTypes", "Colors", "FixedPointNumbers", "Random", "StaticArrays"]
git-tree-sha1 = "ed268efe58512df8c7e224d2e170afd76dd6a417"
uuid = "35d6a980-a343-548e-a6ea-1d62b119f2f4"
version = "3.13.0"

[[ColorTypes]]
deps = ["FixedPointNumbers", "Random"]
git-tree-sha1 = "024fe24d83e4a5bf5fc80501a314ce0d1aa35597"
uuid = "3da002f7-5984-5a60-b8a6-cbb66c0b333f"
version = "0.11.0"

[[Colors]]
deps = ["ColorTypes", "FixedPointNumbers", "Reexport"]
git-tree-sha1 = "417b0ed7b8b838aa6ca0a87aadf1bb9eb111ce40"
uuid = "5ae59095-9a9b-59fe-a467-6f913c188581"
version = "0.12.8"

[[Compat]]
deps = ["Base64", "Dates", "DelimitedFiles", "Distributed", "InteractiveUtils", "LibGit2", "Libdl", "LinearAlgebra", "Markdown", "Mmap", "Pkg", "Printf", "REPL", "Random", "SHA", "Serialization", "SharedArrays", "Sockets", "SparseArrays", "Statistics", "Test", "UUIDs", "Unicode"]
git-tree-sha1 = "dc7dedc2c2aa9faf59a55c622760a25cbefbe941"
uuid = "34da2185-b29b-5c13-b0c7-acf172513d20"
version = "3.31.0"

[[CompilerSupportLibraries_jll]]
deps = ["Artifacts", "Libdl"]
uuid = "e66e0078-7015-5450-92f7-15fbd957f2ae"

[[Contour]]
deps = ["StaticArrays"]
git-tree-sha1 = "9f02045d934dc030edad45944ea80dbd1f0ebea7"
uuid = "d38c429a-6771-53c6-b99e-75d170b6e991"
version = "0.5.7"

[[Crayons]]
git-tree-sha1 = "3f71217b538d7aaee0b69ab47d9b7724ca8afa0d"
uuid = "a8cc5b0e-0ffa-5ad4-8c14-923d3ee1735f"
version = "4.0.4"

[[DataAPI]]
git-tree-sha1 = "ee400abb2298bd13bfc3df1c412ed228061a2385"
uuid = "9a962f9c-6df0-11e9-0e5d-c546b8b5ee8a"
version = "1.7.0"

[[DataFrames]]
deps = ["Compat", "DataAPI", "Future", "InvertedIndices", "IteratorInterfaceExtensions", "LinearAlgebra", "Markdown", "Missings", "PooledArrays", "PrettyTables", "Printf", "REPL", "Reexport", "SortingAlgorithms", "Statistics", "TableTraits", "Tables", "Unicode"]
git-tree-sha1 = "1dadfca11c0e08e03ab15b63aaeda55266754bad"
uuid = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
version = "1.2.0"

[[DataStructures]]
deps = ["Compat", "InteractiveUtils", "OrderedCollections"]
git-tree-sha1 = "4437b64df1e0adccc3e5d1adbc3ac741095e4677"
uuid = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
version = "0.18.9"

[[DataValueInterfaces]]
git-tree-sha1 = "bfc1187b79289637fa0ef6d4436ebdfe6905cbd6"
uuid = "e2d170a0-9d28-54be-80f0-106bbe20a464"
version = "1.0.0"

[[Dates]]
deps = ["Printf"]
uuid = "ade2ca70-3891-5945-98fb-dc099432e06a"

[[DelimitedFiles]]
deps = ["Mmap"]
uuid = "8bb1440f-4735-579b-a4ab-409b98df4dab"

[[Distributed]]
deps = ["Random", "Serialization", "Sockets"]
uuid = "8ba89e20-285c-5b6f-9357-94700520ee1b"

[[Distributions]]
deps = ["FillArrays", "LinearAlgebra", "PDMats", "Printf", "QuadGK", "Random", "SparseArrays", "SpecialFunctions", "Statistics", "StatsBase", "StatsFuns"]
git-tree-sha1 = "d5fa76fdab7bf54615262bd639e8c2e9bf295444"
uuid = "31c24e10-a181-5473-b8eb-7969acd0382f"
version = "0.25.10"

[[DocStringExtensions]]
deps = ["LibGit2"]
git-tree-sha1 = "a32185f5428d3986f47c2ab78b1f216d5e6cc96f"
uuid = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
version = "0.8.5"

[[Downloads]]
deps = ["ArgTools", "LibCURL", "NetworkOptions"]
uuid = "f43a241f-c20a-4ad4-852c-f6b1247861c6"

[[EarCut_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "92d8f9f208637e8d2d28c664051a00569c01493d"
uuid = "5ae413db-bbd1-5e63-b57d-d24a61df00f5"
version = "2.1.5+1"

[[Expat_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "b3bfd02e98aedfa5cf885665493c5598c350cd2f"
uuid = "2e619515-83b5-522b-bb60-26c02a35a201"
version = "2.2.10+0"

[[ExprTools]]
git-tree-sha1 = "b7e3d17636b348f005f11040025ae8c6f645fe92"
uuid = "e2ba6199-217a-4e67-a87a-7c52f15ade04"
version = "0.1.6"

[[FFMPEG]]
deps = ["FFMPEG_jll"]
git-tree-sha1 = "b57e3acbe22f8484b4b5ff66a7499717fe1a9cc8"
uuid = "c87230d0-a227-11e9-1b43-d7ebe4e7570a"
version = "0.4.1"

[[FFMPEG_jll]]
deps = ["Artifacts", "Bzip2_jll", "FreeType2_jll", "FriBidi_jll", "JLLWrappers", "LAME_jll", "LibVPX_jll", "Libdl", "Ogg_jll", "OpenSSL_jll", "Opus_jll", "Pkg", "Zlib_jll", "libass_jll", "libfdk_aac_jll", "libvorbis_jll", "x264_jll", "x265_jll"]
git-tree-sha1 = "3cc57ad0a213808473eafef4845a74766242e05f"
uuid = "b22a6f82-2f65-5046-a5b2-351ab43fb4e5"
version = "4.3.1+4"

[[FillArrays]]
deps = ["LinearAlgebra", "Random", "SparseArrays"]
git-tree-sha1 = "693210145367e7685d8604aee33d9bfb85db8b31"
uuid = "1a297f60-69ca-5386-bcde-b61e274b549b"
version = "0.11.9"

[[FiniteDifferences]]
deps = ["ChainRulesCore", "LinearAlgebra", "Printf", "Random", "Richardson", "StaticArrays"]
git-tree-sha1 = "12417e4754486a547d98d65293dc0fafdfcc0736"
uuid = "26cc04aa-876d-5657-8c51-4c34ba976000"
version = "0.12.14"

[[FixedPointNumbers]]
deps = ["Statistics"]
git-tree-sha1 = "335bfdceacc84c5cdf16aadc768aa5ddfc5383cc"
uuid = "53c48c17-4a7d-5ca2-90c5-79b7896eea93"
version = "0.8.4"

[[Fontconfig_jll]]
deps = ["Artifacts", "Bzip2_jll", "Expat_jll", "FreeType2_jll", "JLLWrappers", "Libdl", "Libuuid_jll", "Pkg", "Zlib_jll"]
git-tree-sha1 = "35895cf184ceaab11fd778b4590144034a167a2f"
uuid = "a3f928ae-7b40-5064-980b-68af3947d34b"
version = "2.13.1+14"

[[Formatting]]
deps = ["Printf"]
git-tree-sha1 = "8339d61043228fdd3eb658d86c926cb282ae72a8"
uuid = "59287772-0a20-5a39-b81b-1366585eb4c0"
version = "0.4.2"

[[FreeType2_jll]]
deps = ["Artifacts", "Bzip2_jll", "JLLWrappers", "Libdl", "Pkg", "Zlib_jll"]
git-tree-sha1 = "cbd58c9deb1d304f5a245a0b7eb841a2560cfec6"
uuid = "d7e528f0-a631-5988-bf34-fe36492bcfd7"
version = "2.10.1+5"

[[FriBidi_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "aa31987c2ba8704e23c6c8ba8a4f769d5d7e4f91"
uuid = "559328eb-81f9-559d-9380-de523a88c83c"
version = "1.0.10+0"

[[Future]]
deps = ["Random"]
uuid = "9fa8497b-333b-5362-9e8d-4d0656e87820"

[[GLFW_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Libglvnd_jll", "Pkg", "Xorg_libXcursor_jll", "Xorg_libXi_jll", "Xorg_libXinerama_jll", "Xorg_libXrandr_jll"]
git-tree-sha1 = "dba1e8614e98949abfa60480b13653813d8f0157"
uuid = "0656b61e-2033-5cc2-a64a-77c0f6c09b89"
version = "3.3.5+0"

[[GLM]]
deps = ["Distributions", "LinearAlgebra", "Printf", "Reexport", "SparseArrays", "SpecialFunctions", "Statistics", "StatsBase", "StatsFuns", "StatsModels"]
git-tree-sha1 = "f564ce4af5e79bb88ff1f4488e64363487674278"
uuid = "38e38edf-8417-5370-95a0-9cbb8c7f171a"
version = "1.5.1"

[[GR]]
deps = ["Base64", "DelimitedFiles", "GR_jll", "HTTP", "JSON", "Libdl", "LinearAlgebra", "Pkg", "Printf", "Random", "Serialization", "Sockets", "Test", "UUIDs"]
git-tree-sha1 = "b83e3125048a9c3158cbb7ca423790c7b1b57bea"
uuid = "28b8d3ca-fb5f-59d9-8090-bfdbd6d07a71"
version = "0.57.5"

[[GR_jll]]
deps = ["Artifacts", "Bzip2_jll", "Cairo_jll", "FFMPEG_jll", "Fontconfig_jll", "GLFW_jll", "JLLWrappers", "JpegTurbo_jll", "Libdl", "Libtiff_jll", "Pixman_jll", "Pkg", "Qt5Base_jll", "Zlib_jll", "libpng_jll"]
git-tree-sha1 = "e14907859a1d3aee73a019e7b3c98e9e7b8b5b3e"
uuid = "d2c73de3-f751-5644-a686-071e5b155ba9"
version = "0.57.3+0"

[[GeometryBasics]]
deps = ["EarCut_jll", "IterTools", "LinearAlgebra", "StaticArrays", "StructArrays", "Tables"]
git-tree-sha1 = "15ff9a14b9e1218958d3530cc288cf31465d9ae2"
uuid = "5c1252a2-5f33-56bf-86c9-59e7332b4326"
version = "0.3.13"

[[Gettext_jll]]
deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "Libdl", "Libiconv_jll", "Pkg", "XML2_jll"]
git-tree-sha1 = "9b02998aba7bf074d14de89f9d37ca24a1a0b046"
uuid = "78b55507-aeef-58d4-861c-77aaff3498b1"
version = "0.21.0+0"

[[Glib_jll]]
deps = ["Artifacts", "Gettext_jll", "JLLWrappers", "Libdl", "Libffi_jll", "Libiconv_jll", "Libmount_jll", "PCRE_jll", "Pkg", "Zlib_jll"]
git-tree-sha1 = "47ce50b742921377301e15005c96e979574e130b"
uuid = "7746bdde-850d-59dc-9ae8-88ece973131d"
version = "2.68.1+0"

[[Grisu]]
git-tree-sha1 = "53bb909d1151e57e2484c3d1b53e19552b887fb2"
uuid = "42e2da0e-8278-4e71-bc24-59509adca0fe"
version = "1.0.2"

[[HTTP]]
deps = ["Base64", "Dates", "IniFile", "Logging", "MbedTLS", "NetworkOptions", "Sockets", "URIs"]
git-tree-sha1 = "c6a1fff2fd4b1da29d3dccaffb1e1001244d844e"
uuid = "cd3eb016-35fb-5094-929b-558a96fad6f3"
version = "0.9.12"

[[IniFile]]
deps = ["Test"]
git-tree-sha1 = "098e4d2c533924c921f9f9847274f2ad89e018b8"
uuid = "83e8ac13-25f8-5344-8a64-a9f2b223428f"
version = "0.5.0"

[[InteractiveUtils]]
deps = ["Markdown"]
uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240"

[[InvertedIndices]]
deps = ["Test"]
git-tree-sha1 = "15732c475062348b0165684ffe28e85ea8396afc"
uuid = "41ab1584-1d38-5bbf-9106-f11c6c58b48f"
version = "1.0.0"

[[IterTools]]
git-tree-sha1 = "05110a2ab1fc5f932622ffea2a003221f4782c18"
uuid = "c8e1da08-722c-5040-9ed9-7db0dc04731e"
version = "1.3.0"

[[IteratorInterfaceExtensions]]
git-tree-sha1 = "a3f24677c21f5bbe9d2a714f95dcd58337fb2856"
uuid = "82899510-4779-5014-852e-03e436cf321d"
version = "1.0.0"

[[JLLWrappers]]
deps = ["Preferences"]
git-tree-sha1 = "642a199af8b68253517b80bd3bfd17eb4e84df6e"
uuid = "692b3bcd-3c85-4b1f-b108-f13ce0eb3210"
version = "1.3.0"

[[JSON]]
deps = ["Dates", "Mmap", "Parsers", "Unicode"]
git-tree-sha1 = "81690084b6198a2e1da36fcfda16eeca9f9f24e4"
uuid = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
version = "0.21.1"

[[JSONSchema]]
deps = ["HTTP", "JSON", "ZipFile"]
git-tree-sha1 = "b84ab8139afde82c7c65ba2b792fe12e01dd7307"
uuid = "7d188eb4-7ad8-530c-ae41-71a32a6d4692"
version = "0.3.3"

[[JpegTurbo_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "d735490ac75c5cb9f1b00d8b5509c11984dc6943"
uuid = "aacddb02-875f-59d6-b918-886e6ef4fbf8"
version = "2.1.0+0"

[[LAME_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "f6250b16881adf048549549fba48b1161acdac8c"
uuid = "c1c5ebd0-6772-5130-a774-d5fcae4a789d"
version = "3.100.1+0"

[[LZO_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "e5b909bcf985c5e2605737d2ce278ed791b89be6"
uuid = "dd4b983a-f0e5-5f8d-a1b7-129d4a5fb1ac"
version = "2.10.1+0"

[[LaTeXStrings]]
git-tree-sha1 = "c7f1c695e06c01b95a67f0cd1d34994f3e7db104"
uuid = "b964fa9f-0449-5b57-a5c2-d3ea65f4040f"
version = "1.2.1"

[[Latexify]]
deps = ["Formatting", "InteractiveUtils", "LaTeXStrings", "MacroTools", "Markdown", "Printf", "Requires"]
git-tree-sha1 = "a4b12a1bd2ebade87891ab7e36fdbce582301a92"
uuid = "23fbe1c1-3f47-55db-b15f-69d7ec21a316"
version = "0.15.6"

[[LazyArtifacts]]
deps = ["Artifacts", "Pkg"]
uuid = "4af54fe1-eca0-43a8-85a7-787d91b784e3"

[[LibCURL]]
deps = ["LibCURL_jll", "MozillaCACerts_jll"]
uuid = "b27032c2-a3e7-50c8-80cd-2d36dbcbfd21"

[[LibCURL_jll]]
deps = ["Artifacts", "LibSSH2_jll", "Libdl", "MbedTLS_jll", "Zlib_jll", "nghttp2_jll"]
uuid = "deac9b47-8bc7-5906-a0fe-35ac56dc84c0"

[[LibGit2]]
deps = ["Base64", "NetworkOptions", "Printf", "SHA"]
uuid = "76f85450-5226-5b5a-8eaa-529ad045b433"

[[LibSSH2_jll]]
deps = ["Artifacts", "Libdl", "MbedTLS_jll"]
uuid = "29816b5a-b9ab-546f-933c-edad1886dfa8"

[[LibVPX_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "12ee7e23fa4d18361e7c2cde8f8337d4c3101bc7"
uuid = "dd192d2f-8180-539f-9fb4-cc70b1dcf69a"
version = "1.10.0+0"

[[Libdl]]
uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb"

[[Libffi_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "761a393aeccd6aa92ec3515e428c26bf99575b3b"
uuid = "e9f186c6-92d2-5b65-8a66-fee21dc1b490"
version = "3.2.2+0"

[[Libgcrypt_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Libgpg_error_jll", "Pkg"]
git-tree-sha1 = "64613c82a59c120435c067c2b809fc61cf5166ae"
uuid = "d4300ac3-e22c-5743-9152-c294e39db1e4"
version = "1.8.7+0"

[[Libglvnd_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_libX11_jll", "Xorg_libXext_jll"]
git-tree-sha1 = "7739f837d6447403596a75d19ed01fd08d6f56bf"
uuid = "7e76a0d4-f3c7-5321-8279-8d96eeed0f29"
version = "1.3.0+3"

[[Libgpg_error_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "c333716e46366857753e273ce6a69ee0945a6db9"
uuid = "7add5ba3-2f88-524e-9cd5-f83b8a55f7b8"
version = "1.42.0+0"

[[Libiconv_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "42b62845d70a619f063a7da093d995ec8e15e778"
uuid = "94ce4f54-9a6c-5748-9c1c-f9c7231a4531"
version = "1.16.1+1"

[[Libmount_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "9c30530bf0effd46e15e0fdcf2b8636e78cbbd73"
uuid = "4b2f31a3-9ecc-558c-b454-b3730dcb73e9"
version = "2.35.0+0"

[[Libtiff_jll]]
deps = ["Artifacts", "JLLWrappers", "JpegTurbo_jll", "Libdl", "Pkg", "Zlib_jll", "Zstd_jll"]
git-tree-sha1 = "340e257aada13f95f98ee352d316c3bed37c8ab9"
uuid = "89763e89-9b03-5906-acba-b20f662cd828"
version = "4.3.0+0"

[[Libuuid_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "7f3efec06033682db852f8b3bc3c1d2b0a0ab066"
uuid = "38a345b3-de98-5d2b-a5d3-14cd9215e700"
version = "2.36.0+0"

[[LinearAlgebra]]
deps = ["Libdl"]
uuid = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"

[[LogExpFunctions]]
deps = ["DocStringExtensions", "LinearAlgebra"]
git-tree-sha1 = "7bd5f6565d80b6bf753738d2bc40a5dfea072070"
uuid = "2ab3a3ac-af41-5b50-aa03-7779005ae688"
version = "0.2.5"

[[Logging]]
uuid = "56ddb016-857b-54e1-b83d-db4d58db5568"

[[Lz4_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "5d494bc6e85c4c9b626ee0cab05daa4085486ab1"
uuid = "5ced341a-0733-55b8-9ab6-a4889d929147"
version = "1.9.3+0"

[[MacroTools]]
deps = ["Markdown", "Random"]
git-tree-sha1 = "6a8a2a625ab0dea913aba95c11370589e0239ff0"
uuid = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09"
version = "0.5.6"

[[Markdown]]
deps = ["Base64"]
uuid = "d6f4376e-aef5-505a-96c1-9c027394607a"

[[MathOptInterface]]
deps = ["BenchmarkTools", "CodecBzip2", "CodecZlib", "JSON", "JSONSchema", "LinearAlgebra", "MutableArithmetics", "OrderedCollections", "SparseArrays", "Test", "Unicode"]
git-tree-sha1 = "575644e3c05b258250bb599e57cf73bbf1062901"
uuid = "b8f27783-ece8-5eb3-8dc8-9495eed66fee"
version = "0.9.22"

[[MathProgBase]]
deps = ["LinearAlgebra", "SparseArrays"]
git-tree-sha1 = "9abbe463a1e9fc507f12a69e7f29346c2cdc472c"
uuid = "fdba3010-5040-5b88-9595-932c9decdf73"
version = "0.7.8"

[[MbedTLS]]
deps = ["Dates", "MbedTLS_jll", "Random", "Sockets"]
git-tree-sha1 = "1c38e51c3d08ef2278062ebceade0e46cefc96fe"
uuid = "739be429-bea8-5141-9913-cc70e7f3736d"
version = "1.0.3"

[[MbedTLS_jll]]
deps = ["Artifacts", "Libdl"]
uuid = "c8ffd9c3-330d-5841-b78e-0817d7145fa1"

[[Measures]]
git-tree-sha1 = "e498ddeee6f9fdb4551ce855a46f54dbd900245f"
uuid = "442fdcdd-2543-5da2-b0f3-8c86c306513e"
version = "0.3.1"

[[Missings]]
deps = ["DataAPI"]
git-tree-sha1 = "4ea90bd5d3985ae1f9a908bd4500ae88921c5ce7"
uuid = "e1d29d7a-bbdc-5cf2-9ac0-f12de2c33e28"
version = "1.0.0"

[[MixedModels]]
deps = ["Arrow", "BlockArrays", "DataAPI", "Distributions", "GLM", "LazyArtifacts", "LinearAlgebra", "Markdown", "NLopt", "PooledArrays", "ProgressMeter", "Random", "SparseArrays", "StaticArrays", "Statistics", "StatsBase", "StatsFuns", "StatsModels", "Tables"]
git-tree-sha1 = "a1ccbe9f7356ba3cdb8faf6785e6a6037f7f00e0"
uuid = "ff71e718-51f3-5ec2-a782-8ffcbfa3c316"
version = "3.9.0"

[[MixedModelsPermutations]]
deps = ["LinearAlgebra", "MixedModels", "Random", "SparseArrays", "StaticArrays", "Statistics", "StatsBase", "StatsModels", "Tables"]
git-tree-sha1 = "067845f14c65df52ebdb2f74df5f3d41645c7f29"
uuid = "647c4018-d7ef-4d03-a0cc-8889a722319e"
version = "0.1.2"

[[MixedModelsSim]]
deps = ["LinearAlgebra", "MixedModels", "PooledArrays", "PrettyTables", "Random", "Statistics", "Tables"]
git-tree-sha1 = "ad4eaa164a5ab5fd22effcb86e7c991192ed3488"
uuid = "d5ae56c5-23ca-4a1f-b505-9fc4796fc1fe"
version = "0.2.3"

[[Mmap]]
uuid = "a63ad114-7e13-5084-954f-fe012c677804"

[[Mocking]]
deps = ["ExprTools"]
git-tree-sha1 = "916b850daad0d46b8c71f65f719c49957e9513ed"
uuid = "78c3b35d-d492-501b-9361-3d52fe80e533"
version = "0.7.1"

[[MozillaCACerts_jll]]
uuid = "14a3606d-f60d-562e-9121-12d972cd8159"

[[MutableArithmetics]]
deps = ["LinearAlgebra", "SparseArrays", "Test"]
git-tree-sha1 = "3927848ccebcc165952dc0d9ac9aa274a87bfe01"
uuid = "d8a4904e-b15c-11e9-3269-09a3773c0cb0"
version = "0.2.20"

[[NLopt]]
deps = ["MathOptInterface", "MathProgBase", "NLopt_jll"]
git-tree-sha1 = "e7b4c6b8e10b8d1238112a21f5cc001138989dc7"
uuid = "76087f3c-5699-56af-9a33-bf431cd00edd"
version = "0.6.2"

[[NLopt_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "2b597c46900f5f811bec31f0dcc88b45744a2a09"
uuid = "079eb43e-fd8e-5478-9966-2cf3e3edb778"
version = "2.7.0+0"

[[NaNMath]]
git-tree-sha1 = "bfe47e760d60b82b66b61d2d44128b62e3a369fb"
uuid = "77ba4419-2d1f-58cd-9bb1-8ffee604a2e3"
version = "0.3.5"

[[NetworkOptions]]
uuid = "ca575930-c2e3-43a9-ace4-1e988b2c1908"

[[Ogg_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "7937eda4681660b4d6aeeecc2f7e1c81c8ee4e2f"
uuid = "e7412a2a-1a6e-54c0-be00-318e2571c051"
version = "1.3.5+0"

[[OpenSSL_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "15003dcb7d8db3c6c857fda14891a539a8f2705a"
uuid = "458c3c95-2e84-50aa-8efc-19380b2a3a95"
version = "1.1.10+0"

[[OpenSpecFun_jll]]
deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "13652491f6856acfd2db29360e1bbcd4565d04f1"
uuid = "efe28fd5-8261-553b-a9e1-b2916fc3738e"
version = "0.5.5+0"

[[Opus_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "51a08fb14ec28da2ec7a927c4337e4332c2a4720"
uuid = "91d4177d-7536-5919-b921-800302f37372"
version = "1.3.2+0"

[[OrderedCollections]]
git-tree-sha1 = "85f8e6578bf1f9ee0d11e7bb1b1456435479d47c"
uuid = "bac558e1-5e72-5ebc-8fee-abe8a469f55d"
version = "1.4.1"

[[PCRE_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "b2a7af664e098055a7529ad1a900ded962bca488"
uuid = "2f80f16e-611a-54ab-bc61-aa92de5b98fc"
version = "8.44.0+0"

[[PDMats]]
deps = ["LinearAlgebra", "SparseArrays", "SuiteSparse"]
git-tree-sha1 = "4dd403333bcf0909341cfe57ec115152f937d7d8"
uuid = "90014a1f-27ba-587c-ab20-58faa44d9150"
version = "0.11.1"

[[Parsers]]
deps = ["Dates"]
git-tree-sha1 = "c8abc88faa3f7a3950832ac5d6e690881590d6dc"
uuid = "69de0a69-1ddd-5017-9359-2bf0b02dc9f0"
version = "1.1.0"

[[Pixman_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "b4f5d02549a10e20780a24fce72bea96b6329e29"
uuid = "30392449-352a-5448-841d-b1acce4e97dc"
version = "0.40.1+0"

[[Pkg]]
deps = ["Artifacts", "Dates", "Downloads", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "Serialization", "TOML", "Tar", "UUIDs", "p7zip_jll"]
uuid = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"

[[PlotThemes]]
deps = ["PlotUtils", "Requires", "Statistics"]
git-tree-sha1 = "a3a964ce9dc7898193536002a6dd892b1b5a6f1d"
uuid = "ccf2f8ad-2431-5c83-bf29-c5338b663b6a"
version = "2.0.1"

[[PlotUtils]]
deps = ["ColorSchemes", "Colors", "Dates", "Printf", "Random", "Reexport", "Statistics"]
git-tree-sha1 = "501c20a63a34ac1d015d5304da0e645f42d91c9f"
uuid = "995b91a9-d308-5afd-9ec6-746e21dbc043"
version = "1.0.11"

[[Plots]]
deps = ["Base64", "Contour", "Dates", "FFMPEG", "FixedPointNumbers", "GR", "GeometryBasics", "JSON", "Latexify", "LinearAlgebra", "Measures", "NaNMath", "PlotThemes", "PlotUtils", "Printf", "REPL", "Random", "RecipesBase", "RecipesPipeline", "Reexport", "Requires", "Scratch", "Showoff", "SparseArrays", "Statistics", "StatsBase", "UUIDs"]
git-tree-sha1 = "f32cd6fcd2909c2d1cdd47ce55e1394b04a66fe2"
uuid = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
version = "1.18.2"

[[PlutoUI]]
deps = ["Base64", "Dates", "InteractiveUtils", "JSON", "Logging", "Markdown", "Random", "Reexport", "Suppressor"]
git-tree-sha1 = "44e225d5837e2a2345e69a1d1e01ac2443ff9fcb"
uuid = "7f904dfe-b85e-4ff6-b463-dae2292396a8"
version = "0.7.9"

[[PooledArrays]]
deps = ["DataAPI", "Future"]
git-tree-sha1 = "cde4ce9d6f33219465b55162811d8de8139c0414"
uuid = "2dfb63ee-cc39-5dd5-95bd-886bf059d720"
version = "1.2.1"

[[Preferences]]
deps = ["TOML"]
git-tree-sha1 = "00cfd92944ca9c760982747e9a1d0d5d86ab1e5a"
uuid = "21216c6a-2e73-6563-6e65-726566657250"
version = "1.2.2"

[[PrettyTables]]
deps = ["Crayons", "Formatting", "Markdown", "Reexport", "Tables"]
git-tree-sha1 = "0d1245a357cc61c8cd61934c07447aa569ff22e6"
uuid = "08abe8d2-0d0c-5749-adfa-8a2ac140af0d"
version = "1.1.0"

[[Printf]]
deps = ["Unicode"]
uuid = "de0858da-6303-5e67-8744-51eddeeeb8d7"

[[ProgressMeter]]
deps = ["Distributed", "Printf"]
git-tree-sha1 = "afadeba63d90ff223a6a48d2009434ecee2ec9e8"
uuid = "92933f4c-e287-5a05-a399-4b506db050ca"
version = "1.7.1"

[[Qt5Base_jll]]
deps = ["Artifacts", "CompilerSupportLibraries_jll", "Fontconfig_jll", "Glib_jll", "JLLWrappers", "Libdl", "Libglvnd_jll", "OpenSSL_jll", "Pkg", "Xorg_libXext_jll", "Xorg_libxcb_jll", "Xorg_xcb_util_image_jll", "Xorg_xcb_util_keysyms_jll", "Xorg_xcb_util_renderutil_jll", "Xorg_xcb_util_wm_jll", "Zlib_jll", "xkbcommon_jll"]
git-tree-sha1 = "ad368663a5e20dbb8d6dc2fddeefe4dae0781ae8"
uuid = "ea2cea3b-5b76-57ae-a6ef-0a8af62496e1"
version = "5.15.3+0"

[[QuadGK]]
deps = ["DataStructures", "LinearAlgebra"]
git-tree-sha1 = "12fbe86da16df6679be7521dfb39fbc861e1dc7b"
uuid = "1fd47b50-473d-5c70-9696-f719f8f3bcdc"
version = "2.4.1"

[[REPL]]
deps = ["InteractiveUtils", "Markdown", "Sockets", "Unicode"]
uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb"

[[Random]]
deps = ["Serialization"]
uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"

[[RecipesBase]]
git-tree-sha1 = "b3fb709f3c97bfc6e948be68beeecb55a0b340ae"
uuid = "3cdcf5f2-1ef4-517c-9805-6587b60abb01"
version = "1.1.1"

[[RecipesPipeline]]
deps = ["Dates", "NaNMath", "PlotUtils", "RecipesBase"]
git-tree-sha1 = "2a7a2469ed5d94a98dea0e85c46fa653d76be0cd"
uuid = "01d81517-befc-4cb6-b9ec-a95719d0359c"
version = "0.3.4"

[[Reexport]]
git-tree-sha1 = "5f6c21241f0f655da3952fd60aa18477cf96c220"
uuid = "189a3867-3050-52da-a836-e630ba90ab69"
version = "1.1.0"

[[Requires]]
deps = ["UUIDs"]
git-tree-sha1 = "4036a3bd08ac7e968e27c203d45f5fff15020621"
uuid = "ae029012-a4dd-5104-9daa-d747884805df"
version = "1.1.3"

[[Richardson]]
deps = ["LinearAlgebra"]
git-tree-sha1 = "e03ca566bec93f8a3aeb059c8ef102f268a38949"
uuid = "708f8203-808e-40c0-ba2d-98a6953ed40d"
version = "1.4.0"

[[Rmath]]
deps = ["Random", "Rmath_jll"]
git-tree-sha1 = "bf3188feca147ce108c76ad82c2792c57abe7b1f"
uuid = "79098fc4-a85e-5d69-aa6a-4863f24498fa"
version = "0.7.0"

[[Rmath_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "68db32dff12bb6127bac73c209881191bf0efbb7"
uuid = "f50d1b31-88e8-58de-be2c-1cc44531875f"
version = "0.3.0+0"

[[SHA]]
uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce"

[[Scratch]]
deps = ["Dates"]
git-tree-sha1 = "0b4b7f1393cff97c33891da2a0bf69c6ed241fda"
uuid = "6c6a2e73-6563-6170-7368-637461726353"
version = "1.1.0"

[[SentinelArrays]]
deps = ["Dates", "Random"]
git-tree-sha1 = "ffae887d0f0222a19c406a11c3831776d1383e3d"
uuid = "91c51154-3ec4-41a3-a24f-3f23e20d615c"
version = "1.3.3"

[[Serialization]]
uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b"

[[SharedArrays]]
deps = ["Distributed", "Mmap", "Random", "Serialization"]
uuid = "1a1011a3-84de-559e-8e89-a11a2f7dc383"

[[ShiftedArrays]]
git-tree-sha1 = "22395afdcf37d6709a5a0766cc4a5ca52cb85ea0"
uuid = "1277b4bf-5013-50f5-be3d-901d8477a67a"
version = "1.0.0"

[[Showoff]]
deps = ["Dates", "Grisu"]
git-tree-sha1 = "91eddf657aca81df9ae6ceb20b959ae5653ad1de"
uuid = "992d4aef-0814-514b-bc4d-f2e9a6c4116f"
version = "1.0.3"

[[Sockets]]
uuid = "6462fe0b-24de-5631-8697-dd941f90decc"

[[SortingAlgorithms]]
deps = ["DataStructures"]
git-tree-sha1 = "b3363d7460f7d098ca0912c69b082f75625d7508"
uuid = "a2af1166-a08f-5f64-846c-94a0d3cef48c"
version = "1.0.1"

[[SparseArrays]]
deps = ["LinearAlgebra", "Random"]
uuid = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"

[[SpecialFunctions]]
deps = ["ChainRulesCore", "LogExpFunctions", "OpenSpecFun_jll"]
git-tree-sha1 = "a50550fa3164a8c46747e62063b4d774ac1bcf49"
uuid = "276daf66-3868-5448-9aa4-cd146d93841b"
version = "1.5.1"

[[StaticArrays]]
deps = ["LinearAlgebra", "Random", "Statistics"]
git-tree-sha1 = "a43a7b58a6e7dc933b2fa2e0ca653ccf8bb8fd0e"
uuid = "90137ffa-7385-5640-81b9-e52037218182"
version = "1.2.6"

[[Statistics]]
deps = ["LinearAlgebra", "SparseArrays"]
uuid = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"

[[StatsAPI]]
git-tree-sha1 = "1958272568dc176a1d881acb797beb909c785510"
uuid = "82ae8749-77ed-4fe6-ae5f-f523153014b0"
version = "1.0.0"

[[StatsBase]]
deps = ["DataAPI", "DataStructures", "LinearAlgebra", "Missings", "Printf", "Random", "SortingAlgorithms", "SparseArrays", "Statistics", "StatsAPI"]
git-tree-sha1 = "2f6792d523d7448bbe2fec99eca9218f06cc746d"
uuid = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
version = "0.33.8"

[[StatsFuns]]
deps = ["LogExpFunctions", "Rmath", "SpecialFunctions"]
git-tree-sha1 = "30cd8c360c54081f806b1ee14d2eecbef3c04c49"
uuid = "4c63d2b9-4356-54db-8cca-17b64c39e42c"
version = "0.9.8"

[[StatsModels]]
deps = ["DataAPI", "DataStructures", "LinearAlgebra", "Printf", "ShiftedArrays", "SparseArrays", "StatsBase", "StatsFuns", "Tables"]
git-tree-sha1 = "dfdf16cc1e531e154c7e62cd42d531e00f8d100e"
uuid = "3eaba693-59b7-5ba5-a881-562e759f1c8d"
version = "0.6.23"

[[StructArrays]]
deps = ["Adapt", "DataAPI", "StaticArrays", "Tables"]
git-tree-sha1 = "000e168f5cc9aded17b6999a560b7c11dda69095"
uuid = "09ab397b-f2b6-538f-b94a-2f83cf4a842a"
version = "0.6.0"

[[SuiteSparse]]
deps = ["Libdl", "LinearAlgebra", "Serialization", "SparseArrays"]
uuid = "4607b0f0-06f3-5cda-b6b1-a6196a1729e9"

[[Suppressor]]
git-tree-sha1 = "a819d77f31f83e5792a76081eee1ea6342ab8787"
uuid = "fd094767-a336-5f1f-9728-57cf17d0bbfb"
version = "0.2.0"

[[TOML]]
deps = ["Dates"]
uuid = "fa267f1f-6049-4f14-aa54-33bafae1ed76"

[[TableTraits]]
deps = ["IteratorInterfaceExtensions"]
git-tree-sha1 = "c06b2f539df1c6efa794486abfb6ed2022561a39"
uuid = "3783bdb8-4a98-5b6b-af9a-565f29a5fe9c"
version = "1.0.1"

[[Tables]]
deps = ["DataAPI", "DataValueInterfaces", "IteratorInterfaceExtensions", "LinearAlgebra", "TableTraits", "Test"]
git-tree-sha1 = "8ed4a3ea724dac32670b062be3ef1c1de6773ae8"
uuid = "bd369af6-aec1-5ad0-b16a-f7cc5008161c"
version = "1.4.4"

[[Tar]]
deps = ["ArgTools", "SHA"]
uuid = "a4e569a6-e804-4fa4-b0f3-eef7a1d5b13e"

[[Test]]
deps = ["InteractiveUtils", "Logging", "Random", "Serialization"]
uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[[TimeZones]]
deps = ["Dates", "Future", "LazyArtifacts", "Mocking", "Pkg", "Printf", "RecipesBase", "Serialization", "Unicode"]
git-tree-sha1 = "81753f400872e5074768c9a77d4c44e70d409ef0"
uuid = "f269a46b-ccf7-5d73-abea-4c690281aa53"
version = "1.5.6"

[[TranscodingStreams]]
deps = ["Random", "Test"]
git-tree-sha1 = "7c53c35547de1c5b9d46a4797cf6d8253807108c"
uuid = "3bb67fe8-82b1-5028-8e26-92a6c54297fa"
version = "0.9.5"

[[URIs]]
git-tree-sha1 = "97bbe755a53fe859669cd907f2d96aee8d2c1355"
uuid = "5c2747f8-b7ea-4ff2-ba2e-563bfd36b1d4"
version = "1.3.0"

[[UUIDs]]
deps = ["Random", "SHA"]
uuid = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"

[[Unicode]]
uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5"

[[Wayland_jll]]
deps = ["Artifacts", "Expat_jll", "JLLWrappers", "Libdl", "Libffi_jll", "Pkg", "XML2_jll"]
git-tree-sha1 = "3e61f0b86f90dacb0bc0e73a0c5a83f6a8636e23"
uuid = "a2964d1f-97da-50d4-b82a-358c7fce9d89"
version = "1.19.0+0"

[[Wayland_protocols_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Wayland_jll"]
git-tree-sha1 = "2839f1c1296940218e35df0bbb220f2a79686670"
uuid = "2381bf8a-dfd0-557d-9999-79630e7b1b91"
version = "1.18.0+4"

[[XML2_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Libiconv_jll", "Pkg", "Zlib_jll"]
git-tree-sha1 = "1acf5bdf07aa0907e0a37d3718bb88d4b687b74a"
uuid = "02c8fc9c-b97f-50b9-bbe4-9be30ff0a78a"
version = "2.9.12+0"

[[XSLT_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Libgcrypt_jll", "Libgpg_error_jll", "Libiconv_jll", "Pkg", "XML2_jll", "Zlib_jll"]
git-tree-sha1 = "91844873c4085240b95e795f692c4cec4d805f8a"
uuid = "aed1982a-8fda-507f-9586-7b0439959a61"
version = "1.1.34+0"

[[Xorg_libX11_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_libxcb_jll", "Xorg_xtrans_jll"]
git-tree-sha1 = "5be649d550f3f4b95308bf0183b82e2582876527"
uuid = "4f6342f7-b3d2-589e-9d20-edeb45f2b2bc"
version = "1.6.9+4"

[[Xorg_libXau_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "4e490d5c960c314f33885790ed410ff3a94ce67e"
uuid = "0c0b7dd1-d40b-584c-a123-a41640f87eec"
version = "1.0.9+4"

[[Xorg_libXcursor_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_libXfixes_jll", "Xorg_libXrender_jll"]
git-tree-sha1 = "12e0eb3bc634fa2080c1c37fccf56f7c22989afd"
uuid = "935fb764-8cf2-53bf-bb30-45bb1f8bf724"
version = "1.2.0+4"

[[Xorg_libXdmcp_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "4fe47bd2247248125c428978740e18a681372dd4"
uuid = "a3789734-cfe1-5b06-b2d0-1dd0d9d62d05"
version = "1.1.3+4"

[[Xorg_libXext_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_libX11_jll"]
git-tree-sha1 = "b7c0aa8c376b31e4852b360222848637f481f8c3"
uuid = "1082639a-0dae-5f34-9b06-72781eeb8cb3"
version = "1.3.4+4"

[[Xorg_libXfixes_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_libX11_jll"]
git-tree-sha1 = "0e0dc7431e7a0587559f9294aeec269471c991a4"
uuid = "d091e8ba-531a-589c-9de9-94069b037ed8"
version = "5.0.3+4"

[[Xorg_libXi_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_libXext_jll", "Xorg_libXfixes_jll"]
git-tree-sha1 = "89b52bc2160aadc84d707093930ef0bffa641246"
uuid = "a51aa0fd-4e3c-5386-b890-e753decda492"
version = "1.7.10+4"

[[Xorg_libXinerama_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_libXext_jll"]
git-tree-sha1 = "26be8b1c342929259317d8b9f7b53bf2bb73b123"
uuid = "d1454406-59df-5ea1-beac-c340f2130bc3"
version = "1.1.4+4"

[[Xorg_libXrandr_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_libXext_jll", "Xorg_libXrender_jll"]
git-tree-sha1 = "34cea83cb726fb58f325887bf0612c6b3fb17631"
uuid = "ec84b674-ba8e-5d96-8ba1-2a689ba10484"
version = "1.5.2+4"

[[Xorg_libXrender_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_libX11_jll"]
git-tree-sha1 = "19560f30fd49f4d4efbe7002a1037f8c43d43b96"
uuid = "ea2f1a96-1ddc-540d-b46f-429655e07cfa"
version = "0.9.10+4"

[[Xorg_libpthread_stubs_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "6783737e45d3c59a4a4c4091f5f88cdcf0908cbb"
uuid = "14d82f49-176c-5ed1-bb49-ad3f5cbd8c74"
version = "0.1.0+3"

[[Xorg_libxcb_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "XSLT_jll", "Xorg_libXau_jll", "Xorg_libXdmcp_jll", "Xorg_libpthread_stubs_jll"]
git-tree-sha1 = "daf17f441228e7a3833846cd048892861cff16d6"
uuid = "c7cfdc94-dc32-55de-ac96-5a1b8d977c5b"
version = "1.13.0+3"

[[Xorg_libxkbfile_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_libX11_jll"]
git-tree-sha1 = "926af861744212db0eb001d9e40b5d16292080b2"
uuid = "cc61e674-0454-545c-8b26-ed2c68acab7a"
version = "1.1.0+4"

[[Xorg_xcb_util_image_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_xcb_util_jll"]
git-tree-sha1 = "0fab0a40349ba1cba2c1da699243396ff8e94b97"
uuid = "12413925-8142-5f55-bb0e-6d7ca50bb09b"
version = "0.4.0+1"

[[Xorg_xcb_util_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_libxcb_jll"]
git-tree-sha1 = "e7fd7b2881fa2eaa72717420894d3938177862d1"
uuid = "2def613f-5ad1-5310-b15b-b15d46f528f5"
version = "0.4.0+1"

[[Xorg_xcb_util_keysyms_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_xcb_util_jll"]
git-tree-sha1 = "d1151e2c45a544f32441a567d1690e701ec89b00"
uuid = "975044d2-76e6-5fbe-bf08-97ce7c6574c7"
version = "0.4.0+1"

[[Xorg_xcb_util_renderutil_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_xcb_util_jll"]
git-tree-sha1 = "dfd7a8f38d4613b6a575253b3174dd991ca6183e"
uuid = "0d47668e-0667-5a69-a72c-f761630bfb7e"
version = "0.3.9+1"

[[Xorg_xcb_util_wm_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_xcb_util_jll"]
git-tree-sha1 = "e78d10aab01a4a154142c5006ed44fd9e8e31b67"
uuid = "c22f9ab0-d5fe-5066-847c-f4bb1cd4e361"
version = "0.4.1+1"

[[Xorg_xkbcomp_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_libxkbfile_jll"]
git-tree-sha1 = "4bcbf660f6c2e714f87e960a171b119d06ee163b"
uuid = "35661453-b289-5fab-8a00-3d9160c6a3a4"
version = "1.4.2+4"

[[Xorg_xkeyboard_config_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_xkbcomp_jll"]
git-tree-sha1 = "5c8424f8a67c3f2209646d4425f3d415fee5931d"
uuid = "33bec58e-1273-512f-9401-5d533626f822"
version = "2.27.0+4"

[[Xorg_xtrans_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "79c31e7844f6ecf779705fbc12146eb190b7d845"
uuid = "c5fb5394-a638-5e4d-96e5-b29de1b5cf10"
version = "1.4.0+3"

[[ZipFile]]
deps = ["Libdl", "Printf", "Zlib_jll"]
git-tree-sha1 = "c3a5637e27e914a7a445b8d0ad063d701931e9f7"
uuid = "a5390f91-8eb1-5f08-bee0-b1d1ffed6cea"
version = "0.9.3"

[[Zlib_jll]]
deps = ["Libdl"]
uuid = "83775a58-1f1d-513f-b197-d71354ab007a"

[[Zstd_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "cc4bf3fdde8b7e3e9fa0351bdeedba1cf3b7f6e6"
uuid = "3161d3a3-bdf6-5164-811a-617609db77b4"
version = "1.5.0+0"

[[libass_jll]]
deps = ["Artifacts", "Bzip2_jll", "FreeType2_jll", "FriBidi_jll", "JLLWrappers", "Libdl", "Pkg", "Zlib_jll"]
git-tree-sha1 = "acc685bcf777b2202a904cdcb49ad34c2fa1880c"
uuid = "0ac62f75-1d6f-5e53-bd7c-93b484bb37c0"
version = "0.14.0+4"

[[libfdk_aac_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "7a5780a0d9c6864184b3a2eeeb833a0c871f00ab"
uuid = "f638f0a6-7fb0-5443-88ba-1cc74229b280"
version = "0.1.6+4"

[[libpng_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Zlib_jll"]
git-tree-sha1 = "94d180a6d2b5e55e447e2d27a29ed04fe79eb30c"
uuid = "b53b4c65-9356-5827-b1ea-8c7a1a84506f"
version = "1.6.38+0"

[[libvorbis_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Ogg_jll", "Pkg"]
git-tree-sha1 = "c45f4e40e7aafe9d086379e5578947ec8b95a8fb"
uuid = "f27f6e37-5d2b-51aa-960f-b287f2bc3b7a"
version = "1.3.7+0"

[[nghttp2_jll]]
deps = ["Artifacts", "Libdl"]
uuid = "8e850ede-7688-5339-a07c-302acd2aaf8d"

[[p7zip_jll]]
deps = ["Artifacts", "Libdl"]
uuid = "3f19e933-33d8-53b3-aaab-bd5110c3b7a0"

[[x264_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "d713c1ce4deac133e3334ee12f4adff07f81778f"
uuid = "1270edf5-f2f9-52d2-97e9-ab00b5d0237a"
version = "2020.7.14+2"

[[x265_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "487da2f8f2f0c8ee0e83f39d13037d6bbf0a45ab"
uuid = "dfaa095f-4041-5dcd-9319-2fabd8486b76"
version = "3.0.0+3"

[[xkbcommon_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Wayland_jll", "Wayland_protocols_jll", "Xorg_libxcb_jll", "Xorg_xkeyboard_config_jll"]
git-tree-sha1 = "ece2350174195bb31de1a63bea3a41ae1aa593b6"
uuid = "d8fb68d0-12a3-5cfd-a85a-d49703b185fd"
version = "0.9.1+5"
"""

# ╔═╡ Cell order:
# ╠═b7ac3efc-8bda-41d9-b3d5-147591bac4b4
# ╠═72f5e910-e40d-11eb-3725-f19a95c9b3c1
# ╠═0eaf2824-dd65-4dfb-905e-96d8a1754e08
# ╠═cfd225bb-1eec-41b1-b6c1-ebc036b7e1d2
# ╠═d8335805-d7e3-45db-989b-0ed6f9a08525
# ╠═eef54200-4ccc-4d08-83b0-b277489f2bff
# ╠═58fa0d39-65e0-4ec7-aeb0-e8bde381379a
# ╠═968e3f53-055c-4dc0-b4e3-1217e511b3b4
# ╠═0cbf776c-8e56-4d32-8a55-da22f8bf1940
# ╠═3f4afdc8-04af-45b6-aadf-a72ca1ff158c
# ╠═6917ddd6-6ef3-43a5-83f1-ef6583be54f3
# ╠═cbecd90f-b262-4bbd-8a55-177f3e40ae50
# ╠═21664a88-30fd-4829-a70d-e727a5f5b66b
# ╟─55e97ef0-0f23-48a6-8229-7f1b6ca3d044
# ╟─2141edd4-c8ed-4d1b-a5ec-9913b19a2d4a
# ╟─bac32d2f-fb1f-4f02-b2f5-49df029b7b92
# ╟─eccf3c09-aa58-4c7c-8e43-364309df6885
# ╟─e132bb53-9b6c-4d61-bb45-d5d9209ff4da
# ╟─acc913dd-b17c-4137-83f4-7df179bdc3a1
# ╠═64d2509b-d94e-4e48-8f81-fa13d5f9e9be
# ╟─2776e7cf-ee8f-421e-98ed-fa03ecdbee68
# ╟─629d660c-6a13-422c-8acc-6c3b8d37acaa
# ╠═3fb9f0ef-af34-4624-8ce6-88d71711d005
# ╟─00000000-0000-0000-0000-000000000001
# ╟─00000000-0000-0000-0000-000000000002