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.

Siri Apps

So now that Apple has opened up Siri to third party developers (starting with iOS 10), I hope that app makers make use of this features clearly.

There are some apps, for example, that require inputs from time to time. My wife, for example, recently downloaded an app to track our daughter’s inputs and outputs.

The problem was that each time our daughter either input or output something, my wife had to unlock her iPhone, go to this app, and then use 3/4 more clicks to enter the necessary information. The complexity was so much that within a day she (wife) had stopped using it, and presently uninstalled the app.

This kind of app that needs frequent inputs seems ideally placed to get Siri integration. Imagine saying “Hey Siri. My baby just shat”, and the app gets immediately updated, and stuff. Given how powerful Siri already is, I don’t see any technical challenge in implementing this. The challenge, though, is on the product front, for apps to be able to use this judiciously.

PS: I just updated my laptop to MacOS Sierra, and so now have Siri on my Mac as well. only problem is that Siri on phone is so much more responsive than Siri on Mac. So when I want to call the Mac Siri, the phone Siri responds first, annoying me!

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.

Andhra Meals in Religious Rituals

A long time back I’d compared massage parlours in Bangkok to Andhra meals, where there is a “basic menu” (the core massage itself) which everyone orders, on top of which other add-ons (such as happy endings) can get tagged on.

Today, while performing a religious ritual (it’s 10 days since my daughter was born, so there was some ceremony I’d to perform), I realised that every religious ritual, happy or sad, also follows the “Andhra meals” principle.

So the “meals” part is the stuff they teach you to do as part of your daily “sandhyavandane” ritual immediately after your thread ceremony. Starting with the aachamana (keshavaaya swaaha, narayanaaya swaaha etc), going on to reciting the Gayatri mantra, repeating the aachamana several times in the middle, and then ending by apologising and atoning for all the mistakes in the course of the ritual (achutaayanamaha, anantaayanamaha, govindayanamaha, achutanantagovindebho namaha).

This is the basic sandhyaavandane you’re supposed to perform three times every day, and the interesting thing is that most other rituals are add-ons to this. Be it a wedding ceremony, worship of a particular god on a particular festival or even a death ceremony, all these parts remain and don’t go away. What changes from ritual to ritual are the add-ons, like the meats you might order during Andhra meals.

And so in the wedding ceremony, there is the wedding itself. In a death ceremony, there’s all the part where you wear the sacred thread the wrong way round (praacheenaavEti) and build rice-til balls (piNDa – have you noticed how similar they are to sushi?). While worshipping a particular god, you perform the worship in the middle of the regular sandhyaavandane ritual. And so forth.

I must say I’m fairly impressed with our ancestors who devised this “modular form” of performing rituals. What rocks about this practice is that pretty much everyone who wants to perform these rituals will know these rituals (the “basic Andhra meals”) bit, which makes it that much easier to “consume” the “extra fittings” appropriate to the occasion.

Distance between Indian fathers and kids

As a rule, Indian fathers are not terribly close to their kids (my father was a major exception to this rule), and I lay the blame on a “traditional practice” in Indian families.

This is the concept of “baaNantana” (don’t know words in other Indian languages) where the woman goes to her parents’ house for childbirth, and stays there till the child is a few months old, before returning to her own house. And this contributes to several reasons which contribute to distance between fathers and children.

For starters, the woman’s house and her parents’ house may not be in the same city or region, putting a physical distance between the father and the baby. Thus, for the first few months of the baby, there is little contact between them, and when the baby finally goes to live with its father, he is already a distant figure. And unless the father makes special efforts to bond with his child, this distance is only bound to grow.

Secondly, in India, childbirth and associated activities are generally seen as a primarily female pursuit. It is the mother’s parents (primarily mother’s mother) who accompany her to the hospital, and be there with her until childbirth. The father generally only makes a guest appearance where he appears, carries the baby for a bit, hands it back and disappears.

And then every subsequent activity of the mother is directed by her own female relatives, and the father has little to do in the process. Even if he is physically proximate to the baby (by virtue of living not too far from his in-laws), the “culture” of baby-related activities being female pursuits means that he is not a primary actor any more, and he generally prefers to hand over the baby to a “female elder” when it cries, rather than to learn to pacify it himself.

Given this background, I’m really impressed with the efforts of CloudNine, the hospital where my daughter was born, in involving the father in the delivery process and beyond. For starters, the hospital insists that the father be present at the time of delivery, and cut the baby’s cord. While this was always known, what I was pleasantly surprised was the process afterwards.

