This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Zygote | |
using Distributions | |
lm(x, m, b) = m .* x .+ b | |
x = rand(Uniform(-2, 2), 100) | |
ε = rand(Normal(0.0, 0.05), length(x)) | |
p₀ = [-1.2, 0.05] | |
y = lm(x + ε, p₀...) |
We can't make this file beautiful and searchable because it's too large.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Longitude,Latitude,Presence,Annual Mean Temperature,Mean Diurnal Range,Isothermality,Temperature Seasonality,Max Temperature of Warmest Month,Min Temperature of Coldest Month,Temperature Annual Range,Mean Temperature of Wettest Quarter,Mean Temperature of Driest Quarter,Mean Temperature of Warmest Quarter,Mean Temperature of Coldest Quarter,Annual Precipitation,Precipitation of Wettest Month,Precipitation of Driest Month,Precipitation Seasonality,Precipitation of Wettest Quarter,Precipitation of Driest Quarter,Precipitation of Warmest Quarter,Precipitation of Coldest Quarter | |
4.645833333333333,52.354166666666664,0,9.8115,6.8223333,32.80599,519.0232,21.28,0.484,20.796001,10.71,8.669333,16.204666,3.662,835.0,99.0,45.0,25.123003,280.0,156.0,202.0,197.0 | |
4.645833333333333,52.979166666666664,0,9.9,4.922222,26.727,493.6818,19.9,1.4833333,18.416666,11.4388895,10.944445,16.116667,4.2055554,813.0,103.0,46.0,29.996643,295.0,149.0,212.0,175.0 | |
4.854166666666667,61.0625,0,7.3601193,3.9666667,24.604933,464.8009,16.164286,0.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using DataFrames | |
using DataFramesMeta | |
using CSV: CSV | |
using CairoMakie | |
using AlgebraOfGraphics | |
using Dates | |
using Downloads | |
CairoMakie.activate!(; px_per_unit=2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Pkg | |
Pkg.activate(".") | |
using Colors | |
using Mustache | |
using Plots | |
using Clustering | |
luma(color) = luma(convert(RGB, color)) | |
luma(color::T) where {T <: RGB} = 0.299color.r + 0.587color.g + 0.114color.b |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Pkg | |
Pkg.activate(".") | |
using Turing | |
using StatsPlots | |
using StatsBase | |
import CSV | |
d_orig = CSV.read("ls.csv") | |
d = d_orig[d_orig.P .> 0,:] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# http://faculty.washington.edu/joelross/courses/archive/s13/cs261/lab/k/ | |
using EcologicalNetworks | |
using Plots | |
N = simplify(nz_stream_foodweb()[1]) | |
mutable struct NodePosition | |
x::Float64 | |
y::Float64 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cbfp = Dict( | |
:orange => "#e69f00", | |
:sky_blue => "#56b4e9", | |
:bluish_green => "#009e73", | |
:yellow => "#f0e442", | |
:blue => "#0072b2", | |
:vermillion => "#d55e00", | |
:reddish_purple => "#cc79a7" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Plots | |
λ = 1.07 | |
K = 50.0 | |
a = 0.06 | |
n = 1.0 | |
ΔN(Nt,Pt) = λ*Nt*exp((1-Nt/K)-a*Pt) | |
ΔP(Nt,Pt) = n*Nt*(1-exp(-a*Pt)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Plots | |
using Iterators | |
pyplot() | |
function dn(n1, n2; α=[1.0 0.0; 0.0 1.0], r1=1.0, r2=1.0) | |
dn1 = n1*(r1-α[1,1]*n1-α[1,2]*n2) | |
dn2 = n2*(r2-α[2,2]*n2-α[2,1]*n1) | |
return dn1, dn2 | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Plots | |
pyplot() | |
""" | |
Derivatives | |
prey, predator, growth, comp, conversion, predation, mortality | |
""" | |
function ṅ(x, y, r, q, α, β, δ) | |
ẋ = r*x - q*x^2 - β*y*x | |
ẏ = α*β*y*x - δ*y |
NewerOlder