Cows to computer code: These South Dakota college students developed software to track cattle market
If you ask Todd Gagne, the cattle market and the stock market are as different as chalk and cheese, the main distinction being that the price of cattle is notoriously difficult to predict.
But students from the South Dakota School of Mines and Technology in Rapid City are working on a computer program that aims to do just that, thanks to a late rancher's 29-year-old notes.
Mathematical Analytics Producer Program, or MAPP, is a market analytics tool developed by computer science majors Jordan Baumeister, Dustin Reff and Trevor Bormann under the direction of Gagne, a Mines alumnus and sponsor of the program.
The software works by calculating 187 variables that each change the price of cattle futures — contracts between a buyer and a seller for the sale of cattle at a later date. This includes common factors like fertilizer and corn prices and some unusual influences like water levels along the Missouri River.
Futures contracts are a rewarding-but-volatile means for investors to bet on the price of commodities months before an formal sale is made. However, they also allow livestock farmers to lock-in the price of their cattle, pushing the risk of a fluctuating market onto the investors.
The history of MAPP
Gagne started the project in 1993 when he was a student. Ron Ragsdale, a prolific rancher who raised livestock on a 55,000-acre farm in western South Dakota, approached Gagne with a math problem. He needed help developing a computer program that could add up all the variables that affect the cattle market.
Before MAPP was developed, Ragsdale, who had a background in math and statistics, was calculating the entire equation by hand.
"The genius was he figured out all the math," Gagne said. "He was super meticulous on his costs and understood them, and he was comfortable locking in his profitability."
Ragsdale was a "super methodical" man who saw risk-to-reward relationships in everything, including how he sold his cattle. That's a major difference, Gagne said, compared to many farmers and ranchers who rely on "gut instinct" to price their commodities.
"I think when you're dealing with multiple commodities that feed into one product, the markets aren't always as rational as you think. The market doesn't always rationalize that independently," Gagne said. "I think a lot of ranchers intrinsically know their costs and a lot don't use futures to hedge their bets."
To that end, Ragsdale needed the then-undergraduate from Mines to find a way to automate the process. So Gagne, his wife and another student developed the program over the last few decades.
According to Gagne, the software has only failed to give positive predictions for cattle prices on two occasions. Once was during the 9/11 attacks and the other time following the 2008 financial crisis spurred by the collapse of Lehman Brothers.
Work still remains
Ragsdale "was always concerned all this work would end up in his coffin," Gagne said.
The rancher died in bed on Dec. 5, 2021, and some of Ragsdale's theories on cattle prices remain unpublished.
However, the work was given new life through the three students who have undertaken the completion of the computer program. During the last two semesters, Gagne said the undergraduates have been examining trends in the cattle and corn markets from the last 30 years.
Right now, the program is relatively accurate when predicting cattle prices for the next six to 12 months, but Gagne said there's still work to be done to fine-tune the software.
Baumeister, Reff and Bormann graduated in May and will be passing the torch to a new team that will spend the next two semesters applying data to Ragsdale's equations.
The MAPP project "is something with real-world applications, and these students got a glimpse into an industry that they might not have known much about," Gagne said.
Dominik Dausch is the agriculture and environment reporter for the Argus Leader and editor of Farm Forum. Follow him on Twitter and Facebook @DomDNP and send news tips to firstname.lastname@example.org.