I hereby claim:
- I am cpfiffer on github.
- I am cpfiffer (https://keybase.io/cpfiffer) on keybase.
- I have a public key ASBuOyV4zsOUIxWVtBtAh0aRwqkKu25BwWPjUIxgfL8R4go
To claim this, I am signing this object:
# Set up environment | |
import Pkg; Pkg.activate(".") | |
# Imports | |
using Distributions | |
using Plots | |
using Polynomials | |
using Optim | |
using ForwardDiff |
Formula: | |
returns ~ BITX + lag_returns + log_active + lag_active + log_avg_size + log_med_size + log_mode_size + native_transactions + :(fe(yearmonth)) | |
Fixed Effect Model | |
======================================================================================= | |
Number of obs: 1066 Degrees of freedom: 44 | |
R2: 0.157 R2 Adjusted: 0.122 | |
F Statistic: 12.4004 p-value: 0.000 | |
R2 within: 0.106 Iterations: 1 | |
Converged: true |
using Turing, MCMCChains | |
using AbstractMCMC | |
using JLD2, FileIO | |
import Random: GLOBAL_RNG | |
# Create a model. | |
@model model(y) = begin | |
μ ~ Normal(0, 1) | |
s ~ InverseGamma(2,3) |
using Turing | |
using CSVFiles | |
using DataFrames | |
using Dates | |
using StatsPlots | |
# The TV syntax allows sampling to be type-stable. | |
@model garch(r, ::Type{TV}=Vector{Float64}) where {TV} = begin | |
T = length(r) |
using MCMCChains | |
function sim(nsamples) | |
cnt = 0 | |
for i in 1:1000 | |
chn = Chains(randn(nsamples,1,1)) | |
ess = describe(chn)[1].df[:ess][1] | |
ess > nsamples ? cnt+=1 : nothing | |
end | |
return cnt |
using CmdStan, StatsPlots, Random, MCMCDiagnostics | |
Random.seed!(12395391) | |
ProjDir = @__DIR__ | |
cd(ProjDir) | |
berstanmodel = " | |
data { | |
int<lower=0> N; |
using CmdStan, DynamicHMC | |
using StatsPlots, Random, MCMCDiagnostics | |
using Revise | |
using Turing, AdvancedHMC; const AHMC = AdvancedHMC | |
Random.seed!(1239911) | |
ProjDir = @__DIR__ | |
cd(ProjDir) | |
Nsamples = 2000 |
module P21 (properDivisors, sumDivisors, sumAmicable, isAmicable, amicableList) where | |
properDivisors :: Int -> [Int] | |
properDivisors x = [xs | xs <- [1..x-1], x `mod` xs == 0] | |
sumDivisors :: Int -> Int | |
sumDivisors x = sum $ properDivisors x |
I hereby claim:
To claim this, I am signing this object:
# From Keith Wynroe, a battle for the tokens: | |
# | |
# You have one token, and I have two tokens. Naturally, we both crave more tokens, so we play a game of skill that unfolds over a number of rounds in which the winner of each round gets to steal one token from the loser. The game itself ends when one of us is out of tokens — that person loses. Suppose that you’re better than me at this game and that you win each round two-thirds of the time and lose one-third of the time. | |
# | |
# What is your probability of winning the game? | |
@everywhere function play_game() | |
p1 = 2 | |
p2 = 1 | |
play = true |