This file contains hidden or 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
| library(lme4) | |
| a = dget('data.txt') | |
| #this should yield an error | |
| m1 = lmer( | |
| formula = rt ~ (1|id) + arrow*tone*flanker*sstroop*target*location | |
| , data = a | |
| ) | |
| b = a |
This file contains hidden or 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
| library(plyr) | |
| library(MASS) | |
| library(lme4a) | |
| generate_data = function( | |
| n # number of units | |
| , k # number of trials within each condition within each unit | |
| , noise # measurement noise variance | |
| , I # population intercept | |
| , vI # across-units variance of intercepts |
This file contains hidden or 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 used modules | |
| import pygame | |
| import sys | |
| import time | |
| import multiprocessing | |
| #initialize pygame | |
| pygame.init() | |
| #create a window |
This file contains hidden or 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
| Process: Python [28444] | |
| Path: /System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python | |
| Identifier: Python | |
| Version: ??? (???) | |
| Code Type: X86-64 (Native) | |
| Parent Process: Python [28443] | |
| PlugIn Path: /Library/Frameworks/SDL.framework/Versions/A/SDL | |
| PlugIn Identifier: SDL | |
| PlugIn Version: 1.2.14 (1.2.14) |
This file contains hidden or 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
| library(MASS) | |
| library(lme4) | |
| generate_data = function( | |
| n # number of units | |
| , k # number of trials within each condition within each unit | |
| , noise # measurement noise variance | |
| , I # population intercept | |
| , vI # across-units variance of intercepts | |
| , A # population A effect |
This file contains hidden or 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 used modules | |
| import sys | |
| import time | |
| import multiprocessing | |
| #create a multiprocessing Queue object for sending messages to an input process | |
| queueToInputProcess = multiprocessing.Queue() | |
| #create a multiprocessing Queue object for receiving messages from an input process |
This file contains hidden or 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
| #see file `dput_of_a.R` below this file for the data object `a` | |
| #load helpful libraries | |
| library(MASS) | |
| library(plyr) | |
| library(reshape) | |
| library(lme4) | |
| ######## | |
| # Method 1: Model and sample, then collapse |
This file contains hidden or 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
| #load doMC for parallelism | |
| library(doMC) | |
| options(cores=4) #adjust to match your system | |
| registerDoMC() | |
| #load plyr to use doMC implicitly | |
| library(plyr) | |
| #load the toy data set | |
| source('data.R') |
This file contains hidden or 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 (and contents) that need to be converted to OpenCL: extrema, envelope, extractimf, emd | |
| #function to find the extrema indices of a time series, y. | |
| extrema = function(y){ | |
| ny = length(y) | |
| nym1 = ny-1 | |
| maxindex = NULL | |
| minindex = NULL | |
| slope_signs = sign(diff(y)) | |
| if(slope_signs[1]==1){ |
This file contains hidden or 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
| window_res = (800,600) | |
| detection_image_scale = 4 #faster & more reliable to shrink the image before face detection | |
| pupil_threshold = 240 | |
| cam_scale = 1 | |
| import pygame | |
| import time | |
| import sys | |
| import cv |