Data, Science & More

AI lost de administratiedruk in de zorg niet op

Van het Regeerprogramma en de Miljoenennota van het huidige kabinet kun je vinden wat je wilt. Dat doe ik dan ook. Bezuinigingen op zorg, onderwijs, cultuur en wetenschap zijn maatregelen waar ik me meestal niet achter schaar. Over één onderwerp verwacht je dat ik, als onderzoeker in de data science en AI in de populatiegerichte zorg, wel positief zou zijn: meer geld voor AI in de zorg, zodat de administratieve last met de helft zou kunnen afnemen. Maar helaas, mevrouw Agema, het tegendeel is waar. Ik geloof er niet in, en zeker niet op de korte termijn.

De administratieve last in de zorg zal niet door AI worden opgelost, en zeker niet op de korte termijn.

De techniek is niet het probleem. We zijn inderdaad in staat om een stuk software met de arts en patiënt mee te laten luisteren, of wellicht zelfs bij een behandeling mee te laten kijken, en deze te vertalen naar electronische patiëntendossiers of andere vormen van verslaglegging. Op dit moment zorgt dit nog voor administartieve druk. Zelf ben ik ook actief betrokken naar onderzoek om deze technieken verder te verbeteren, al zijn ze naar mijn mening ook al goed genoeg en klaar voor gebruik in de praktijk. Dat gebeurt ook: in een flink aantal Nederlandse ziekenhuizen en andere zorginstellingen worden AI modellen gebruikt zoals hierboven beschreven.

Het kúnnen is dus niet waar de schoen wringt. Vertrouwen in de systemen die hiervoor moeten worden opgetuigd en de benodigde (IT) organisatie áchter die systemen zijn echter wel het probleem. Foutjes zijn snel gemaakt, maar het blijkt in de praktijk dat het veel makkelijker te behapstukken is wanneer foutjes in medische dossiers of behandelplannen zijn geïntroduceerd door menselijk handelen, dan wanneer deze foutjes door toedoen van een computer of robot binnensluipen. We zijn voor mensen vergevingsgezind, voor een AI niet. Gevolg daarvan is dat controle van het door AI gegenereerde verslag een belangrijke nadruk zal krijgen, en dat eventuele missers die er toch doorheen sluipen een veel grotere nasleep zullen krijgen dan de menselijke foutjes die nu optreden. En wat als een AI een diagnose stelt of conlusie trekt die de zorgverlener niet kan duiden, hoe gaat een professional daar dan mee om? In hoeverre moeten professionals dit klakkeloos overnemen, en in hoeverre moeten zij besluiten dit “menings-” of “interpretatieverschil” uit te zoeken? Ineens kost de AI een berg extra tijd.

Ook wet- en regelgeving zijn nu nog niet klaar voor het laten overnemen van administratie door een AI. Als verkeerde verslaglegging resulteert in handelingen die niet goed uitpakken (verkeerde diagnoses, verwijzingen, voorschriften, behandelingen etc.), waar ligt dan de verantwoordelijkheid? Zolang deze bij de mens ligt die anders de verslaglegging had gedaan, is de tijdwinst door een AI vele male lager dan je op eerste gezicht zou denken. Daar komen nog de gevaarlijke missers bovenop die we onlangs hebben langs zien komen: roep de hulp van een AI in voor sommige van je praktische taken, en voor je het weet ligt zeer gevoelige persoonsinformatie op een stoep in Silicon Valley.

Administratieve last zal zich verplaatsen van typen, naar controle en naar het oplossen van mismatches tussen mens en technologie.

Tenslotte is er nog het aspect van het ontwikkelen en onderhouden van software. Software moet een behoorlijk vertrouwen krijgen van maatschappij, arts én patiënt, zodat we deze zonder al te veel handmatige controle en risico op foutjes kunnen inzetten. Dit vergt een (zorgvuldig en gecontroleerd!) ontwikkelproces. Ontwikkeling is duur. Daarna moet de software worden ingezet, en dus onderhouden op een zeer breed verspreid netwerk van computers bij zorgveleners in het ziekenhuis, maar ook in de huisartsenpraktijk en alle andere zorgveleners in de eerste, tweede en derde lijn. Als het dan al in staat blijkt administratieve last weg te nemen bij de zorgprofessional (wat een mooie winst zou zijn), dan nog besparen we niks: het geld verplaatst dan naar de ontwikkeling en het onderhoud van software. Ik denk dat we in de afgelopen jaren genoeg voorbeelden hebben gezien van hoe duur dat uiteindelijk blijkt. Ook een financiële verlichting van de zorg lijkt me op korte termijn niet realistisch.

