Taylor Swift and Markov Chains | Stats + Stories Episode 390 / by Stats Stories

Marina Ferrari de Aquino Klemm is an associate curator at the Auckland War Memorial Museum. She can be found listening to Taylor Swift while she's on marine expeditions throughout the South Pacific, cataloging museum specimens, or analyzing all sorts of biodiversity data. 

Check Out the Full Article

Create Your Own Color-Based Playlist

Charlotte Jones-Todd taught as a senior lecturer at the University of Auckland, New Zealand. She spends her time teaching statistics and coding, fixing bugs, pandering to her pets, and baking bread.

Episode Description

Taylor Swift is an entertainment juggernaut. She's become one of the best-selling musical artists of all time, with her Eras tour grossing more than $2 billion. During that tour, Swift surprised her audience each night with costume changes to mark different eras of her career. Now, a couple of researchers have figured out how to predict what costumes Swift would wear, when, and if these outfit colors were related to the sentiment of songs being performed. Predicting the colors of Swift's Eras tour is the focus of this episode of Stats and Stories with guests Marina Ferrari de Aquino Klemm and Charlotte M. Jones-Todd.

Full Transcript

John Bailer

Taylor Swift is an entertainment juggernaut. She's become one of the best-selling musical artists of all time, with her Eras Tour grossing more than $2 billion. During that tour, Swift surprised her audience each night with costume changes to mark different eras of her career.

Now, a couple of researchers have figured out how to predict what costumes Swift would wear, when she would wear them, and whether the colors of those outfits were related to the sentiment of the songs being performed. Predicting the colors of Swift's Eras Tour is the focus of this episode of Stats and Stories, where we explore the statistics behind the stories and the stories behind the statistics.

I'm John Bailer. Stats and Stories is a production of the American Statistical Association in partnership with Miami University's Departments of Statistics and Media, Journalism, and Film.

Rosemary Pennington is away. We have two guests joining us on today's show. Marina Ferrari de Aquino Klemm is an associate curator at the Auckland War Memorial Museum. She can be found listening to Taylor Swift while on marine expeditions throughout the South Pacific, cataloging museum specimens, or analyzing all sorts of biodiversity data.

Charlotte M. Jones-Todd is a senior lecturer at the University of Auckland, New Zealand. She spends her time teaching statistics and coding, fixing bugs, pandering to her pets, and baking bread.

Marina and Charlotte are the authors of a recent Significance article, "We Were in Screaming Color: Colors of the Taylor Swift Universe—A Statistical Story."

Thank you both for being here. When I'm thinking about Markov chains, correspondence analysis, and tests of independence with categorical data, I immediately think about Taylor Swift.

Charlotte M. Jones-Todd

Right? There's no other thing to think about.

John Bailer

Yes, I mean, where else would you start?

I must start by finding out what led you to think about the colors of outfits and questions related to this performer's wearing of them and when she wore them.

Charlotte M. Jones-Todd

I'm going to pass this over to Marina because she's the brains behind all of this.

Marina Ferrari de Aquino Klemm

Well, Taylor Swift is my favorite thing to talk about, so I'm so happy you're asking me this question.

I've always been a fan of Taylor Swift since I was maybe 13 years old. She always put hints into her songs and lyric books. Back in 2008 or 2009, she would put capitalized letters within her lyrics, and they would form a secret message that fans would try to decipher by circling them.

That was me in Brazil. I didn't have access to the lyric books because she wasn't very popular there then, so I would download them, print them out, and circle the letters myself so I could have the experience.

That started way back. Taylor Swift fans, or Swifties, have a reputation for trying to find hidden messages everywhere. That's really how she raised us. She created this detective-board mentality, with lines connecting clues and hints she dropped in music videos and other places.

I thought it was natural that she would do that on the Eras Tour, too—that she would be putting hints into different aspects of the show. I was particularly interested in the colors of the outfits for the surprise song set.

This mammoth tour had 189 concerts over several years. She always performed the same songs in the same order, and the one thing that was truly special at every concert was the surprise song set. It was an acoustic segment featuring songs that weren't part of the regular set list. She would perform two songs selected for that show—one on guitar and one on piano—and she would wear a different-colored outfit each time.

That was the thing everyone talked about. People would say, "Oh my God, I went to night two in Melbourne, and she wore this dress and sang these songs and this mashup."

