Skip to content

Instantly share code, notes, and snippets.

@josef-pkt
josef-pkt / example_tukeyhsd.py
Created April 6, 2014 01:55
Using Tukey HSD in statsmodels
{
"metadata": {
"name": "example_tukeyhsd"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
@josef-pkt
josef-pkt / ex_boxplots.ipynb
Created September 20, 2014 16:45
options for beanplots
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@josef-pkt
josef-pkt / nemenyi.py
Last active August 29, 2015 14:10 — forked from alimuldal/nemenyi.py
import numpy as np
from scipy import stats
from itertools import combinations
from statsmodels.stats.multitest import multipletests
from statsmodels.stats.libqsturng import psturng
import warnings
def kw_nemenyi(groups, to_compare=None, alpha=0.05):
"""
@josef-pkt
josef-pkt / dunn.py
Last active August 29, 2015 14:10 — forked from alimuldal/dunn.py
import numpy as np
from scipy import stats
from itertools import combinations
from statsmodels.stats.multitest import multipletests
from statsmodels.stats.libqsturng import psturng
import warnings
def kw_dunn(groups, to_compare=None, alpha=0.05, method='bonf'):
"""
from scipy import stats
class GaussianKernelDensityEstimation(object):
"""docstring for GaussianKernelDensityEstimation"""
def __init__(self):
self.gkde = None
def fit(self, X):
"""docstring for fit"""
self.gkde = stats.gaussian_kde(X.T)
@josef-pkt
josef-pkt / kruskal_permuted.py
Created October 7, 2011 13:49
scipy.stats.kruskal with random permutation p-values
# -*- coding: utf-8 -*-
"""scipy.stats.kruskal with random permutation p-values
Created on Thu Oct 06 16:52:14 2011
Author: scipy developers, Christopher Kuster and edited by Josef Perktold
License: Scipy, BSD-3
https://github.com/scipy/scipy/pull/87
"""
@josef-pkt
josef-pkt / multidim_digitize.py
Created December 22, 2011 21:37 — forked from daien/multidim_digitize.py
Build a regular grid and assigns each data point to a cell
'''
Author: Adrien Gaidon
https://gist.github.com/1509853
BSD on mailing list
Josef Perktold for numpy 1.5 compatibility
'''
@josef-pkt
josef-pkt / try_partial_linear.py
Created February 25, 2012 23:13
Partial linear model - estimated with concentrated least square
# -*- coding: utf-8 -*-
"""Partial Linear Model, with parametric nonlinear part
Created on Sat Feb 25 17:03:13 2012
Author: Josef Perktold
License: BSD-3 (statsmodels)
warning: first draft, not much checked yet,
dangerous: example uses same variable names as class
@josef-pkt
josef-pkt / ols_nist_filip.py
Created March 4, 2012 17:43
checking numerical accuracy
# -*- coding: utf-8 -*-
"""Checking numerical Accuracy in Linear Regression
Created on Sat Feb 25 20:36:50 2012
Author: Josef Perktold
License: BSD-3
"""
@josef-pkt
josef-pkt / scatter_fit.py
Created April 2, 2012 01:15
Plots a scatter plot of vectors x and y, also showing marginal histograms and least squares line fit. Sparklines are optionally displayed (relevant if the data are time series). "shs" in the name is shorthand for "Scatter plot with Histograms and Sparklin
#Copyright (c) 2011, Josh Hemann (hemann @ colorado . edu)
#All rights reserved.
#
#Redistribution and use in source and binary forms, with or without
#modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.