Kosten zullen verplaatsen van salaris van zorgprofessionals, naar salaris van IT-personeel en naar de rekening van software-ontwikkelende bedrijven met een winstoogmerk.

Wat veel meer zou helpen in de verlaging van de druk, waaronder de administratieve druk, is een verandering van cultuur in de zorgmarkt. Een cultuur met meer vertrouwen in elkaars professionaliteit, een cultuur waarin buiten traditionele zorgsilo’s effectief wordt samengewerkt en een cultuur waarin incentives niet voornamelijk worden bepaald door budgetten, maar door een gemeenschappelijk streven naar verbeterde gezondheid en kleinere gezondheidsverschillen.

In de tussentijd vind ik het zeer verstandig om door te gaan met innovatief werk, om te onderzoeken of en hoe moderne technologie ingezet kan worden als assistent van de zorgprofessional. Het is echter véél te vroeg om nú al effecten hiervan te verwachten die de zorgmarkt verlichten.

Addressing Early Career Astronomers

Every once in a while, I join events aimed at Early Career Researchers to talk about possible career paths, some personal experience in job hopping and to hopefully give some useful advice for ECRs when they’re on cross-roads in their professional life path. I like these events and find them to be very helpful for bouncing thoughts and raising awareness for aspects of career decisions that are not always on top of mind. For sure, there were things that I would have hoped to realize earlier in life. If you’re in need of somebody to exchange thoughts on such matters, feel free to contact me on LinkedIn or by email.

It’s important to have a bunch of people at such events, who all bring their own perspectives, experiences and personalities. A good choice for your own career depends on countless factors, and there really is no golden recipe for a successful, happy progression of your professional life. That said, there are some general things you might want to consider, and I wish events like the ones I sometimes attend would have been present 15 years ago, to teach my past me.

The event I attended yesterday was extra special. The yearly Dutch Astronomers Conference (also known under its Dutch name of Nederlandse Astronomen Conferentie, NAC) had an ECR event. For me, it was 14 years ago that I attended my last NAC. I had great memories of the meetings, packed with interesting science, but also a lot of fun social events in a great community. It was incredibly fun to meet old friends again. Obviously, I knew basically nobody of the younger generation, but I was surprised to see how many people I did still recognize. It felt like a reunion, or even like coming home after a long absence.

It was extra amazing that my master’s thesis advisor, and the astronomer who has been my great example ever since studying in Utrecht, was at the meeting, and attended my talk, too. As a scientist, teacher, mentor and astronomy popularizer, I do not know of a better example. Henny, thank you for catching up, and for being there yesterday and those numerous times before. It means the world to me. And indeed: if anybody would have inspired me to stay in astronomy, it would have been you.

The numerous valuable encounters made yesterday great. I hope that I added some value to the younger audience, who are facing some tough yet important decision on how to shape their future lives. In case it might useful to anybody, here are my slides for the event:

Vanna, thanks for organizing these valuable events and keep up the good work with the NOVA-SKIES mentoring program! Stefania, thanks for the laughs and the ride home! Congrats and thanks for the fun, Steven. Lex: my memories (of 23 years ago!!) are fantastic too. They shaped my early astronomy life and they will last a lifetime, I’m sure. Scott, we need to keep the picture tradition alive, so in decades we can study some evolutionary patterns! Ilse, three events in a timeframe of just a couple of hours is impressive; good luck in your new role! And also to all the others I caught up with yesterday: thanks, I had a blast.

Englishman in New York

It has almost been half a year now. My gig as an assistant professor of data science in population health is taking shape. So far: little teaching, lots of learning, and finding my place in a foreign land. Time for some reflection and some projection.

The Health Campus The Hague is an annex of the Leiden Univeristy Medical Center, where interdisciplinary research is done in the areas of population health management, syndemics, preventive healthcare and lifestyle. People with backgrounds in medicine, behavioral science, epidemiology, nutrition, mental health, data science and much more work together with partners from all over the geographical area of The Hague to lessen differences in health between people. There is no undergraduate education, but there is our Population Health Management MSc program of 2 years. It is a lively environment with a very diverse research agenda and lots of interaction. It’s a lot of fun to work there!

