To ASIS with love


Mum’s the word, mate, I understand it’s a secret.

I won’t say anything about this elevator:


I won’t mention that with Windows 10 XBox game record feature on the browser (Windows key + G), it is easy to record the entire sequence.  (Mac users: I don’t know.)

The DVR allows us to capture and re-experience a wonderful demonstration of the British locative adverb hyuh (sorry I don’t have the software handy to stretch it out a little bit, you just have to savor it’s quick appearance at the end):

Don’t forget the clock:


People don’t usually interview at 1:45AM, so maybe it’s 1:45 PM!

Flying to Narita? That’s in Tokyo.

Regarding the attendant:


  1. She likes you to wait quietly while she dithers
  2. She wants you to note that it is busy today.  She doesn’t want you to ask if she’s worried because she will think you think she has behavioral health challenges..
  3. Tell her work will be over soon.
  4. Tell her you don’t want to bother her.
  5. She has a partner?  Interesting choice of words.  And she gave you the seat you were hoping for, without you even having to ask!  Please gift her a rainbow unicorn:


Regarding these guys:

2 people

If you got your Windows Game DVR on, you might spot Ben, Alicia, Darryl and Kate.  I didn’t see Paul or Lisa, maybe I missed them.

Spies generally don’t do this:


Finally, regarding these yentas (can they possibly all be the same woman?  did they hire triplets? or use some really good green screen compositor? was the casting budget a bit tight? or do all Australians look alike? ):


Carefully reviewing the recording will tell us the following 5 things:

  • There is a noodle shop around the corner from Emerald St.
  • One of these ladies likes fettuccine.
  • There are 6 courses on the fixed menu.
  • Joan stood them up
  • Australian software developers really like spinning cubes:


If you care about any of this, please feel free to apply for this job, using code 29ZZ9.  You’re welcome!


NF1 thoughts

I like to encourage scientists to pursue research in NF1.

NF1 is an area where there is a fair amount of GWAS work (see Wash U, Broad Institute).  NF1 arises due to mutations in the neurofibromin 1 gene.  The disease has a highly variable outcome depending on the mutation site.  Very little is known about genotype-phenotype correlation in NF1.

The NF1 gene was discovered and patented in 1993, but there hasn’t been significant progress towards a cure since then.   The current leader in NF1 research is the Children’s Tumor Foundation.  They focus on the traditional wet lab drug discovery pipeline.

Gene therapy is the most attractive solution, but the only person who has attempted work in this area is David Segal at UC Davis, whose 2014 Army-funded attempt failed. There is a correlation with NF1 gene mutations and autism.

NF1 is in the family of Rasopathies, so work in this area naturally leads into work on a much larger class of rare diseases that need attention.  Hence it is a rich and deep field, filled with scientific opportunity.

Bitcoin thoughts

I’m not interested in trading Bitcoin.  It’s too hard to time when the crash will come.  It’s important to keep in mind, it’s not Tulip bulbs.  There is a rational basis for the currency.  Unlike traditional currencies:

  1. Flows from one country to another are not tracked
  2. Sender and receiver of a flow are anonymous, unlike any bank transfer or credit card transaction
  3. Flows are not taxed
  4. Balances are not identified with any country or legal jurisdiction
  5. No central bank can expand or contract the money supply for political reasons

These are benefits for Gold bugs, tax dodgers, rebels and criminals.  All of the value resides there.  I expect the competitive response to this will be a universal currency, UN-style, using the same technology, but addressing some of the above needs in some kind of legal way.  When that happens, Bitcoin will drop to 0 except for purely criminal transactions and other transactions requiring secrecy.

불야성 White Nights and Inspector O


불야성, available on Netflix as White Nights, is a sort of corporate takeover procedural on one level, which is interesting for it’s catalog of uniquely Korean tax-dodging strategies and uniquely Korean takeover-related strong-arm tactics and stylized intimidation.  Read together with the Inspector O series of state security procedurals (which are written by an American, about North Korea), the two may bring us a little closer to an understanding of KJU and the Korean gestalt.  (Maybe that’s promising too much for a TV show and some spy novels.  But still.)

That the tactics on display over 20 episodes are aimless, confusing and baffling is not inconsistent or uninformative or inauthentic. They are what they are.  It’s handy to have them all in one place.  That they are also curiously dry and unengaging is also perhaps not inauthentic.  Who really cares what North Korea’s next provocation is on a day to day basis?  They want us to care.  We want to care.  But really, it’s hard to keep up that level of excitement all the time.  The Inspector O novels kind of speak to this as well.  They are quiet, aimless, without well-resolved conflicts or clear scenarios.  They go on.  They end.  One kind of leads into the next.  The character ages.  His nephew takes the spotlight.  One wonders how authentic they can be, written by a Westerner about a closed society.

Still, they are quite readable, and consistent with 불야성.

