Monthly Archives: May 2013

Parallel computing unidimTest in IRT

In the R package ltm by Dimitris Rizopoulos there is a function called unidimTest(). Computations of this function are very power consuming due the Monte Carlo procedure used inside. Without parallelizing only one core of your (surely) multicore computer is used for this computation. A simple modification of unidimTest() makes it possible to use the quite easy to use R package foreach for parallel computing using the R packages parallel and doParallel. See also parallel-r-loops-for-windows-and-linux by Vik Paruchuri.

I have changed the lines of unidimTest()

for (b in 1:B) {
  if (!missing(object)) 
    z.vals <- rnorm(n, ablts, se.ablts)
  data.new <- rmvlogis(n, parms, IRT = IRT, z.vals = z.vals)
  T.boot[b, ] <- eigenRho(data.new)$ev
}

to

T.boot[,] <- foreach(b=1:B, .combine="rbind", .errorhandling="pass") %dopar%
{
  #if (!missing(object)) 
  z.vals <- rnorm(n, ablts, se.ablts)
  data.new <- rmvlogis(n, parms, IRT = IRT, z.vals = z.vals)
  eigenRho(data.new)$ev   	
}

and named the function unidimTest.p().

The function is called as

library(foreach)
library(parallel)
library(doParallel)

registerDoParallel(cores=4) # put in here how many cores you want to be used

set.seed(666)
proc <- proc.time()
uni.p <- unidimTest.p(fit.rasch.u, B=100)
proc.time() - proc

and works at least on an Mac OS X (10.8.3) environment with R version 3.0.1.

 

 

Organizing life with Samsung Galaxy S3

My life is organized as following:

A) I have dates/appointments.
B) I have todos.
C) I take notes.
D) I have contacts.
E) I save bookmarks.
F) I share files.

I want all this to have in sync on all my devices, i.e. currently on my

  • [MBP] MacBook Pro (OS X 10.8)
  • [S3] Samsung Galaxy S3 (Android OS 4.1.2)
  • [iPod] iPod Touch 4th Generation (iOS 6).

I have the following cloud based solutions for…

A) owncloud.org
I have owncloud installed on my own server. The apps I use are iCal (MBP), S Planner (S3) and Calendar (iPod). Together with the S Planner I have installed CalDAV-sync beta to work with owncloud via CalDAV protocol.

B) astrid.com
Astrid is great for todo lists. I use the Astrid app (iPod, S3) and the web app (MBP).

C) gnotes.me
Gnotes is a powerfull and easy to use service to take notes. The Android app (S3) is really great and a little more powerful than the iOS app (iPod). The web app (MBP) is also a bit restricted, but easy to use.

D) owncloud.org
For contacts I use Contacts (MBP, iPod, S3). To sync with owncloud I use CardDAV-sync beta.

E) bit.ly
This service is great to save and share bookmarks across all my devices. On iOS there is the bitly app (iPod) and on the other devices I use the (mobile optimized) web app (MBP, S3).

F) dropbox.com
Dropbox is essential for file sharing across devices and for uploading photos taken by S3. On the mobile devices (S3, iPod) I use the dropbox app and on the desktop (MBP) the app as well as the web app (MBP).