The research agenda is diverse. My research agenda is still fairly non-existent, though, and my only academic experience (astrophysics and learning analytics) is a little bit too far away from population health to be dubbed “relevant”. In essence, that’s not an issue. My direct colleagues and superiors are fine with me taking time to shape my own research agenda, and in the mean time I can flow along with other research projects going on around me. Help with data related skills is often wanted, so I don’t think I will get bored.

I started on a one-year temporary contract that, in case of sufficiency, will become a permanent contract after one year. I in fact already have gotten confirmation that the permanent extension has been approved, so that’s nice. In essence, this is very different from your standard tenure-track career of assistant professors. In the Netherlands it seems that nowadays a permanent contract (“tenure”) became easier, but that is completely unrelated to promotion to associate professorship. Fair enough, a permanent contract is great!

With my research agenda still in the making I also have, contrary to most people in an assistant professor role, no existing research agenda, no publication list, no network of collaborators and no grants to do anything with other people than myself, on my ideas. I can not hire my own graduate students or postdocs, have no travel funds and in fact not even funds for paper charges and those kind of silly things. This is interesting, as I can only shape my own line of research by myself (perhaps with MSc thesis students), as long as it doesn’t cost a thing.

But Marcel, you can just get your own grants? Well, in principle, yes. But. Let’s have a look at most funding agency schemes. First of all, many large grant schemes (here) have a maximum amount of time that you have after obtaining your PhD to get it. That is ages ago for me, of which I spend a decade doing non-academia, so all of those are off-limits. The ones that are available longer after your PhD are, if they can provide enough funds for hiring people, structured such that they basically only fit people who continue their own line of research. I need to build a consortium (typically about 30 people with expertise in the field or in adjacent fields relevant to the proposal), I need to list my N most relevant publications (of which I have zero) and I need to somehow convince them that I can do with the money what I promise to do (which, without any proof, will be extremely difficult).

Therefore, I must conclude that getting my own funds will be hard to impossible. Bummer. Surfing on the waves of others is what it is for me, money-wise. That also means that the work of “my” graduate students will be work in lines of research of others, again not building my own. It seems a bit of a mystery how this line of research is supposed to get shape, as not only do I need to do so alone, but a good part of my time will be spent, necessarily, on the research agendas of others!

And what to think of promotion to associate, let alone full, professorship at some point. Criteria like publication list length, h-index (what if I just publish papers in completely unrelated fields and build an h-index that way, does that count…?) and amount of acquired funding are not quite likely to put me in a reasonable position for any committee judging on my progression.

The Netherlands is trying to push the “Rewards and Recognition” agenda in which other skills/measures than the traditional academic ones (like mentioned) are evaluated to value academic personnel. To me, funding agencies and universities still have a very long way to go before this is properly implemented in all aspects of academic life. I have applied for positions in working groups and committees to work on this, but so far without results. “Diversity” is on their agendas, but it is mostly ethnicity, gender or orientation based, not career based. I’d love to change that, and will keep trying to move myself into position for that!

What determines what I teach?

I very recently quit a teaching program that I have been part of for more than four years, to which I had a personal connection after all those years. Besides it being lucrative, it was also a program that was for a good part shaped by me and colleagues and which was fun and fulfilling to teach. Why quit, you might ask.

The program, consisting of modules for data scientists, analytics translators and managers/executives, was a collaboration between a consulting company, Ortec, and the Amsterdam Business School, a department of the University of Amsterdam that organizes a lot of executive education. The data scientist program was ruthlessly killed about a year ago, because of fierce competition from online platforms. Face-to-face education is more effective and in my opinion worthwhile, but if you can’t offer the right program for the right price, then it isn’t weird to decide not to. That so many people think you can learn such skills through watching a few videos and typing in two lines of code in a automatically checking code interpreter continues to amaze me and I bet we will see the devastating effects of this, now still junior, generation of Youtube data scientists in due time. But I digress.

The module for analytics translators is still alive and just these past few months I have still been teaching it. Fulfilling as always, I spent two half days in lecture rooms in hotels with a group of enthusiastic participants. The program this time was already rather different from what it had been before, and with the feedback of the current cohort, leadership decided to do another round of modifications.

