Yes, you can make a Robot Overlord
The question of whether an algorithm could be constructed that spits out laws and policies to govern a human society is not at issue. The complexity of such a thing is mind-boggling but I don't doubt that it can be done. We have algorithms that can make decisions extremely quickly (such as high frequency traders) and we have algorithms that can make sense of unbelievable mountains of data (such as Yahoo! Hadoop Cluster). We already have plenty of compute power in the form of Amazon Web Services, Microsoft Azure, Google Compute Engine and others. How to synthesize all that data into something that can say "make this law, here" is another matter. It's definitely computable, just not easy.
You would need data sharing agreements with access to almost everything about a person's economic life, including but not limited to credit card usage, tax returns and debt load. If you had this for every person in a 1st world country, you'd have a really really good idea of how the economy is going. Combine this info with all the research from economic statics researchers (Thomas Piketty is a good place to start.)
But Acceptance is hard
The primary issue with this is getting humans to accept such leadership. So either a large change in mindset will need to happen based on a long period of successes by algorithm controlled leaders where people literally say "I welcome our new robot overlords!" or control shifts in the background to where no one sees it. The former approach is certainly difficult and may ultimately fail. The latter approach while sneaky, has a better chance of succeeding because it doesn't have to outright face political scrutiny. A political leader just needs to follow the advice of the Robot Overlord and they will make the optimal decision based on available data.
Yeah, but who's priorities?
Any algorithm needs to choose outcomes and optimal conditions to solve for. Who gets to choose those conditions and how are they quantified? The 1%-ers will argue for outcomes that strongly benefit them. The lower-50%-er will want outcomes that strongly benefit them. Neither group gets what they want without costs to the other group. Negotiating these parameters will be very difficult. Perhaps the best way to answer the question is by asking "Given an economic system, would you favor that system if you were randomly born at any strata of that system?" Capitalism is great if you're rich. Communism is okay, if you're poor. The robot overlord will need to enforce a system that maximizes good for everyone.
A sociologist and a political scientist could probably give you a better idea of all the factors that go into how humans make political and economic decisions.