Skip to content

Instantly share code, notes, and snippets.

import time
import numpy as np
import pandas as pd
import seaborn as sns
x = [1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 6]
fig, ax = plt.subplots()
@messefor
messefor / 200906_blog_stan.r
Created September 5, 2020 23:06
Code for gamma regression
# Simulate exponential data / gamma distribution with stan
library(rstan)
library(tidyverse)
options(mc.cores = parallel::detectCores())
rstan_options(auto_write = TRUE)
# -----------------------------------------------------------
data {
int N;
vector[N] x;
vector[N] y;
}
parameters {
real<lower=0> a;
real<lower=0> phi; // variance of gamma
real<lower=0> b0;
@messefor
messefor / 200912_cmp1.sh
Created September 12, 2020 07:44
Compare all files in the first directory with those of the second directory.
#! /bin/bash
# Compare all files in the first directory with those of the second directory
dir1=src1/ # 1st Directory
dir2=src2/ # 2nd Directory
fpaths=${dir1}* # Fetch all file paths in the 1st directory
# Loop for all files
i=0
@messefor
messefor / calc_compound_interest.ipynb
Created October 2, 2021 09:25
calc_compound_interest.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
{
"nbformat": 4,
"nbformat_minor": 0,
"metadata": {
"colab": {
"private_outputs": true,
"provenance": [],
"gpuType": "T4"
},
"kernelspec": {