Do not misunderstand me: continuously updating your educational offerings is what a good teacher does. Incorporating feedback from participants (or students) is crucial, as only they can properly judge whether your efforts help them reach their learning goals. One quote of the program director in the process made me scratch my head though:

I am just trying to design a program that I can sell.

Sure, selling your program is important, as otherwise there is no program. I get that. And for consulting companies (this program director is not with the consulting party in the collaboration) this may be the most or even only viable way of running business. I think, though, that people come to trusted educational institutions like universities for a different reason. A university does not design a curriculum for sales. It sets learning goals (which may well be (job-) market informed!) and then designs an educational pathway to best reach those goals. What people need to learn is determined by where they want to end up, not by what is a sexy set of courses that happens to be easily marketed.

Teachers are teaching what they teach for two reasons. Firstly, they want to convey knowledge and skills that they have to students who want to learn. They think about the right educational means to help the students gain the knowledge and master the skills. Secondly, they are specialists in the field in which they teach, which means that they understand like no other what is necessary to learn, before one can become a specialist in that field, too. Few astronomers truly enjoy the first-year linear algebra they need to master and rarely do psychologist enjoy their statistics classes in undergrad, but these happen to be crucial ingredients to grow into the field that you want to be part of.

Besides the communication between the various people in this program detoriating to levels that I didn’t want to accept anymore, the fact that the curriculum went from specialist-informed to marketing and sales opportunity informed was the straw that broke the camel’s back. I want to be a proud teacher. Proud teachers design a program that is the best they can do to help students reach meaningful goals. You are very welcome to set learning goals based on all kinds of arguments, including sales, but once the learning goals are set, you should trust the professional’s teaching experience to manufacture a great, fun, and helpful course or program. It will be better for everyone’s motivation.

PS. More on my new academic role soon, presumably!

New year? New career!

We’re at the start of 2023. It has almost become a habit for me to switch jobs about yearly, over the last few years. I have never intended it that way, but apparently I needed a few de-tours to find out where I wanted to go. I have not made it a secret that I regret quitting my astro career and I also have alluded to aspiring an academic career. My current job at the University of Amsterdam is adjacent to academia, and that was the whole reason I took it in the first place.

I have done fun projects, learned a lot about the ‘behind the scenes’ at universities and was a willingly active member in the interdisciplinary Data Science Center of the University of Amsterdam (UvA). Some things could have been better (“creating” demand for our work wasn’t overly successful, and support from IT for what we needed was consistently cut back to near zero budget), but I do not necessarily need to change jobs. With my leave, though, I have advised against replacing me by another Marcel. I think the money can be spent better, before another me would jump onto the Advanced Analytics bandwagon again at the UvA central administration. Thanks to all my colleagues at the UvA for an interesting and fun year and a half!

In the post that announced my current job, I described the road towards it, which included a second place in a race for an assistant professorship at a university medical center, shared with a computer science department. In a rather bizarre turn of events (details available off the record), I have eventually accepted an offer that is very comparable, and arguably even better than the position I was originally applying for. That means…

I’m proud to announce that as of Feb 1st, I’ll be an academic again!

I will be an assistant professor of data science in population health at the Leiden University Medical Center (LUMC) at their interdisciplinary campus in The Hague, where they also offer the Population Health Management MSc program.

I’m very excited to be giving a lot of serious education again, and to be doing research in a highly relevant field of science. I have very little network or track record in this field, so I expect to learn a whole lot! Keep an eye on this blog, I might be using it a bit more frequently again (no guarantees, though…). Here’s to a challenging, but fun 2023!

No more Patreon for me…

Going on with it would mean that from now on, I would need to put some serious time into it, creating a bunch of new material. I have plenty of ideas, but if I create this for only ten people, then why bother? That set me to think: why did this not work? I can think of a bunch of reasons:

  1. It wasn’t as good, fun or original as I thought it was. I tried to come up with angles to the topics that you don’t often see in the other online material, but who knows that this is what people would sign up for?
  2. The audience I was trying to reach was too much of a niche. I aimed at people who already knew some data science, but still were surprised by some of the topics I presented.
  3. I didn’t do enough marketing or advertisement. In the first weeks I spammed a bunch of platforms with it, and basically all of my membership came from that. After that, I sometimes posted teasers every here and there, but when this doesn’t seem fruitful, I get demotivated quickly. (If someone knows how to do this properly, I’d be all ears!)

