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
# compare point distributions for I and D optimal designs | |
# file: idopt.R | |
# | |
rm(list=ls()) | |
library(pwr) | |
library(AlgDesign) | |
library(xtable) | |
dice = data.frame(var=c("x","y"), low=c(-1,-1), high=c(1,1), center=c(0,0), nLevels=111, round=4, factor=FALSE) | |
Ispace = gen.factorial(levels=c(111,111),nVars=2,center=TRUE,varNames=c("x","y"))/55 |
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
# file: polywell_sym.R | |
# example of a test design and mixed effect analysis for measuring | |
# polywell performance and characterizing symmetry | |
# author: Josh Stults, www.variousconsequences.com | |
# date: 28 July 2012 | |
# see also: | |
# http://prometheusfusionperfection.com/2012/07/27/symmetry-test/ | |
# http://cran.r-project.org/web/packages/AlgDesign/index.html | |
# www.stat.wisc.edu/~bates/IMPS2008/lme4D.pdf |
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
# | |
# experimental designs using different basis | |
# | |
library(AlgDesign) | |
# generate a full factorial combination of factor levels | |
candidates = gen.factorial(levels=c(51,51), nVars=2, center=TRUE, varNames=c("X1","X2")) | |
cand.2 = gen.factorial(levels=c(7,7), nVars=2, center=TRUE, varNames=c("X1","X2")) | |
# add columns for the orthogonal basis | |
candidates = transform(candidates, X1.p = poly(candidates$X1, degree=6), X2.p = poly(candidates$X2, degree=6)) |
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
# | |
# do some simple time series analysis on smartphone os data | |
# data: http://www.catb.org/esr/comscore/ | |
# commentary: http://esr.ibiblio.org/?p=4368 | |
# | |
# this file has the market share percentages table | |
osdata = t(read.csv("os_stats.csv",header=TRUE,row.names=1)) | |
# this file has the raw userbase in millions | |
osdata2 = t(read.csv("os_stats_2.csv",header=TRUE,row.names=1)) |
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
/* | |
Sampling with the Arduino | |
based on examples from | |
http://sites.goggle.com/site/MeasuringStuff | |
*/ | |
#define FASTADC 1 | |
// defines for setting and clearing register bits | |
#ifndef cbi | |
#define cbi(sfr, bit) (_SFR_BYTE(sfr) &= ~_BV(bit)) | |
#endif |
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 as sp | |
from scipy.integrate import ode | |
from scipy.optimize import fsolve | |
from matplotlib import rc | |
rc('text', usetex=True) | |
tick_size = 'large' | |
label_size = 'xx-large' | |
rc('xtick', labelsize=8) | |
rc('ytick', labelsize=8) | |
rc('legend', fontsize=12) |
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 as sp | |
from scipy.integrate import ode | |
from scipy.optimize import fsolve | |
from scipy.optimize import fmin | |
from matplotlib import rc | |
rc('text', usetex=True) | |
tick_size = 'large' | |
label_size = 'xx-large' | |
rc('xtick', labelsize=8) | |
rc('ytick', labelsize=8) |
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 as sp | |
from scipy.integrate import ode | |
from scipy.optimize import fsolve | |
from matplotlib import rc | |
rc('text', usetex=True) | |
tick_size = 'large' | |
label_size = 'xx-large' | |
rc('xtick', labelsize=8) | |
rc('ytick', labelsize=8) | |
rc('legend', fontsize=12) |
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 as sp | |
from scipy.integrate import ode | |
from scipy.optimize import fsolve | |
from matplotlib import rc | |
rc('text', usetex=True) | |
tick_size = 'large' | |
label_size = 'xx-large' | |
rc('xtick', labelsize=8) | |
rc('ytick', labelsize=8) | |
rc('legend', fontsize=12) |
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 as sp | |
from scipy.integrate import ode | |
from scipy.optimize import fsolve | |
from matplotlib import rc | |
rc('text', usetex=True) | |
tick_size = 'large' | |
label_size = 'xx-large' | |
rc('xtick', labelsize=8) | |
rc('ytick', labelsize=8) | |
rc('legend', fontsize=12) |