A couple of hours after my wife and daughter came to their room, a nurse materialised, offering to teach her how to breastfeed. I readied myself to be sent out for the process, but there was no such attempt. In fact, the nurse seemed encouraging of me watching on – the hospital has perhaps realised (maybe belatedly in the Indian context) that the wife’s boobs are unlikely to be a novelty to a man, and so there is absolutely no reason to send him out!

On the other hand, the joy in watching your child feed directly from your wife is totally unmitigated!

Then later in the evening on Thursday, another nurse materialised, to take my wife for bath. That time, both my motherinlaw and I were there in the room with her. The nurse presently put my motherinlaw in charge of looking after the baby, and asked me to accompany her to help give my wife a bath. When my motherinlaw gestured that she could help out with the bath, the nurse firmly said that she wants me to come.

Apart from the hospital’s efforts I’ve been doing my own efforts to make sure I bond with the baby. Rather than sending off my wife to her parents’ place for baaNantana, I’ve instead convinced them to come live with us for a month, to help us deal with the new baby. I’ve learnt to carry the baby in different ways and change diapers, and I’m trying to learn to calm the baby when she cries (lack of boobs is a big impediment in this process).

And I’ve found that the more involved I am with the baby, the more responsible I feel in taking care of her and looking after her. The more I’m sent to “do my thing” while others take care of the baby, the more I feel like handing her off to someone else when she cries, rather than pacifying her myself!

Thinking back, perhaps one reason my father was able to bond with me was that he lived fairly close to my maternal grandfather’s place when I was born, and even though my mother was away on “baaNantana”, he made sure to come see us for a few hours every day, and carry me. Hopefully I can propagate this process with my daughter!

Pregnancy, childbirth, correlation, causation and small samples

When you’re pregnant, or just given birth, people think it’s pertinent to give you unsolicited advice. Most of this advice is couches in the garb ob “traditional wisdom” and as you might expect, the older the advisor the higher the likelihood of them proffering such advice. 

The interesting thing about this advice is the use of fear. “If you don’t do this you’ll forever remain fat”, some will say. Others will forbid you from eating some thing else because it can “chill the body”. 

If you politely listen to such advice the advice will stop. But if you make a counter argument, these “elders” (for the lack of a better word) make what I call the long-term argument. “Now you might think this might all be fine, but don’t tell me I didn’t advice you when you get osteoporosis at the age of 50”, they say. 

While most of this advice is well intentioned, the problem with most such advice is that it’s based on evidence from fairly small samples, and are prone to the error of mistaking correlation for causation. 

 While it is true that it was fairly common to have dozens of children even two generations ago in india, the problem is that most of the advisors would have seen only a small number of babies based on which they form their theories – even with a dozen it’s not large enough to confirm the theory to any decent level of statistical significance. 

The other problem is that we haven’t had the culture of scientific temperament and reasoning for long enough in india for people to trust scientific methods and results – people a generation or two older are highly likely to dismiss results that don’t confirm their priors. 

And add to this confirmation bias – where cases of people violating “traditional wisdom” and then having some kind of problem are more likely to be noticed rather than those that had issues despite following “traditional wisdom” and you can imagine the level of non-science that can creep into so-called conventional wisdom. 
We’re at a hospital that explicitly tries to reverse these pre existing biases (I’m told that at a lactation class yesterday they firmly reinforced why traditional ways of holding babies while breastfeeding are incorrect) and that, in the face of “elders”‘ advice, can lead to potential conflict. 

On the one hand we have scientific evidence given by people who you aren’t likely to encounter too many more times in life. On the other you have unscientific “traditional” wisdom that comes with all kinds of logical inconsistencies given by people you encounter on a daily basis. 

Given this (im)balance, is there a surprise at all that scientific evidence gets abandoned in favour of adoption and propagation of all the logical inconsistencies? 

PS: recently I was cleaning out some old shelves and found a copy of this book called “science, non science and the paranormal”. The book belonged to my father, and it makes me realise now that he was a so-called “rationalist”. 

At every opportunity he would encourage me to question things, and not take them at face value. And ever so often he’d say “you are a science student. So how can you accept this without questioning”. This would annoy some of my other relatives to no end (since they would end up having to answer lots of questions by me) but this might also explain why I’m less trusting of “traditional wisdom” than others of my generation. 

Half life of pain