When I asked my members what they would want to see treated in the episodes, I got requests for two types of things, that I wasn’t going to deliver:

  1. Examples from real life. I have done these things in the wild, but obviously can’t get too specific about use cases, and certainly can’t share the data I have worked with in the past. These are typically sensitive…
  2. Data engineering. Building a model is easy, deploying it isn’t, right? That’s probably right (although I think there is much to gain still in the sciency part, rather than engineering part of data science), but I just don’t enjoy the engineering part that much, so in an experiment for fun, I am not going to treat stuff I don’t like. Stubborn me.

Either way, the journey ends here. The site will go down, the Twitter account will be deleted and I don’t need to worry about finishing content on time anymore. It was fun, I learned more than my members did and at some point in the future I’ll just post all the stuff that I created out in the open on Github. The money my patrons were charged (or what is left of it) will go to open source projects. On to the next adventure!

New laptop, new Linux distro!

I’m a Linux user. Perhaps that should have read “I’m a Linux fan”. At work (for the last 8 years) I was forced to have a Windows workstation, but VMs and my personal laptops have been running Linux since 2001, and so have many of my work computers. Next month, in my new job, I’ll have a Linux machine again! I like it better than Windows, which I have used often for work, since 2013, and some versions of MacOS, which I have used for work while in the US (2010-2013). I’m not quite a distro-hopper, but I do try to switch every once in a while. Getting a new laptop is a great incentive to try something new (I have to install something anyway!) and I happened to get a new private laptop three weeks ago. It’s a Lenovo IdeaPad Gaming 3i. I’m not a gamer, but GPUs have more than one potential use (some specs in the image below). To use it properly, I need to get rid of Windows asap, obviously.

Before, I have used Fedora and RHEL, and a whole bunch of Ubuntu based systems: Ubuntu (until they started Unity), Mint, Kubuntu and Xubuntu. I thought I never was a big fan of GNOME. After my recent purchase, I was struck by the enthusiasm for Pop!_OS that I saw on the web. A distro that is basically just another Ubuntu fork, with some tweaks to the GNOME desktop environment. I was a little bit skeptical, but I was also looking to see what distro I would in September put on my work laptop (and, during work hours, I don’t want to be bothered with stuff that doesn’t work, so I’d rather try it out first). I gave it a try and was planning to try OpenSUSE or some Arch-based distro like Manjaro as well (not that I feel the need to feel very hardcore, but some people are fans, right?). Pop!_OS 21.04 was just out, so I created the bootable USB stick and went ahead. Installation was ultra-easy.

I’m not moving back, nor away! I like the look and feel of Pop!_OS very much and became a fan of a tiling window manager in just a few hours. Only marginal tweaking of default settings was needed for me, and not a lot of bloat-ware was installed (but I did remove vim, HA!). The fact that their desktop environment is called “Cosmic” and that they have a lot of desktop art in that general theme appeals to me as well. One of the really nice things is that they have an iso for computers with NVIDIA graphics, that makes the gpu work basically out of the box. Moreover, you can set the computer to use the internal graphical card (intel) only, the NVIDIA only, a hybrid scheme (internal only doesn’t let you use a second monitor…) or… a setting in which the NVIDIA card is only available for computation. Great for battery life. Also, the seamless integration of apt and flatpaks is quite nice. I feel confident to throw this on the cute Dell XPS 15 that I will get next month and I will likely be up and running in just a few hours. (And then I hope the web-based version of the whole 365 suite will not let me down…because yes, also this employer is quite MS-based in their tooling).

Terminal art, and some hints of what the desktop might look like.

So… Who’s gonna convince me of another distro to try? Suggestions, preferably with some arguments, are welcome!

The bumpy road to academia’s side entrance

I have indicated already earlier on this blog that I miss academia, and that I wouldn’t mind moving back into an academic job. I have made some attempts recently and want to reflect on the process here. Spoiler alert: I’ll start a job at the University of Amsterdam very soon!

