Understanding the Tucker decomposition, and compressing tensor-valued data (with R code)

In many applications, data naturally form an n-way tensor with n > 2, rather than a “tidy” table. As mentioned in the beginning of my last blog post, a tensor is essentially a multi-dimensional array:

  • a tensor of order one is a vector, which simply is a column of numbers,
  • a tensor of order two is a matrix, which is basically numbers arranged in a rectangle,
  • a tensor of order three looks like numbers arranged in rectangular box (or a cube, if all modes have the same dimension),
  • an nth order (or n-way) tensor looks like numbers arranged in an n-hyperrectangle… you get the idea…
Read More

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!:bowtie: 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 :stuck_out_tongue:. 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.

Read More

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 :grimacing:). 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. :smile:

Read More

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 :stuck_out_tongue:). 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.

Read More

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

Read More

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. :smiley:

Read More