Using machine learning to predict the collapse & stabilization of complex systems?

Started by
20 comments, last by WireZapp 9 years, 6 months ago
Well, I don't need to predict into the future with this I imagine. How could I tell that I am stable right now, rather than in 5 minutes from now.
Is there a way to do that?
Advertisement
All I need to know is if there is a method that would allow me to greatly reduce calculations during stability. If the graph just keeps on repeating there has to be a way I can detect that and just keep on copying until an interrupt happens or something significant occurs

I am confused... why do you want to copy the graph? I thought it represented what your agents were doing in the simulation?

I didn't actually mean the graph. I meant the next "Values" for the next iteration.

But I solved it. (Well, I didn't. I sent the code to a friend who is a specialist in Econometrics). I'm storing Markov Chains of the advertisements the agent picks. So if it decides to eat, from a track record, there is a 15% chance that it'll want to sleep next. Role a random number generation, and execute the probability it lands on. Large number theorem allows these probabilities to approach their true value as the sample size tends to infinity, so I imagine this would produce quite accurate results. I could even just throw an if statement or two in there for good measure.

Think of it this way: how do you define "stable"?

Stable means you're not about to "collapse" within some finite window of future time. But you can't predict the future, so how can you measure if you are stable?


In other words: stability is a property of a system over time, not instantaneously.

Wielder of the Sacred Wands
[Work - ArenaNet] [Epoch Language] [Scribblings]

Huh... thats a really good point. People though believed they were stable until right before the recession, so I imagine that you can know if you're stable from a history of data as well. Obviously that would be an approximation, and a false positive at that, but at least it could be correct over a constant time interval.

Excellent - now you understand the problem you are trying to solve that much better.

What you want is basically exactly what you just described: an approximate prediction that has an arbitrarily high probability of being correct based on how much input data is fed in and what timeframes are considered.

Now that you have a little more insight into what your requirements really are, you can select a tool for this job. Not surprisingly, there are many fields in which modeling chaotic systems and trying to predict them is really important - weather prediction being the classic example. The tools you wind up using to try and model your simulation are going to depend heavily on the type of data you have available, the quantity of data available, and how much time you can afford to spend recalculating things as the data changes (i.e. as new "Facts" are discovered about your system).

You mentioned Markov chains as a potential solution. Here's why I think that will ultimately wind up just frustrating you: think about how many inputs your agents have for things they can think about in order to make a decision. You dropped the number 2000 per agent earlier, for instance. In order to accurately model a decision process with N inputs, you typically need something like a Markov chain of length N, give or take. If each of your agents needs a 2000-long chain, and each chain has to be constantly recalibrated based on decisions propagating through time... you've just made a ton of work for yourself.

Can you get decent results with, say, an order-20 chain instead? Probably. But there will always be those mysterious cases where Markov fails you, and you get incredibly inaccurate predictions. This is partly because of chaos, and partly because your modeling tool is inherently limited.

It really all depends on how badly you want to try to predict stability (or the lack thereof) in your system, and how badly you will be hurt if you cannot accurately and reliably do so. Ironically, as I mentioned earlier, oftentimes the best way to know what state a system is in at a given time is to just simulate it up to that time, and look.

If your simulation is fast enough to handle the agent and input volume you need, then I'm honestly not sure why all this difficult stuff has to be thrown around in the first place. If it's too slow, on the other hand, have you exhausted the possibilities of other kinds of optimization?

Wielder of the Sacred Wands
[Work - ArenaNet] [Epoch Language] [Scribblings]

Excellent - now you understand the problem you are trying to solve that much better.

What you want is basically exactly what you just described: an approximate prediction that has an arbitrarily high probability of being correct based on how much input data is fed in and what timeframes are considered.

Now that you have a little more insight into what your requirements really are, you can select a tool for this job. Not surprisingly, there are many fields in which modeling chaotic systems and trying to predict them is really important - weather prediction being the classic example. The tools you wind up using to try and model your simulation are going to depend heavily on the type of data you have available, the quantity of data available, and how much time you can afford to spend recalculating things as the data changes (i.e. as new "Facts" are discovered about your system).

You mentioned Markov chains as a potential solution. Here's why I think that will ultimately wind up just frustrating you: think about how many inputs your agents have for things they can think about in order to make a decision. You dropped the number 2000 per agent earlier, for instance. In order to accurately model a decision process with N inputs, you typically need something like a Markov chain of length N, give or take. If each of your agents needs a 2000-long chain, and each chain has to be constantly recalibrated based on decisions propagating through time... you've just made a ton of work for yourself.

Can you get decent results with, say, an order-20 chain instead? Probably. But there will always be those mysterious cases where Markov fails you, and you get incredibly inaccurate predictions. This is partly because of chaos, and partly because your modeling tool is inherently limited.

It really all depends on how badly you want to try to predict stability (or the lack thereof) in your system, and how badly you will be hurt if you cannot accurately and reliably do so. Ironically, as I mentioned earlier, oftentimes the best way to know what state a system is in at a given time is to just simulate it up to that time, and look.

If your simulation is fast enough to handle the agent and input volume you need, then I'm honestly not sure why all this difficult stuff has to be thrown around in the first place. If it's too slow, on the other hand, have you exhausted the possibilities of other kinds of optimization?

I hadn't fully considered that for the advertisements. Jeez.

And yeah, I've considered a lot more optimizations that can be made. We're trying to redesign the scoring system to be a lot more parallel.

That won't give the full performance increase we want.

We're using the engine to create a political simulator (Just as a tech demo, not a final game). The player tries to design a new law (through a flow graph system), raise taxes, start new cities, etc to keep his citizens happy.We also figured out for this to be enjoyable we would need a few hundred thousand entities, and perhaps anywhere from 50k - 60k advertisements. We're aiming for a 10 second delay between turns. Where our AI engine stands right now, our in house testing rig can run through all those entities in about 98 seconds. We're hoping adding GPGPU will bring that time down to a more reasonable 50 seconds but, that's still too long.

We also noticed that close to 80% of the time (when the player is playing well) the system was just creating repetitive patterns, and was highly stable. When the player didn't do well, that number was closer to 50%.

We've tried various prebaking methods, and while they greatly reduce computation time, they don't give as enjoyable of a result.

On a side note:

We have various other optimizations that were made. For instance, originally each entity held their own copy of the AI events relating to their nearest neighbor. Like neighbor A would remember if neighbor B committed some crime, and would view the event in different light based on their opinion on the player and that particular neighbor. When we first implemented this, it was brutally slow, increasing computation time by a huge factor. After various optimizations and what not, it no longer effects performance (welll... it adds a second or two).

I did some research into stability theory. I didn't realize how huge this particular field of research is; however, I still don't know how to approach this. There are countless different theorems and algorithms, all of which I imagine have varying complexities for a C++ implementation

Your best bet is to design the simulation with rubber-banding constraints so that the farther certain things get out of whack the less likely they are to proceed further in that direction. That's how many large scale decision systems are anyway.

Dave Mark - President and Lead Designer of Intrinsic Algorithm LLC
Professional consultant on game AI, mathematical modeling, simulation modeling
Co-founder and 10 year advisor of the GDC AI Summit
Author of the book, Behavioral Mathematics for Game AI
Blogs I write:
IA News - What's happening at IA | IA on AI - AI news and notes | Post-Play'em - Observations on AI of games I play

"Reducing the world to mathematical equations!"

This topic is closed to new replies.

Advertisement