In my journey back into academic life I have also applied less successfully twice, and for reflection on that, it is probably useful to understand my boundary conditions:

  • I left my academic career in astrophysics now roughly 8 years ago and have not done any pure science since (at least not visibly).
  • I have few, too few papers from three years of postdoc. I left my postdoc position with no intention to go back, and therefore have just dropped all three first-author papers that were in the making on the spot. They were never and will never be published.
  • I am strongly geographically bound. I can commute, but I can not move. Hence, I am bound to local options.

I have spent these last 8 years on data science and gained a fair amount of experience in that field. All that experience is in applied work. I have not done any fundamental research on data science methodology, As an aside, I have of course learned a lot about software development and team work in companies of different sizes. I have seen the process of going from a Proof-of-Concept study to building actual products in a scalable, maintainable production environment (often in the cloud) up close, very close. Much of that experience could be very useful for academia. If I (and/or my collaborators) back then had worked with standards even remotely resembling what is common in industry, science would progress faster, it would suffer much less from reproducibility issues and it would be much easier to build and use science products for a large community of collaborators.

But I digress…. The first application for an assistant professorship connected closely to some of the work I have done in my first data science job. I spent 5,5 years at a healthcare insurance provider, where some projects were about the healthcare side of things, as opposed to the insurance business. The position was shared between a university hospital and the computer science institute. I applied and got shortlisted, to my surprise. After the first interview, I was still in the race, with only one other candidate left. I was asked to prepare a proposal for research on “Data Science in Population Health” and discussed the proposal with a panel. It needed to be interesting for both the hospital as well as for the computer scientists, so that was an interesting combination of people to please. It was a lot of fun to do, actually, and I was proud of what I presented. The committee said they were impressed and the choice was difficult, but the other candidate was chosen. The main reason was supposedly my lack of a recent scientific track record.

What to think of that? The lack of track record is very apparent. It is also, I think, understandable. I have a full time job next to my private/family life, so there is very little time to build a scientific track record. I have gained very relevant experience in industry, which in fact could help academic research groups as well, but you can’t expect people to build experience in a non-academic job and build a scientific track record on the side, in my humble opinion. I was offered to compete for a prestigious postdoc-like fellowship at the hospital for which I could fine-tune my proposal. I respectfully declined, as that was guaranteed to be short-term, after which I would be without a position again. In fact, I was proud to end with the silver medal here, but also slightly frustrated about the main reason for not getting gold. If this is a general pattern, things would look a little hopeless.

As part of my job, and as a freelancer, I have spent a lot of time and effort on educational projects. I developed training material and gave trainings, workshops and masterclasses on a large variety of data science-related topics, to a large variety of audiences. Some of those were soft skill trainings, some were hard skill. Most were of the executive education type, but some were more ‘academic’ as well. When at the astronomical institute at biking distance a job opening with the title “Teaching assistant professor” appeared I was more than interested. It seemed to be aimed at Early Career Scientists, with a very heavy focus on education and education management. Contrary to far most of the job openings I have seen at astronomical institutes, I did not have to write a research statement, nor did they ask for any scientific accomplishment (at least not literally in the ad, perhaps this was assumed to go without saying). They asked for a teaching portfolio, which I could fill with an amount of teaching that must have been at least on par with successful candidates (I would guess the equivalent of 6 ECTS per year, for 3 years on end, and some smaller, but in topic more relevant stuff before that) and with excellent evaluations all across. Whatever was left of the two pages was open for a vision on teaching, which I gladly filled up as well. Another ingredient that would increase my chances was that this role was for Dutch speaking applicants and that knowledge of the Dutch educational system was considered a plus. Score and score. That should have significantly narrowed the pool of competitors. In my letter, I highlighted some of the other relevant experience I gained, that I would gladly bring into the institute’s research groups.

Right about at the promised date (I was plenty impressed!), the email from the selection committee came in! “I am sorry that we have to inform you that your application was not shortlisted.” Without any explanation given, I am left to guess what was the main issue with my application here. I wouldn’t have been overly surprised if I wasn’t offered the job, but I had good hopes of at least a shortlist, giving me the opportunity to explain in person why I was so motivated, and in my view qualified. So, were they in fact looking for a currently practicing astronomer? Was research more important than the job ad made it seem? Is my teaching experience too far from relevant, or actually not (good) enough? Dare I even question whether even this job ad was actually aiming for top-tier researchers rather than for people with just a heart (and perhaps even talent) for teaching? It’s hard to guess what the main reason was, and I shouldn’t try. One thing I am reluctantly concluding from this application is that a job in professional astronomy is hard to get for somebody who has long left the field. I think this vacancy asked for experience and skills that match my profile very well, so not even being shortlisted says a lot to me. Perhaps that’s not grounded, but that’s how it goes with sentiment, I guess. Perhaps a dedicated data science job in astronomy is still feasible, who knows.