So, I started wondering how she chose the songs. I couldn't find any obvious link between the songs she selected, but the dresses were much easier to sample and analyze because there were only 12 dresses throughout the entire concert series.

That's how the quest began.

Charlotte M. Jones-Todd

Whenever you think something's random, humans love to ask, "Is there a pattern?" We think there's a pattern, so let's see if we can quantify it.

John Bailer

Yes, so you capture this in the Significance article, "We Were in Screaming Color: The Colors of Taylor Swift's Universe—A Statistical Story."

The first part of the article looks at the outfit worn during the surprise song set on a given night and whether it was associated at all with the outfit worn during the surprise song set the previous night. My question is, you're using tools like Markov chains to do this. Can you give a nice, lay explanation of what a Markov chain would consider in this situation?

Charlotte M. Jones-Todd

Oh, yes. Way to put us on the spot.

I like to think about it in terms of imagining Swift trying to choose her outfits. Imagine there's a nice wardrobe with a big rail where everything is beautifully organized. The second option is that you've just got a pile of clothes on the floor, which is probably more like how I get dressed in the morning. You're just grabbing whatever is clean.

The difference is this: Are you going to the organized rail of clothes and picking out your blue dress, then saying, "Okay, I wore my blue dress yesterday, so today I'll wear my purple dress"? Or are you doing something more random?

What we're good at quantifying, and what computers are really good at quantifying, is what happens at random. What happens when we throw all our clothes on the floor and just pick things up without any thought about what we're doing?

The idea of these Markov chains is a fancy statistical way of asking whether things are following an order. Have we nicely hung up all our clothes and are we selecting them in sequence, making the process a bit more deterministic? Or are we just picking things up at random?

By comparing those two possibilities, you can get a feeling for whether Taylor Swift was an organized outfit planner or not.

John Bailer

Okay, so if you knew what she was wearing last night, did it give you any information about what she might be wearing tonight during the surprise song set? What did you find?

Marina Ferrari de Aquino Klemm

It didn't matter—at least not all the time.

We separated the tour into three legs. There was the first leg, which included the United States, Oceania, and South America; the middle leg, which was Europe; and the last leg, when she came back to North America and performed in the United States and Canada.

We found that for the first and last legs, the outfit choices appeared random. We couldn't find any clear order in how she chose the dresses. But for the European leg, there was a clear sequence of colors that seemed to be intentionally chosen.

We don't really know why. Maybe she found a better dry cleaner in Europe. Or perhaps it was because the European leg was when she introduced another part of the tour featuring The Tortured Poets Department album. It was a whole new set of songs and a new section of the show.

Maybe because she debuted new songs, she also introduced a new pattern in the dress colors. Everything seemed so planned, and she had a good break between tour legs. I wonder whether that was the point when the team decided, "Okay, we're going to plan even the colors of the dresses." I believe that's what her team said.

Charlotte M. Jones-Todd

I think she literally was like, "Yes, we're going to do a first-order Markov chain, and that's how I'm going to wear my dresses."

John Bailer

I would love to have validation of this. I want to hear from her. I want to hear from her people. Have her people call our people just to let us know. This was great fun.

How did you get the data for this? Where did you find all this information?

Marina Ferrari de Aquino Klemm

Dedication.

When the Eras Tour started, I had just finished my PhD and was looking for a job, so it was kind of a perfect storm of free time. It's easy to make an Excel spreadsheet, and that's how I started tracking what color dress she wore and what songs she sang. It just kind of went from there.



John Bailer

Well, it certainly generates more hypotheses. You start thinking about what's different about that middle leg of the tour. You hinted at some of the things that might have changed and why the pattern appeared there but not during the first or last part of the tour.

Do you have any other thoughts about what is different?

Marina Ferrari de Aquino Klemm

She was also recording another album—her last album—during that time. She was doing a lot of things. So maybe a different person was choosing her outfits because she was busy recording, finishing concerts, and still going to the studio.

It's a three-and-a-half-hour concert, and she was still recording a whole new set of songs and flying to Sweden all the time. So maybe that's what happened. Maybe there was another person taking care of the dresses for her.

Charlotte M. Jones-Todd

