Damming the Nile and diapers

One of the greatest engineering problems in the last century was to determine the patterns in the flow of the Nile. It had been clear for at least a couple of millennia that the flow of the river was not regular, and the annual flow did not follow something like a normal distribution.

The matter gained importance in the late 1800s when the British colonial government decided to dam the Nile. Understanding accurately the pattern of flows of the river was important to determine the capacity of the reservoir being built, so that both floods and droughts could be contained.

The problem was solved by Harold Edwin Hurst, a British hydrologist who was posted in Egypt for over 60 years in the 20th Century. Hurst defined his model as one of “long-range dependence”, and managed to accurately predict the variation in the flow of the river. In recognition of his services, Egyptians gave him the moniker “Abu Nil” (father of the Nile). Later on, Benoit Mandelbrot named a quantity that determines the long-range dependence of a time series after Hurst.

I’ve written about Hurst once before, in the context of financial markets, but I invoke him here with respect to a problem closer to me – the pattern of my daughter’s poop.

It is rather well known that poop, even among babies, is not a continuous process. If someone were to poop 100ml of poop a day (easier to use volume rather than weight in the context of babies), it doesn’t mean they poop 4ml every hour. Poop happens in discrete bursts, and the number of such bursts per day depends upon age, decreasing over time into adulthood.

One might think that a reasonable way to model poop is to assume that the amount of poop in each burst follows a normal distribution, and each burst is independent of the ones around it. However, based on a little over two months’ experience of changing my daughter’s diapers, I declare this kind of a model to be wholly inaccurate.

For, what I’ve determined is that far from being normal, pooping patterns follow long-range dependence. There are long time periods (spanning a few diaper changes) when there is no, or very little, poop. Then there are times when it flows at such a high rate that we need to change diapers at a far higher frequency than normal. And such periods are usually followed by other high-poop periods. And so on.

In other words, the amount of poop has positive serial correlation. And to use the index that Mandelbrot lovingly constructed and named in honour of Hurst, the Hurst exponent of my daughter’s (and other babies’) poop is much higher than 0.5.

This makes me wonder if diaper manufacturers have taken this long-range dependence into account while determining diaper capacity. Or I wonder if, instead, they simply assume that parents will take care of this by adjusting the inter-diaper-change time period.

As Mandelbrot describes towards the end of his excellent Misbehaviour of markets , you can  use so-called “multifractal models” which combine normal price increments with irregular time increments to get an accurate (fractal) representation of the movement of stock prices.

PS: Apologies to those who got disgusted by the post. Until a massive burst a few minutes ago I’d never imagined I’d be comparing the flows of poop and the Nile!

Working women, maternity and all that

As I write this, my wife is at work. Though her official gainful fulltime employment starts only a few months later (her employers have deferred her joining date thanks to the baby), she is continuing with her work as Marriage Broker Auntie (which she is now pivoting into something like a “Love Training School“).

In fact, our daughter was barely a week old when my wife decided to get back to business, in her quest to get more people “settled down” and “find partners” (she even brokered a deal from her hospital bed as they tried to induce labour in her). And so I’ve been able to observe, at reasonably close quarters, what it’s like to work while having a tiny baby.

Some times, you think it just doesn’t matter. That she works mainly from home means that she’s always with the baby. There are always sufficiently long periods of time when the baby sleeps when she can do her emails and writing. While sleep is definitely disturbed (by at least two hour-long feeding sessions each night), that she doesn’t engage in other strenuous work means she can handle the work stress.

But then there are the minor irritants. Meetings are a no-no, for example, since she can’t go out, and it doesn’t always make sense to call business acquaintances home. She’s been trying to substitute it with Skype/Facetime calls, but the challenge has been in terms of timing.

Given that some of the people she works with are fairly busy, she needs to pre-schedule calls, and with the baby’s feeding and sleeping schedule being rather uncertain, this is not an easy task. And then there is the problem of having someone take care of the baby during the call, which means the call has to take place at a time when I’m at home.

And so she is on a Skype call now. As she went in for the call, she asked me to handle the baby until it was done, promising that it would be a short call. As it usually happens in such situations, Abheri decided to start crying some two minutes after Priyanka went in for the call.

I tried all my usual tricks. I lay her down on my chest, a technique that usually comforts her in no time, but to no avail (I’ve read about the merits of skin-to-skin contact with the baby but given up on it after she decided to eat my chest hair). I then tried this face-down neck-hold (that I’ve nicknamed “choke slam”), which again usually works in calming her. Again no luck.