In September, I’ll join the University of Amsterdam.

But alas, as said, I have also applied successfully. Yay! The University of Amsterdam (UvA) had an opening for a lead data scientist in the department of policy and strategy. Working for, rather than in higher education was something that previously didn’t really occur to me, but this really sounds like an opportunity to do what I like to do and do well, in the field where my heart is. The UvA is putting emphasis on data literacy in education as well as (inter-disciplinary) research. Big part of the job will be to build and maintain a network inside and outside of the university with data science communities. The Amsterdam Data Science Center fosters research that uses data science methods and meets around the corner. I will strive to take a central, or at least very visible role in that Center and be very close to academic interdisciplinary research! I’m excited! In due time, I’ll report on my experience.

Proper statistics is Bayesian

I was already convinced years ago, by videos and a series of blog posts by Jake VanderPlas (links below), that if you do inference, you do it the bayesian way. What am I talking about? Here is a simple example: we have a data set with x and y values and are interested in their linear relationship: y = a x + b. The numbers a and b will tell us something we’re interested in, so we want to learn their values from our data set. This is called inference. This linear relationship is a model, often a simplification of reality.

The way to do this you learn in (most) school(s) is to make a Maximum Likelihood estimate, for example through Ordinary Least Squares. That is a frequentist method, which means that probabilities are interpreted as the limit of the relative frequencies for very many trials. Confidence intervals are the intervals that describe where the data would lie after many repetitions of the experiment, given your model.

In practice, your data is what it is, and you’re unlikely to repeat your experiment many times. What you are after is an interpretation of probability that describes the belief you have in your model and its parameters. That is exactly what Bayesian statistics gives you: the probability of your model, given your data.

For basically all situations in science and data science, the Bayesian interpretation of probability is what suits your needs.

What, in practice, is the difference between the two? All of this is based on Bayes’ theorem, which is a pretty basic theorem following from conditional probability. Without all the interpretation business, it is a very basic result, that no one doubts and about which there is no discussion. Here it is:

Bayes' Theorem
Bayes’ theorem reads as: The probability of A, given B (the “|B” means “given that B is true”) equals the probability of B, given A times the probability of A, divided by the probability of B. Multiplying both sides with P(B) results in the probability of A and B on both sides of the equation.

Now replace A by “my model (parameters)” and B by “the data” and the difference between inference in the frequentist vs Bayesian way shines through. The Maximum Likelihood estimates P(data | model), while the bayesian posterior (the left side of the equation) estimates P (model | data), which arguably is what you should be after.

As is obvious, the term that makes the difference is P(A) / P(B), which is where the magic happens. The probability of the model is hat is called the prior: stuff we knew about our model (parameters) before our data came in. In a sense, we knew something about the model parameters (even if we knew very very little) and update that knowledge with our data, using the likelihood P(B|A). The normalizing factor P(data) is a constant for your data set and for now we will just say that it normalizes the likelihood and the prior to result in a proper probability density function for the posterior.

The posterior describes the belief in our model, after updating prior knowledge with new data.

The likelihood is often a fairly tractable analytical function and finding it’s maximum can either be done analytically or numerically. The posterior, being a combination of the likelihood and the prior distribution functions can quickly become a very complicated function that you don’t even know the functional form of. Therefore, we need to rely on numerical sampling methods to fully specify the posterior probability density (i.e. to get a description of how well we can constrain our model parameters with our data): We sample from the priors, calculate the likelihood for those model parameters and as such estimate the posterior for that set of model parameters. Then we pick a new point in the priors for our model parameters, calculate the likelihood and then the posterior again and see if that gets us in the right direction (higher posterior probability). We might discard the new choice as well. We keep on sampling, in what is called Markov Chain Monte Carlo process in order to fully sample the posterior probability density function.