The other level and incentive for watching 불야성 is for the simmering w4w romance which is it’s spine.  Unlike the typical Korean drama love quadrangle, the romance in this show is carried on, completely in the closet, by the two female leads, with the closet kept well shut by a male lead who is platonically passed back and forth through the show by the two female leads.

The female chemistry has inspired some head-scratching examinations of this theme, and more than a few Youtube paeans.  Here are some of the best:



Computing the PDF of the sum of N moves of an empirical PDF for USDJPY 1-minute moves

[Cross posted.]

Per-minute tick data for USDJPY is available here. Suppose we download this file to usdjpy.txt and then save it into a Numpy array in Python 3 as follows:

import numpy as np
with open('USDJPY.txt','r') as f: data=f.readlines()
data=[x.split(',') for x in data][1:]
jpy=np.array([float(close) for (ticker,yy,time,open,high,low,close,vol) in data])

The per-minute returns in USDJPY, expressed in basis points, will be:


Define a histogram function and empirical PDF function as follows:

def histc(X,bins):
    map_to_bins = np.digitize(X,bins)
    r = np.zeros(bins.shape)
    for i in map_to_bins:
        r[i-1] += 1
    return [r,map_to_bins]

def epdf(S,numIntervals=100):
    if ncount[1]>len(S)/2:
    return (x,relativefreq)

The empirical PDF of USDJPY 1-minute pip returns is then:


which if we plot it

from bokeh.plotting import figure, show
from import output_notebook
simple=[(x[i],int(100*rf[i])) for i in range(rf.shape[0]) if int(100*rf[i]) > 0]
X=np.array([x for x,y in simple])
Y=np.array([y for x,y in simple])

Looks like this:

PDF of 1 minute move of USDJPY

Now suppose I want to know what could happen in an hour (60 one-minute moves). Following the answer to this question, I could convolve the EPDF above 60 times and I should get the right answer. I think this would look something like this:

def step_pdf(pdf1,pdf2):
    return pdf

from functools import reduce
pdf60=reduce(step_pdf,[rf for i in range(60)])

If I then plot the new pdf60 on top of the old pdf


I see (call this “Convolution PDF60”):

Convolution PDF60

The blue line is my 60-minute PDF from the above 60-fold convolution. It is smoother, which I expect, but it is still roughly in the same range as the original 1-minute PDF, which I do not expect. So now I will try a more constructive way of generating the 60-minute PDF: I will construct as many 60-minute samples randomly as I have 1-minute samples, by summing randomly selected vectors of size 60 from my original population of 1-minute moves. Then I will compute the empirical PDF of the result. I completely trust this construction, so I will use it as a benchmark against my original construction. So:

djpy60=np.array([djpy[draws[i]].sum() for i in range(n)])

Now if I plot pdf60:


I see a much wider distribution of 60-minute moves, which corresponds much more strongly to my intuition (call this “Monte Carlo PDF60”):

Monte Carlo PDF60

Question: Why aren’t my Convolution PDF60 and my Monte Carlo PDF60 in agreement?

What proves that a random process with zero diffusion is not a martingale?


Consider the process dX_t=W_t dt+0 dW_t, alternatively X_t=\int_0^t W_s ds. W_t is Brownian motion. I read a proof that X_t is a martingale that simply states “Because the diffusion of dX_t is 0, $X_t$ is not a martingale.”

By definition, a stochastic process X_t adapted to a filtration \{F_t\} is a martingale iff E(|X_t|) <\infty, t \geq 0 and E(X_t|{\cal F}_s)=X_s, 0\leq s<t

Question: What exactly about either of these conditions establishes that if a random process has 0 diffusion, it is not a martingale?

I am asking because I see the 0-diffusion condition used often for this purpose, but in the above example, of a process which is still random even though it has a zero diffusion, I don’t get it.

Write expectation of brownian motion conditional on filtration as an integral?


Let W_t be a Brownian motion, so W_t=z_t \sqrt{t} where z_t \in N(0,1) and the pdf of z is
f(z)=\frac{e^{-\frac{z^2}{2}}}{\sqrt{2\pi}}. So

E(W_t)=\int_{-\infty}^{\infty} W_t f(z) dz =\int_{-\infty}^{\infty} z \sqrt{t} \frac{e^{-\frac{z^2}{2}}}{\sqrt{2\pi}} dz =\int_{0}^{\infty} (z+(-z)) \sqrt{t} \frac{e^{-\frac{z^2}{2}}}{\sqrt{2\pi}} dz=0

Now suppose {\cal F}_t is the natural filtration for W_t. By construction of Brownian motion, we are given that E(W_t|{\cal F}_s)=W_s, 0\leq s\leq t.

Question: How do I write E(W_t|{\cal F}_s) as a Riemann integral expression similar to the Riemann integral expression of E(W_t) given above?

Note: I have done extensive Google search on this, without finding any responsive exposition. If this question is beside the point, please explain why. If it’s on point, please answer with the Riemann integral expression.