Then I smelt shit and thought she was crying because she needed a change of diapers. That didn’t help either. Rocking and singing and swaying and talking – all usually have an immediate effect but none whatsoever today. It was obvious that Abheri was hungry.

So I had to call emergency. Thankfully Priyanka’s Skype call is voice only (or maybe she switched, since she typically prefers video), so she managed to take a little break from the call to take Abheri from my hands. She (Abheri) immediately calmed down – food wasn’t far away.

Priyanka is still on her call, cradling Abheri with one hand against her breast, as Abheri feeds. And Priyanka continues to work.

Major level up in respect for her to see her work this way.

And major envy as well – that she can hold the baby and simultaneously work – nearly four weeks in and I’ve still not mastered the art of holding the baby with one hand, so I can’t work while carrying her!

PS: As for the new law that increases maternity leave, I’m sceptical, since I believe that full-time employment is something that will soon be history. More importantly, the law raises the cost of hiring women, so I’m not sure it will have its intended consequences. Read Priyanka’s excellent analysis here.

Bayesian recognition in baby similarity

When people come to see small babies, it’s almost like they’re obliged to offer their opinions on who the child looks like. Most of the time it’s an immediate ancestor – either a parent or grandparent. Sometimes it could be a cousin or aunt or uncle as well. Thankfully it’s uncommon to compare babies’ looks to those who they don’t share genes with.

So as people have come up and offered their opinions on who our daughter looks like (I’m top seed, I must mention), I’ve been trying to analyse how they come up with their predictions. And as I observe the connections between people making the observations, and who they mention, I realise that this too follows some kind of Bayesian Recognition.

Basically different people who come to see the baby have different amounts of information on how each of the baby’s ancestors looked like. A recent friend of mine, for example, will only know how my wife and I look. An older friend might have some idea of how my parents looked. A relative might have a better judgment of how one of my parents looked than how I looked.

So based on their experiences in recognising different people in and around the baby’s immediate ancestry, they effectively start with a prior distribution of who the baby looks like. And then when they see the baby, they update their priors, and then mention the person with the highest posterior probability of matching the baby’s face and features.

Given that posterior probability is a function of prior probability, there is no surprise that different people will disagree on who the baby looks like. After all, each of their private knowledge of the baby’s ancestry’s idiosyncratic faces, and thus their priors, will be different!

Unrelated, but staying on Bayesian reasoning, I recently read this fairly stud piece in Aeon on why stereotyping is not necessarily a bad thing. The article argues that in the absence of further information, stereotypes help us form a good first prior, and that stereotypes only become a problem if we fail to update our priors with any additional information we get.

The one bit machine

My daughter is two weeks old today and she continues to be a “one bit machine”. The extent of her outward communication is restricted to a maximum of one bit of information. There are basically two states her outward communication can fall under – “cry” and “not cry”, and given that the two are not equally probable, the amount of information she gives out is strictly less than one bit.

I had planned to write this post two weeks back, the day she was born, and wanted to speculate how long it would take for her to expand her repertoire of communication and provide us with more information on what she wants. Two weeks in, I hereby report that the complexity of communication hasn’t improved.

Soon (I don’t know how soon) I expect her to start providing us more information – maybe there will be one kind of cry when she’s hungry, and another when she wants her diaper changed. Maybe she’ll start displaying other methods of outward communication – using her facial muscles, for example (right now, while she contorts her face in a zillion ways, there is absolutely no information conveyed), and we can figure out with greater certainty what she wants to convey.

I’m thinking about drawing a graph with age of the person on the X axis, and the complexity of outward information on the Y axis. It starts off with X = 0 and Y = 1 (I haven’t bothered measuring the frequency of cry/no-cry responses so let’s assume it’s equiprobable and she conveys one bit). It goes on to X = 14 days and Y = 1 (today’s state). And then increases with time (I’m hoping).

While I’m sure research exists some place on the information content per syllable in adult communication, I hope to draw this graph sometime based on personal observation of my specimen (though that would limit it to one data point).

Right now, though, I speculate what kind of shape this graph might take. Considering it has so far failed to take off at all, I hope that it’ll be either an exponential (short-term good but long-term I don’t know ) or a sigmoid (more likely I’d think).

Let’s wait and see.