I think she just had a nice, tidy wardrobe. The Europeans obviously have good wardrobes, right? A proper closet.

John Bailer

I found myself thinking, "Gosh, I wonder how temperature and humidity affect this." Was it the weather during the performance? What other covariates might be involved?

This is the pathology of thinking about things analytically. You start wondering what else you might introduce that could drive the probabilities of wearing a particular color given the color worn the night before.

But we don't need to go there. You have done a lot of work already, and I'm not trying to assign extra projects.

You didn't stop with one question, though. You weren't going to be done with colors after just one bite at that apple. You also started thinking about color and sentiment.

Can you talk a little bit about that? You're looking at lyrics, so how do you think about colors, how people feel, and how sentiment is measured?

Charlotte M. Jones-Todd

Yes, we had a good chat about this. Marina had the idea and said, "I think there's a link between the tone of the song and the colors that are mentioned." I'm sure Marina will talk a little more about that.

I should say that I made Marina listen to all the songs again and act as the expert, coding whether there was a positive or negative sentiment based on her knowledge as a fan.

You can automate these things. You could do the boring thing and run the lyrics through a dictionary that assigns positive, negative, or neutral sentiment. But there are so many layers to these songs. Who's better than an absolute expert—in the form of Marina—to say, "I'm going to listen to this and code it all myself"?

Marina Ferrari de Aquino Klemm

Yes, because I came to Charlotte and said there was an issue. I was trying to get sentiment scores for each song, but it gave us funny results.

For example, "Shake It Off," which is one of her most positive and empowering songs, was getting a very negative score because she says, "The haters gonna hate, hate, hate, hate, hate, hate, hate," so many times. Every time the word "hate" appeared, it lowered the score of the song.

I was telling Charlotte, "How am I going to classify songs as positive, negative, or neutral if this is what happens when we use dictionary values?"

Then Charlotte said, "You could ask an expert. You're the expert."

And I was like, "Oh my God, of course I am." I've been a fan for most of my life, so I could do the arduous task of listening to every single song again. Oh my gosh, it was terrible!

Charlotte M. Jones-Todd

Yes, an arduous task. I made you do that.

Marina Ferrari de Aquino Klemm

Terrible.

John Bailer

You also mentioned in your paper that you had some automation of this process, where you would look at the lyrics, maybe a line at a time, and somehow aggregate that information over the entire song.

Marina Ferrari de Aquino Klemm

That's right, yes. Each song would have an average score based on all its lines. Each line had a separate score, and then we calculated the average for the song. That's right.

John Bailer

And then did you compare that type of rating to your general, aggregate sense of what was going on with the song?

Marina Ferrari de Aquino Klemm

I did. I used two different methods. I think one was a package in R called syuzhet, and the other was sentimentr. I ended up using sentimentr because it was more like how I would have rated the songs myself.

It didn't make it into the paper because there was already too much to cover, but yes, I did compare them.

John Bailer

All right, you're listening to Stats and Stories, and we're talking about Taylor Swift, colors, outfits, songs, and sentiment with Marina Ferrari de Aquino Klemm and Charlotte Jones-Todd.

I must ask: What did you learn? You did all this analysis, processed the colors mentioned in the songs, and examined the associated sentiment.

There was also a second component to the analysis—the color of the outfit being worn and the songs that were performed. Did you find any connection between the outfit color and the sentiment of the songs?

Marina Ferrari de Aquino Klemm

Yes, we did.

It wasn't statistically significant in the traditional sense, but we found a negative correlation. What that means is that she would wear one of her happier-colored dresses and then sing one of her saddest songs, and vice versa. It added another element of surprise to the performance.

We found that reds and blues were the saddest colors mentioned in her lyrics, while more colorful shades, such as yellows and greens, were associated with happier themes. Based on that, we expected that when she wore the green or yellow dresses—or the dresses that mixed multiple colors—she would be singing happier songs.

Instead, we found the opposite. When she wore those dresses, she tended to sing sadder songs. And when she wore the pink or blue dresses, which corresponded to colors that were associated with sadness in her lyrics, she tended to sing happier songs.

Charlotte M. Jones-Todd

There was a little bit of statistics involved in getting there.

We were talking earlier about the sentiment associated with the colors Taylor Swift mentions in her songs. After Marina went through and coded whether those references were positive or negative, we could essentially attribute a general sentiment to each color. For example, some colors were more often mentioned when she was talking about happy or fun things.

