# How to model whether or not a city is thriving?

I'm working on a concept for a game that requires some statistical inference and I'm not sure how to go about it. My issue is I'm trying to come up with a way to calculate if a city (in the game) could evolve into a thriving city.

I have a bunch of rules that rate different factors of the city like health quality, distance to the coast, population growth etc and I need to boil all to these independent scales into a single probability. At the moment I'm averaging all of the numbers, but I'm sure there's a better way about it. I also need to calculate a degree of confidence.

I've tried searching for a solution in books but they all cover simplistic scenarios with only one variable.

I hope someone could point me to the right direction.

Thanks!

EDIT 1: Since this is a game, I'm just using a few variables to decide if a city is thriving. Also since it's a realtime problem I cannot use stat methods that are based on training sets. I do not have a math background, so this is what I've understood from my research, so please feel free to correct me if any of my assumptions are incorrect.

-
Take a look at multiple logistic regression. – Jonathan Christensen Jan 12 '13 at 18:21
I think this is quite a complex problem. The answer will depend on what you are willing to assume and what data you have. Do you have a database of cities that are thriving vs. not, and past values of the variables you have? You could consider logistic regression, but, since games are usually turn based, you might want to look at some sort of discrete time growth model. In addition, it might not be good to assume that cities are either thriving or not; it might be a continuum. – Peter Flom Jan 12 '13 at 22:30
Effectively, you are playing "God" here. i.e. your own rules decide what the definition of "thriving" is. Ergo, it is an inward looking model. Take an average, median, sum, etc. whatever metric you choose. I don't think there's any way to decide if that is right or wrong. – curious_cat Mar 14 '13 at 9:46

It sounds like you don't have a dataset which matches your explanatory variables (close to coast, etc) to your dependant variable (whether or not the city will thrive).

This means you do not have a supervised learning problem.

A simple solution to your problem is to have cities evolve by some basic rules.

For example:

Lets say that you have the 3 variables health quality, distance to the coast and population.

The rules could be:

1. Distance to the coast increases health quality.
2. Health quality increases population growth.
3. Having a high population decreases health quality.

With specific numbers, these rules provide a transition function.

Then pick some initial values and iterate using a transition function. After a few thousand iterations, the values of population, money, trade, etc would let you determine whether or not a city is thriving.

This is basically setting up a bunch of differential equations and trying to find a steady state. Its kind of a complicated predator prey situation.

-
cacba, you've got it right. I do not have a training set and it's not a supervised training problem. As of now I do have the rules implemented and I trigger different portions of my game based on the independent variables. But as stated, overall the AI is not responsive as the thriving value is inaccurate. I do not have a math background, do you know any examples that I could follow for the predator prey implementation? – webber Jan 13 '13 at 1:45