# The Utility of Social Preferences in Javascript

This post just contains a fun example of utility indifference curves in a dictator scenario. Basically, I'm just following Charness 2002. The article is an interesting one, showing that people may be more concerned with social welfare (a weighted sum of everyone's payoff) instead of being difference averse (not liking inequality between people's payoffs).

Take the example of a Player B who in a dictator game has to decide a split of money between himself and Player A. A model then for the utility of the splits is the following (where $\pi_a$ is the amount paid to Player A, and $\pi_b$ the amount to B):

$U_B(\pi_a, \pi_b) = (\rho * r + \sigma * s) * x + ( 1 - \rho * r - \sigma * s) * y$

Where

$r = 1$ if $\pi_B > \pi_A$, and $r = 0$ otherwise.

$s = 1$ if $\pi_B < \pi_A$, and $s = 0$ otherwise.

In the graph below, the x-axis represents your payoff, with more payoff towards the right side. The y-axis represents the other player's payoff, with higher values toward the top. Greater utility values are darker, while lower ones are lighter. (Yes, I should probably put this with axis labels and a legend, but it's kind of hard to align it with CSS. =P)

You can tweak the utility equation below, as well as the sliders for the values of $\rho$ and $\sigma$ and the graph will update in real time.

Rho: 0
Sigma: 0

Press the buttons below to generate random examples of competitive, difference averse, or social welfare preferences.

Competitive preferences
happen when $\sigma \leq \rho \leq 0$. With competitive preferences people prefer their payoff to be high compared to others.

Difference aversion
happens when $\sigma < 0 < \rho < 1$. This means that a player both prefers more money and for their payoff to be equal to their counterpart.

Social welfare preferences
happen when $1 \geq \rho \geq \sigma > 0$. With social welfare preferences people prefer money both for themselves and the other player, but prefer more for themselves when they are behind the other player compared to when they're ahead.

# The Drift Diffusion Model in Javascript

A lot of times when we're modeling decision making, we model decisions with something like a softmax function. This, however, doesn't take into account the computational difficulty in making decisions. How do we model differing reaction times in making a decision?

Enter the drift diffusion model. The drift diffusion model basically models decisions as a Gaussian random walk with a stopping time. Here I've included a tool that will allow you to play around with a drift diffusion model.

Threshold:

Drift:

Simulations:

Maxtime:

# Making Scientific Posters in LaTeX

Recently I had to make a scientific poster for the Berkeley neuroscience retreat. I had asked my lab mates what they used to create posters. Most of them, I think, used PowerPoint, which I can't use since I'm on Linux. Using LibreOffice Impress also seemed like a pain. And I really wanted my poster to be in PDF format.

So I stumbled upon using Scribus, which is used for desktop publishing. Scribus can create print-ready PDFs and has facilities for wrapping text around images. I used it for about a week until I finally gave up. It turns out that Scribus is a real PITA to use. Laying out text with the story editor is irritating to say the least. For example, if you try to emphasize text like this in the story editor, you can't see it within the story editor. On top of that, you have to select all the text you want to change, like if I wanted to change from Arphic Uming to Courier or whatever, I have to select everything. But because the font's not automatically previewed within the story editor, you don't realize that you've changed absolutely nothing by using the drop-down menu. There's also no undo history as far as I can tell, which is probably why it's recommended to edit your text in a .txt file first.

# Holding a Face in an MRI scanner

Recently I had an MRI done on me as part of an MRI scanner operator training session. I decided to hold a face for the T1 scan, which is actually quite difficult because the process takes 5 minutes. Muscles in your face, I believe, aren't supposed to hold the same expression for several minutes in a row, and if you ever try it you'll find your face muscles twitching quite a bit.

I got a copy of my scan and used AFNI and Blender to render the voxel data as I described in an earlier post. I can't decide if the result is creepy or funny looking, haha.