Hillary Clinton has had a good run in recent days. She delivered her best speech yet, secured the Democratic nomination, beat Bernie Sanders in California and received President Obama's endorsement. But will this last? Can she win in November?
Some scholars believe that the outcome of a presidential election is determined by a set of cold facts - chiefly, the state of the economy and the number of terms a party has been in power. And by that measure, things look bad for Mrs Clinton.
The most famous election model, devised by Yale economist Ray Fair, is said to hold up well in analyses of elections going back a century. For 2016, it has a generic Republican candidate beating the Democrat handily. The logic behind this is simple: The economy remains sluggish; specifically, income growth has been low.
But Mrs Clinton's biggest challenge is perhaps that it's extremely difficult for a party to win a third consecutive term in the White House. It last happened 28 years ago, with Mr George H.W. Bush following the late Mr Ronald Reagan. And before that, it was nearly five decades earlier, with Franklin Roosevelt in 1940.
Of course, other models look at similar objective measures but make different assumptions, especially about how to assess the health of the economy. Depending on which factors they use - unemployment, inflation, home prices - the models reach different conclusions, with some predicting a Democrat winning. Some also look at the incumbent president's approval rating. Professor Larry Bartels of Vanderbilt University, one of the foremost scholars in the field, told me, "The models that look at (economic) fundamentals are mixed but probably average out to giving the Republican the edge."
Another way to predict the outcome of an election is to look at polls. There are models that employ statistical techniques to average and smooth out polling data. The logic of relying on these is also simple. Elections are determined by many factors. It's impossible to know in advance all of them or measure them accurately. Polls incorporate how people feel about the economy, the incumbent, the state of the world, etc. Polls have Mrs Clinton winning, as do betting markets, which are a reflection of the polls.
So which is it? Enter the blended models, which use a mix of economic data and polls. Most of these predict Mrs Clinton winning, although some favour the Republican. Why? The fundamental factors might favour the Republican Party, but only very slightly, and polling data reflects the huge variable of 2016: Donald Trump.
When thinking about models that use past patterns to predict the future, it is worth keeping in mind that most of them were wrong about the Republican primaries. Even the estimable Mr Nate Silver got it wrong, because he argued that polling data from early in the primary season was largely irrelevant, and that past patterns showed that endorsements and fund-raising were crucial.
Having taken statistics courses in graduate school, I sense that one can make two errors in this area. One is to forget that most political patterns - say, that early polls don't matter in primaries - are built on tiny amounts of data. The open primary system has really existed only since 1972. The rules within it have changed along the way. When computer scientists talk about "big data" and the ability to detect patterns, they are usually talking about millions of data points. In politics, we are looking sometimes at just 30 or 40 elections and generalising from them. Any "pattern" that emerges from these examples is extremely tentative.
The larger point, however, is in the nature of social science itself. Many years ago, I asked Nobel Prize-winning scholar Herbert Simon - who made path-breaking advances in political science, economics, psychology and computer science - whether social science would ever be as exact and predictive as the natural sciences. "No," he replied, "Because the subjects of our study think." We are not particles of matter but people.
And as people focus more closely on this race, they will surely come to recognise that Mr Trump is not a generic Republican candidate but rather an unscrupulous and vulgar narcissist, a pathological liar, a bigot and a xenophobe. That will overwhelm what any model would predict.
Because, in the end, we do think.