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
/* | |
* Tolerance Principle calculator, based on: | |
* | |
* C. Yang (2005). On productivity. Language Variation Yearbook 5:333-370. | |
* | |
* Definition: | |
* | |
* The number of data points consistent with a rule R is given by N, and the | |
* number of exceptions to it by m. By Tolerance, R is productive iff: | |
* |
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
// A cool way to draw a martini glass; this was on the final of CS 115 at U of I | |
#include <stdio.h> | |
void drawcup(int N, int offset) { | |
// base case | |
if (offset > N) | |
return; |
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) 2012 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
syn on | |
set ruler | |
" tab stuff | |
set expandtab | |
set hlsearch | |
set tabstop=4 | |
" scrolling | |
set scrolloff=5 | |
" backspace over everythign | |
set backspace=indent,eol,start |
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 <[email protected]> | |
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
# 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
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) 2014-2015 Kyle Gorman <[email protected]> | |
# | |
# 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
#!/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
"""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): |
OlderNewer