# Understanding the CANDECOMP/PARAFAC Tensor Decomposition, aka CP; with R code

A tensor is essentially a multi-dimensional array:

# A comprehensive Linux command cheat sheet

I think that it doesn’t matter what operating system you use — as long as you know your OS of choice well! This is a Linux command cheat sheet covering a wide range of topics. I cannot guarantee that the information is fully up-to-date or even correct. Use at own risk . It is intended primarily as a reference for myself in the future. I have learned most of the material covered below a couple of years ago in the LinuxFoundationX’s Introduction to Linux course offered through edx.org.

# Contours of statistical penalty functions as GIF images

Many statistical modeling problems reduce to a minimization problem of the general form:

# Tired of doing real math 2 — grad school and coffee consumption

Lately I notice a sharp increase in my coffee consumption (reading Howard Schultz’s Starbucks book, which is actually quite good by the way, does not help either ). Having recently transitioned into a new PhD program I started wondering whether my increased coffee consumption has something to do with my higher stress levels in the last few weeks, and how that conjecture generalizes to the rest of my grad school experience. To answer that question I decided to take a look at how much money I have spent at coffee houses over the last few years. …Also, I’m right now over-caffeinated at 1:40am and I have nothing better to do anyway.

# Visualization of MRI data in R

Lately I was getting a little bored with genomic data (and then TCGA2STAT started to give me a segfault on my university’s high performance computing facility too ). So I decided to analyze some brain imaging data that I had lying around instead. The first step is to do some visual data exploration. In this blog post I present some functions which I was able to find for MRI visualization in R, and which I found to be very useful. All functions presented below presuppose an image in the NIfTI data format as input, and are very user-friendly.

# Turn an old laptop into a home server with remote access over VPN

This weekend I have set up an old laptop with a broken screen as an Amahi server in my house, such that I can access the files stored on the server with my other computers from anywhere.1 I use OpenVPN to establish a connection to the server and its files. As an additional benefit, connecting over a VPN when on a public network secures the traffic to and from you.

1. Initially I got the idea for a home server after an email from Dropbox informed me that my promotional 48 GB of storage space expire in a month. Instead of paying one of the numerous cloud storage providers, I decided to host an ownCloud at home (after some guides online made it sound easier than it actually is…). Unfortunately, ownCloud on an Amahi server turned out to be quite disappointing. I found ownCloud to lack some functionality and to be very inconvenient in certain ways, and it possibly poses a security risk when accessible from outside the local network. So, I eventually got rid of ownCloud, and retreated to storing my files directly on the server in file shares

# Generalized inverse of a symmetric matrix

I have always found the common definition of the generalized inverse of a matrix quite unsatisfactory, because it is usually defined by a mere property, $A A^{-} A = A$, which does not really give intuition on when such a matrix exists or on how it can be constructed, etc… But recently, I came across a much more satisfactory definition for the case of symmetric (or more general, normal) matrices.

I had some fun analysing the shelter animal data from kaggle using the Ruby gems daru for data wrangling and statsample-glm for model fitting. In this blog post, I want to demonstrate that data wrangling and statistical modeling is not an area of absolute predominance of Python and R, but that it is possible in Ruby too (though, currently to a much lesser extent).