On my github, there is a notebook showing how to do a simple linear regression the Bayesian way, using PyMC3. I also compare it to the frequentist methods with stasmodels and scikit-learn. Even in this simple example, a nice advantage of getting the full posterior probability density shines: there is an anti-correlation between the values for slope and intercept that makes perfect sense, but only shows up when you actually have the joint posterior probability density function:

Admittedly, there is extra work to do, for a simple example like this. Things get better, though, for examples that are not easy to calculate. With the exact same machinery, we can attack virtually any inference problem! Let’s extend the example slightly, like in my second bayesian fit notebook: An ever so slightly more tricky example, even with plain vanilla PyMC3. With the tiniest hack it works like a charm, even though the likelihood we use isn’t even incorporated in PyMC3 (which makes it quite advanced already, actually), we can very easily construct it. Once you get through the overhead that seems killing for simple examples, generalizing to much harder problems becomes almost trivial!

I hope you’re convinced, too. I hope you found the notebooks instructive and helpful. If you are giving it a try and get stuck: reach out! Good luck and enjoy!

A great set of references in “literature”, at least that I like are:

An old love: magnetic fields on the Sun

Dutch Open Telescope on La Palma, credits: astronomie.nl and Rob Hammerschlag.

Late 2003 and early 2004 I was a third year BSc student. I was lucky enough to be taken to La Palma by my professor Rob Rutten, presumably to use the Dutch Open Telescope, a fancy looking half alien with a 45 cm reflective telescope on top, that makes some awesome images (and movies!) of the solar atmosphere. It turned out to be cloudy for two weeks (on the mountaintop, lovely weather on the rest of beautiful island, not too bad….), so my “project” became more of a literature research and playing with some old data than an observational one.

A tiny part of the solar surface
A small part of the surface of the Sun. The lighter areas are the top of convective cells where hot gas boils up. Cooling gas flows down in the darker lanes in between. The bright white points are places where the magnetic field of the Sun is strong and sticks through the surface.

I started looking into “bright points” in “intergranular lanes”. The granules, see left, are the top of convection cells, pretty much the upper layer of the boiling sun. In the darker lanes in between the cooling gas falls back down to be heated and boiled up and again later. Inside these darker lanes you sometimes see very bright spots. These are places where bundles of magnetic field stick up through the surface. These contain some less gas, so you look deeper into the Sun where it is hotter, hence the brightness of these spots.

With different filters you can choose at which height in the solar atmosphere you look (more or less; I guess you understand I take few shortcuts in my explanation here…), so we can see how such regions look higher up and see what the gas and these magnetic bundles do. Looking at a bundle from the top isn’t necessarily very informative, but when you look near the limb of the sun, you are basically getting a side view of these things:

Images near the limb of the Sun in three different filters taken simulateously. On the left you see a side view of the image above (on another part of the Sun at another time, though). Moving to the right are filters that typically see a little bit higher up in the atmosphere (the so-called chromosphere). For the interested reader: the filters are G-band, Ca II H and H-alpha. Image taken from Rutten et al. 2012.

I spent about 3 months discussing with the solar physics group in Utrecht, which still existed back in the day, trying to figure out how these magnetic fluxtubes actually work. I wrote a (admittedly mediocre quality) Bachelor’s thesis about this work that ends with some speculations. I fondly remember how my supervisor did not like my magnetic field structure based interpretation and believed it was more related to effects of the temperature structure and corresponding effect on how the radiation travels through these bits of atmosphere.

I suddenly was drawn back to this topic two weeks ago, when I read the Dutch popular astronomy magazine Zenit. It was a special about Minnaert’s famous “Natuurkunde van ‘t vrije veld” and featured an an article by the designer of the DOT, Rob Hammerschlag, and talked about observations of the Sun, including these magnetic structures. I followed some links from the article and found myself browsing the professional solar physics literature from the past decade or so, on the look for the current verdict on these “straws” in the middle image above.

A detailed simulation of the solar surface and its magnetic field, by Chitta and Cameron from the MPS in Germany.

Obviously, the answer is slightly complicated and not as simple as mine (or my professor’s!) interpretation from 2004. While I was suggesting twisted magnetic field lines to be important, it turned out likely that the relevant phenomenon that is important in these straws are torsoidal waves through the tube (waves that you can make by grabbing it, and twisting like you twist the throttle of a motorcycle). Great fun to be taken back on a journey into the solar atmosphere, just by reading a simple popular article!