Last evening, the obstetrician came over to check on the wife, following the afternoon’s Caesarean section operation. Upon being asked how she was, the wife replied that she’s feeling good, except that she was still in a lot of pain. “In how many days can I expect this pain to subside?”, she asked.

The doctor replied that it was a really hard question to answer, since there was no definite time frame. “All I can tell you is that the pain will go down gradually, so it’s hard to say whether it lasts 5 days or 10 days. Think of this – if you hurt your foot and there’s a blood clot, isn’t the recovery gradual? It’s the same in this case”.

While she was saying this, I was reminded of exponential decay, and started wondering whether post-operative pain (irrespective of the kind of surgery) follows exponential decay, decreasing by a certain percentage each day; and when someone says pain “disappears” after a certain number of days, it means that pain goes below a particular  threshold in that time period – and this particular threshold can vary from person to person.

So in that sense, rather than simply telling my wife that the pain will “decrease gradually”, the obstetrician could have been more helpful by saying “the pain will decrease gradually, and will reduce to half in about N days”, and then based on the value of N, my wife could determine, based on her threshold, when her pain would “go”.

Nevertheless, the doctor’s logic (that pain never “disappears discretely”) had me impressed, and I’ve mentioned before on this blog about how I get really impressed with doctors who are logically aware.

Oh, and I must mention that the same obstetrician who operated on my wife yesterday impressed me with her logical reasoning a week ago. My then unborn daughter wasn’t moving too well that day, because of which we were in hospital. My wife was given steroidal injections, and the baby started moving an hour later.

So when we mentioned to the obstetrician that “after you gave the steroids the baby started moving”, she curtly replied “the baby moving has nothing to do with the steroidal injections. The baby moves because the baby moves. It is just a coincidence that it happened after I gave the steroids”.

Acknowledgements

As I continue my progress towards publishing the book whose manuscript I’ve completed, I’ve started to think about the acknowledgements section, which I’m yet to write. Each time I read a new book now, I make sure I read the acknowledgements, and see who all people have thanked. I’ve not gone to the extent of formally collecting data from these acknowledgements, but I must say the effort is underway.

Based on a recent discovery, though, I think all this research is moot. Recently I was cleaning up an old cupboard (the kind that comes embedded in a cot) in my grandfather’s house, and happened to stumble upon my B.Tech. project. I’d brought it home and kept it aside, and happened to open it today.

Overall, in hindsight, I seem to have done a better job of my project than I’d imagined. I’ve always remembered that rather than solving the problem I’d taken up, I’d constructed a proof to show why it couldn’t be solved (something my mother always made fun of). But reading the report, it appears that I’ve gone beyond that, and constructed some approximate and randomised heuristics to tackle the problem – so I’m happy about that.

The more interesting bit is the acknowledgements section. It pretty much encapsulates my life at IITM. Again, I remember having done some research looking at other people’s acknowledgements to see who all they’d thanked, and I followed the same process – guides, professors, lab mates, etc. And then I’ve mentioned some friends.

The first part of the acknowledgements section is not particularly insightful so I’m not pasting it here. The second part makes for fun reading though, in hindsight. I like the way I’ve been fairly informal (in such a “formal” document as my B.Tech. project report), with puns and all.

screen-shot-2016-09-10-at-9-04-04-pm

The key thing to note is the last paragraph. I seriously mean it (even now) when I say that the best part of my life at IITM was the time spent at Patisserie, and all the discussions I had there. The discussions were diverse, with lots of different people, and we spoke about different things on different days.

It may not be a stretch to claim that I learnt more during my discussions there than during the time spent in classrooms. And if I today considered well-networked in my batch (and surrounding batches) at IITM, it’s again due to the time I spent there.

Now to think about how to adapt this acknowledgements section to something that makes sense for the manuscript I’ve written!

Wedding videos and optimising reception queue lengths

In the past I’ve dissed wedding videos, claiming that they don’t add any value (as no one ever watches them) and only serve to slow down the queues during receptions. While I maintain that the way they are currently shot still hold up reception queues, I’ve revised my opinion about their general usefulness.

So my in-laws are preparing for the wedding of their second daughter (my sister-in-law), and in order to “revise” what needs to be done, my wife suggested we watch our wedding video. So since last night we’ve been watching our wedding videos, and I must say it’s been quite useful.

For not only are wedding videos inherently entertaining, they also capture nuances of the wedding that still photographs cannot capture. It was pertinent, for example, to observe the order in which my relatives were garlanded as we were being welcomed into the wedding ceremony.

