Skip to content

Instantly share code, notes, and snippets.

View FriesischScott's full-sized avatar

Jasper Behrensdorf FriesischScott

View GitHub Profile
@FriesischScott
FriesischScott / pce-least-squares.jl
Created February 7, 2022 16:16
PCE with least squares minimization
using Distributions
function P(x::Float64, d::Int)
if d == 0
return 1.0
end
if d == 1
return x
end
@FriesischScott
FriesischScott / pce-quadrature.jl
Last active February 3, 2022 13:00
PCE Quadrature
using Distributions
using FastGaussQuadrature
function P(x::Float64, d::Int)
if d == 0
return 1.0
end
if d == 1
return x
@FriesischScott
FriesischScott / clayton.jl
Last active January 7, 2022 15:55
Sample from a clayton copula
using Distributions
using SpecialFunctions
using Plots
"""
Generator
"""
function φ(x::Real, ϑ::Real)
return (1+x)^(−1/ϑ)
end
@FriesischScott
FriesischScott / carbonation.js
Last active April 20, 2021 11:16
CO2 content of the beer based on the beer temperature and CO2 head pressure
function carbonation(P, T) {
return (P + 1.013) * Math.exp(-10.73797 + (2617.25 / (T + 273.15))) * 10
}