Finding that she then wore those colors while singing some of her sadder songs was really interesting. I thought that was quite cool.

I've heard people talk about how the tone of a song can sound happy even when the lyrics are very sad. That's probably going beyond my knowledge of music, but it was interesting to see something similar reflected in her use of color as well.

John Bailer

Yes, it's always interesting to think that there might be this sort of mixed message, with the outfit running counter to the sentiment of a song. That was a neat observation. It would be fun to see whether that continues.

Charlotte M. Jones-Todd

You were talking the other day, Marina, about how the way she mentions color is changing as well, right?

Marina Ferrari de Aquino Klemm

Yes. I can give some examples of how she has used colors in her lyrics throughout the years, if that's helpful.

She has a very famous album called Red. Throughout that album, she mentions red many, many times. In the title track, "Red," she sings, "Losing him was blue like I'd never known, missing him was dark gray all alone, but loving him was red, burning red."

Just think about that phrase: "burning red."

Then, seven years later, on the album Lover, she has a song called "Daylight," where she says, "I once believed love would be black and white, but it's golden. I once believed love would be burning red, but it's golden."

To me, it almost feels like she's name-dropping a person. In 2012, she was saying, "Love is burning red." Then in 2019, she's saying, "I used to think love was burning red, but it's golden." It's as though she's saying, "My new muse is golden."

Throughout Lover, she also mentions blue many times in relation to love. For example: "I'm with you even if it makes me blue," "My heart's been borrowed and yours has been blue," "I blew things out of proportion, now you're blue," and "It's blue, the feeling I've got."

Those are references from four different songs. This new muse is associated with blue and golden. The Lover album has this feeling of falling in love, but also that it hurts. There's a sense of incompatibility or uncertainty, which may explain all the blue references. Blue ended up being one of her saddest colors.

Then, on her newest album—which came out just as our paper was about to be published, and we were able to sneak in a final sentence about it—she has a song called "Honey," which is about her now-fiancé, Travis Kelce.

In that song, she says, "You redefined all of my blues when you say 'Honey.'" She connects blue to the color of his eyes. So now the question becomes: Does blue mean something different? Has it become a positive color because he redefined all her blues?

If blue is now associated with the color of his eyes, maybe it's no longer a sad color. Maybe it's a happy one.

John Bailer

Well, context is important when trying to do an analysis like this.

There is clearly deep knowledge here, and deep research. This is very impressive. I love the different dimensions you've explored as part of this project.

You also included a component where you asked whether you could predict the sentiment of a song by looking at the color of the dress being worn. Can you talk a little bit about how you approached that?

Marina Ferrari de Aquino Klemm

For that analysis, we automated the sentiment scoring of each song using the sentimentr package in R. That gave us an average sentiment score for each song.

Then came the extra work—the unfortunate extra work I had to do—which was to go through every single mention of a color in the lyrics. I think there were about 180 individual color references. I scored each one myself as positive, negative, or neutral.

For example, in the lyric, "You paint me a blue sky, then go back and turn it to rain," the phrase "blue sky" is positive. It's a happy image, even though it later turns into rain. So, I coded blue in that context as positive.

For a neutral example, there's the lyric, "Drowning in the Blue Nile, he sent me downtown lights." Blue Nile is the name of a band, so it's neither good nor bad—it's simply descriptive.

For a negative example, there's the lyric, "It's blue, the feeling I've got," from "Cruel Summer." That's associated with the anxiety and uncertainty of falling in love, so I coded blue as negative in that context.

So, I went through the task of rating all 180 color mentions and determined whether each reference was positive, negative, or neutral.

Charlotte, do you want to talk about how we compared them?

Charlotte M. Jones-Todd

Yes. Once we had those scores, we looked at what sentiment was generally associated with each group of colors.

We wanted to see whether the average sentiment connected to a color in the lyrics was related to Taylor wearing that color later. But, for me, what was more interesting than predicting what she might wear next was looking at the overall distribution of color mentions.

Were certain colors mainly associated with positive sentiment or negative sentiment? As Marina mentioned, many colors had different meanings in different contexts. We looked at how often each color was coded as positive, negative, or neutral and asked whether those frequencies were different from what we might expect by chance.