We also got to observe how bad the crowd was immediately after the wedding when people rushed to wish us and hand over their gifts (bad but not that bad). And rather embarrassingly for me, the video showed my failed attempt at cutting the ceremonial ribbon to enter the wedding hall (I have astigmatism which my contact lenses don’t correct, which affects my perception of depth). The video also allowed me to note that the scissor to cut the ribbon was handed to me by a bureaucrat aunt, someone who I guess is well used to handing over scissors in that fashion!

Having watched the reception part of the video, though, I continue to maintain that video recordings hold up the reception procedure, and result in inordinately long queues. Moreover, the way videos are currently shot cause severe embarrassment and discomfort for the guests.

For those that are unfamiliar with south indian wedding receptions, this is what happens – you join a (typically long and wide) queue, and when you get to the head of the queue, walk on stage to greet the couple and hand over your gift. Then you all line up for the photo. So far so good.

Then you hear the click of the photographer’s shutter, and start moving, and the videographer instructs you to stay. For he is taking a “panning shot” across the width of the stage. Some 30 seconds later, the videographer instructs you to move, and the bride and groom ask you to have dinner and show you the way off stage.

The embarrassing bit for the guests, in my opinion, is that having struck a photogenic pose for the photo, they are forced to hold this pose for the duration that the videographer pans. Considering that photogenic poses are seldom comfortable, this is an unpleasant process. Moreover, guests aren’t aware when exactly the videographer is covering them, so there’s a chance they might be caught on camera making awkward body movements (possibly due to the discomfort).

Thus, I propose that rather than having the video camera straight on (next to the principal photographer) and getting a panning shot taken, the videographer should position himself on one side of the stage (the opposite side from which the guests are entering), and take a profile view of the guests wishing the bride.

This way, they capture on camera guests in more natural gestures, and the “best” front view would have anyway been captured by the still photographer. The guests can then be asked to move on as soon as the photographer’s shutter clicks (a more natural exit moment), and the time spent by each group of guests on stage could come down by more than 50% (thanks to panning time saved). And this can result in a drastic reduction in expected waiting time for a guest!

While I’d like to implement this procedure at my sister-in-law’s wedding (so what if I thoroughly failed to keep the queue length under control at my own wedding? At least I should use my learnings elsewhere!), the problem would be in finding videographers who are willing to reposition themselves.

In some sense, the videographer standing straight on, and guests waiting for a long time is a kind of a Nash equilibrium, and videographers won’t move to side on unless there’s sufficient demand from hosts to cut queue lengths at their weddings! And since moving videographers to side on is not an intuitive solution, the demand for this move from hosts will also be small.

So I guess unless we can find a videographer who is willing to experiment (not too easy), we will be stuck with front-on videos, uncomfortable guests in front of the camera, and impatient guests in the line!

Indexing, Communism, Capitalism and Equilibrium

Leading global research and brokerage firm Sanford Bernstein, in a recent analyst report, described Index Funds (which celebrated their 40th birthday yesterday) as being “worse than Marxism“. This comes on the back of some recent research which have accused index funds of fostering “anticompetitive practices“.

According to an article that says that indexing is “capitalism at its best“, Sanford Bernstein’s contention is that indexers “free ride” on the investment and asset allocation decisions made by active investors who spend considerable time, money and effort in analysing the companies in order to pick the best stocks.

Sanford Bernstein, in their report, raise the spectre of all investors abandoning active stock picking and moving towards index funds. In this world, they argue, allocations to different assets will not change (since all funds will converge on a particular allocation), and there will be nobody to perform the function of actually allocating capital to companies that deserve them. This situation, they claim, is “worse than Marxism”.

The point, however, is that as long as there is no regulation that requires everyone to move to index funds, this kind of an equilibrium can never be reached. The simple fact of the matter is that as more and more people move to indexing, the value that can be gained from fairly basic analysis and stock picking will increase. So there will always be a non-negative flow (even if it’s a trickle) in the opposite direction.

In that sense, there is an optimal “mixed strategy” that the universe of investors can play between indexing and active management (depending upon each person’s beliefs and risk preferences). As more and more investors move to indexing, the returns from active management improve, and this “negative feedback” keeps the market in equilibrium!

 

So in that sense, it doesn’t matter if indexing is capitalist or communist or whateverist. The negative feedback and varying investor preferences means that there will always be takers for both indexing and active management. Whether we are already at equilibrium is another question!