This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Computes relative error reduction given two percentages. | |
// | |
// This computes relative error reduction (RER) given two percentages, the | |
// "before" and "after" accuracy. | |
// | |
// This is given by: | |
// | |
// RER = 1 - (1 - new_accuracy) / (1 - old_accuracy) | |
// | |
// To compile: gcc -O3 -std=c99 -o rer rer.c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env Rscript | |
# WALS131A.R | |
# Kyle Gorman <kylebgorman@gmail.com> | |
# | |
# Tests the hypothesis that vigesimal (base-20) number systems are more common | |
# at tropical latitudes. Thanks to Richard Sproat for suggesting this | |
# hypothesis. | |
# | |
# The data is read directly from WALS (#131A): | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# | |
# Copyright (c) 2013-2014 Kyle Gorman | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a | |
# copy of this software and associated documentation files (the | |
# "Software"), to deal in the Software without restriction, including | |
# without limitation the rights to use, copy, modify, merge, publish, | |
# distribute, sublicense, and/or sell copies of the Software, and to | |
# permit persons to whom the Software is furnished to do so, subject to |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Functions for computing log-likelihood ratio statistics.""" | |
from libc.math cimport log | |
from scipy.stats import binom | |
from scipy.stats import chi2 | |
cpdef double LLR(int c_a, int c_b, int c_ab, int n): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# | |
# Copyright (c) 2014 Kyle Gorman | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a | |
# copy of this software and associated documentation files (the | |
# "Software"), to deal in the Software without restriction, including | |
# without limitation the rights to use, copy, modify, merge, publish, | |
# distribute, sublicense, and/or sell copies of the Software, and to | |
# permit persons to whom the Software is furnished to do so, subject to |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright (c) 2014-2015 Kyle Gorman <gormanky@ohsu.edu> | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a | |
# copy of this software and associated documentation files (the | |
# "Software"), to deal in the Software without restriction, including | |
# without limitation the rights to use, copy, modify, merge, publish, | |
# distribute, sublicense, and/or sell copies of the Software, and to | |
# permit persons to whom the Software is furnished to do so, subject to | |
# the following conditions: | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import scipy.stats | |
def mcnemar_p(n1: int, n2: int) -> float: | |
"""Computes McNemar's test. | |
Args: | |
n1: the number of "wins" for the first condition. | |
n2: the number of "wins" for the second condition. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright (c) 2013-2022 Kyle Gorman | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a | |
# copy of this software and associated documentation files (the | |
# "Software"), to deal in the Software without restriction, including | |
# without limitation the rights to use, copy, modify, merge, publish, | |
# distribute, sublicense, and/or sell copies of the Software, and to | |
# permit persons to whom the Software is furnished to do so, subject to | |
# the following conditions: | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# autoloess.R: compute loess metaparameters automatically | |
# Kyle Gorman <gormanky@ohsu.edu> | |
aicc.loess <- function(fit) { | |
# compute AIC_C for a LOESS fit, from: | |
# | |
# Hurvich, C.M., Simonoff, J.S., and Tsai, C. L. 1998. Smoothing | |
# parameter selection in nonparametric regression using an improved | |
# Akaike Information Criterion. Journal of the Royal Statistical | |
# Society B 60: 271–293. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
syn on | |
set hlsearch | |
set ruler | |
" tab stuff | |
set expandtab | |
set tabstop=4 | |
" scrolling | |
set scrolloff=5 | |
" backspace over everythign | |
set backspace=indent,eol,start |