Skip to content

Instantly share code, notes, and snippets.

@parthi2929
parthi2929 / SDSP.ipynb
Last active August 8, 2018 12:23
Sampling Distributions of Sample Proportion
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@parthi2929
parthi2929 / SDSPSM.py
Last active August 18, 2018 18:15
Helper functions to illustrate Sample distributions
# SDSP = Sample Distribution of Sample Proportions
# This is helper file for programmatic illustrations of SDSP concepts.
from random import shuffle
import pandas as pd
import numpy as np
from math import sqrt, pi
def create_bernoulli_population(N, p):
"""
@parthi2929
parthi2929 / SDSPSM.ipynb
Created August 16, 2018 06:09
Simplified article - One case for Sample proportions and One for Sample Means
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@parthi2929
parthi2929 / 24. Confidence Intervals.ipynb
Last active September 14, 2018 10:39
Draft article about confidence intervals - statistical exploration.. Sharing here, for questions to be asked on this.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@parthi2929
parthi2929 / ci_helpers.py
Last active September 8, 2018 17:57
helper files for visualizing and performing statistical analysis on confidence intervals
from random import shuffle
import matplotlib.pyplot as plt
from SDSPSM import get_metrics
from random import choices, seed
from math import sqrt, pi
def create_bernoulli_population(T, p):
y_freq = int(p*T)
y_pops = [1]*y_freq
o_freq = int((1-p)*T)
@parthi2929
parthi2929 / CI_using_Wilson_score.ipynb
Created August 22, 2018 12:09
CI using Wilson score as recommended as one of new measures of calculating CI by Michael Lew
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@parthi2929
parthi2929 / citest_results_1.py
Created August 24, 2018 07:11
This is testing if Adam's simplified version works
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"This is simpler version by [Adam](https://www.linkedin.com/in/adam-sherwin-9202018/) in order to help me fix the problem [here](https://math.stackexchange.com/questions/2886986/confidence-intervals-inconsistent-statistical-results). His code is [here](https://gist.github.com/absherwin/9ea495333f3f269c6edec3ac7dd0b978)\n",
"\n",
"## Test 1: \n",
"\n",
@parthi2929
parthi2929 / ipy2tex.py
Created September 5, 2018 13:37
This is to convert a notebook to latex using nbconvert api. Currently not yet exports individual file images. Note the references in resulting tex file also in same folder.
sourcefile = r"../../test.ipynb" # file to be converted
with open(sourcefile) as nb_file:
nb_contents = nb_file.read()
import nbformat
# Convert using the ordinary exporter
notebook = nbformat.reads(nb_contents, as_version=4)
# create a configuration object to extract figures as files
@parthi2929
parthi2929 / "INCOMPLETE - Sampling with or without replacement.ipynb"
Last active September 16, 2018 18:00
Demo to show the weird difference in CI results I get in sampling distribution of sample proportions.
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Create Population"
]
},
{
@parthi2929
parthi2929 / jupyter latex limitation
Created September 9, 2018 14:13
there is an issue in jupyter treating latex while converting to tex or pdf
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Try converting this page to latex and compile using pdflatex..\n",
"\n",
"\\begin{equation}\n",
"\\color {blue}{\n",