The statistical term would be something similar to a chi-square test. We went a bit beyond that, but the basic idea was to compare what we observed against a null hypothesis—the "boring hypothesis," if you like—where nothing particularly interesting is happening.

Under that hypothesis, we might expect positive, negative, and neutral references to occur in roughly equal proportions. Using statistical methods, we could assess whether certain colors were more likely to be associated with positive or negative sentiment.

From there, we created what the technical description would call a reduced-dimensional space. But the simpler explanation is that we examined the associations among colors based on whether they tended to be positive or negative.

That allowed us to see groupings of colors. For example, blues and reds tended to cluster together because they were more often associated with negative sentiment. Meanwhile, greens and multicolored references tended to be associated with more positive sentiment.

For me, it was interesting not just to say, "Blue is more likely to be negative," but to look at how all the colors related to one another and fit together in this broader visualization. That color plot was one of my favorite parts. 

John Bailer

I thought it was really neat that you also provided tools for fans to explore the data themselves.

You set up resources on GitHub and also created a Shiny app so people could build their own playlists. Can you tell us a little about those resources and how fans can use them?

Marina Ferrari de Aquino Klemm

Oh, I loved hunting for Easter eggs throughout her lyric books and music videos.

I thought a fan like me reading this article might not necessarily stay for the statistics, but they might stay for the Easter eggs. Throughout the article, there are lots of lyrics and references that you might not notice if you're not a fan. Every paragraph has at least one mention of a song that you might not immediately recognize.

I also had this huge metadata spreadsheet and thought, "Who's going to download a spreadsheet?" It's a bit boring to look at. I mean, I like it, but other things are more relatable.

So, I created a Shiny app that lets people build playlists. I have lots of different data fields, such as song sentiment, who fans think the muse is, or what color dress she was wearing during the Eras Tour. I turned those into a few dropdown menus so users can create playlists based on different criteria.

For example, you can generate a playlist of all the songs she performed while wearing a pink dress, all the songs about heartbreak, or all the songs about betrayal. Then you get a list that you can add to your own playlist.

Charlotte M. Jones-Todd

I think it was based on the kinds of connections fans make—those massive boards with strings connecting different concepts and clues that we've talked about.

It was good fun to give people tools they could use. They can download the data and explore it in whatever software they like, or they can use the more user-friendly tools Marina created.

I've actually used some of the examples in my classes. I teach a biostatistics class, which is obviously very closely related to Taylor Swift.

My students have been able to play around with the data and learn a little about Markov chains and hypothesis testing. So, it's out there for people to use in whatever way they would like.

John Bailer

I'm curious—have you heard from any Swifties about the Significance article?

Marina Ferrari de Aquino Klemm

I have heard from another Brazilian Swiftie because we're big fans. We're professional fans.

She also published a paper about using Taylor Swift music videos to teach botany, so we are definitely professional fans.

If you go to any band's social media page, there's always someone saying, "Come to Brazil." We are professional fans.

I posted the article on Reddit, and there were a lot of comments. Many people who teach statistics were happy to see it, and they were happy to see that it was coming from a fan. I was using the same terms fans use, including the names fans give to the dresses. On Reddit, people were really excited that something like this had come out of the Fandom (a subreddit).

John Bailer

Okay, so what's next? What's going to follow this work?

Charlotte M. Jones-Todd

We've got to wait for at least a few more albums, right? Taylor Swift needs to step up her game a bit.

Marina Ferrari de Aquino Klemm

I'm very curious about the colors and whether their meanings continue to change. Who knows what's going to happen now?

John Bailer

Well, I'm afraid that's all the time we have for this episode of Stats and Stories. Marina and Charlotte, thank you so much for being here.

Marina Ferrari de Aquino Klemm

Thank you.

Charlotte M. Jones-Todd

Thank you very much.

John Bailer

Stats and Stories is a partnership between the American Statistical Association and Miami University's Departments of Statistics and Media, Journalism, and Film.

You can follow us on Spotify, Apple Podcasts, or wherever you find podcasts. If you'd like to share your thoughts about the program, send an email to statsandstories@amstat.org or visit statsandstories.net.

Be sure to listen for future editions of Stats and Stories, where we discuss the statistics behind the stories and the stories behind the statistics.