Coding of models

7 views
Skip to first unread message

Rajesh Kasturirangan

unread,
Mar 3, 2012, 1:53:36 AM3/3/12
to bangalore-mo...@googlegroups.com
I am repeating an earlier email as a separate thread so that people can start pitching in.

The task is to get one model fully fleshed out, while working on a coding framework for model thinking. If we start with the enrollment model, which I think is a good choice, our progress should adopt the following eight fold path:

  1. State plausible assumptions in explicit (including mathematical) prose.
  2. Agree upon a programming framework - with tutorials from Sudhir and others. 
  3. See if one Page's models is a good model for the problem. 
  4. Code the assumptions from 1 above in the model chosen in 2 above.
  5. Run and visualize results. 
  6. Make model realistic by inputting real world data. 
  7. Refine assumptions if needed. 
  8. Choose a different model if needed.
If we can get these eight done, we will have a flying start to the ++ part of the Stanford ++. 

In the meantime, in parallel, it would be good to start implementing 2-3 above systematically, i..e, choose a programming framework (Python is good, I think) and start implementing all of Page's models as Python programs and developing a GUI. 

Rajesh

Sudhir P

unread,
Mar 3, 2012, 2:19:19 AM3/3/12
to bangalore-mo...@googlegroups.com
A note on the choice of the coding language:

Instead of using python, if we use a web based language, we can actually host it on a website and let the world play around with it! If we are building a generic model-simulation toolkit, we are just reinventing netlogo in python. If we are building a model specific to the problem in python, it still makes sense

I suggest using coffee-script, which is a remix of javascript, and is very python-ish in syntax. The only thing you'll miss out on is a) speed b) lots awesome built in libraries for the math, like matrices etc. But what you get in return: True platform independance. It will work on anything that has a modern web browser. On your mac, linux, windows, or even a smartphone. And it can be hosted on a website without needing downloads or installs.

It might still be useful to code in 'both'! Python is still far more easier for the programmer for quick and easy stuff. But is a bit annoying to code the GUI. So a workflow, where we test out the math first in python, and then move on to coffeescript so that the 'poets' can play with the model, without needing to touch the code!

-sud

Rajesh Kasturirangan

unread,
Mar 3, 2012, 3:15:56 AM3/3/12
to bangalore-mo...@googlegroups.com
It might still be useful to code in 'both'! Python is still far more easier for the programmer for quick and easy stuff. But is a bit annoying to code the GUI. So a workflow, where we test out the math first in python, and then move on to coffeescript so that the 'poets' can play with the model, without needing to touch the code!


Even with all the extra work, we should shoot for both. A python sandbox will help the programmers test out ideas and the GUI will help the poets. The combination will be priceless.  

Sudhir P

unread,
Mar 3, 2012, 3:18:51 AM3/3/12
to bangalore-mo...@googlegroups.com
Ok. for Part 1 of the guideline (State plausible assumptions in explicit (including mathematical) prose.)

Here is my mental model of the model:
parameters:
- Job openings available at each age. Different in urban and rural scenarios
- probability of getting a particular job
- education level required for each job
- gain from learning an extra year (returns could be illegal: i.e. if u get a higher dowry if u educate the kid more, then it is still a valid gain in the model. And there could be child marriage as well)
- immediate gain (free meals, free cycle etc, that comes from different policies)
- immediate monetary requirement (essentially level of poverty)

One can make a game tree like:

1st std
    |-->(drop out)
   V 
2nd std
   |--> (drop out)
  V
.......

And fill out the net 'cost' of each node based on the parameters above

MG Subramanian

unread,
Mar 3, 2012, 4:01:05 AM3/3/12
to bangalore-mo...@googlegroups.com
Assumptions

1.The natural state of a child in the schoolgoing age say 5-16* is to be enrolled in a school or equivalent education space
 (Note; The state of being enrolled must be clearly defined.We should expect to find cases of partial enrollment(heavy absenteesim), fake enrollment that may arise out of perverse incentives in the educational governance system)

* Define this precisely wrt census of planning commision definitions to have compatibility with public data sources.
* Pay attention to how the late joiners or mid school joiners are to be treated in the model.

2. If the child is not enrolled  it is because one  or more of specific reasons causing the child to drop out.( For modelling purposes a child that does not enter school at all  can be considered an "ab initio" drop out.)
    
Some reasons for dropping out or "not being enrolled" not in any implied order of siginifcance are

2.1. Availability of school services
2.1.1. Non avaiiability of a school within "convenient" distance.
2.1.2  Available school has no age appropriate service.
2.1.3. Climate compatibility of the service available

2.2. Termination

2.2.1. Socially induced
2.2.1.1.Gender issues
2.2.1.2.Other social issues ( casteism or other local issues)
2.2.1.3. Discontinuity of incentives (like midday meals)

2.2.2.Disabling  Personal circumstances

2.2.3. Parental choice

2.2.4. Personal choice

2.2.4.1 Perception low or diminishing returns


This list is no doubt not exhaustive. But upto 2.2.3 the factors are entirely originate in infrastrucure or community. Thus for example if an infrastruture such as road density per 1000 sq Km can be modelled into it. Once we agree on the causal structure that we are inevestigating economic data bases can be be couple into the model.

Two related intriguing problems that strike me. They are "events" of importance and not causes. I have no judgement on ther significance in the educational life cycle

 * If a child misses enrolling into a school at the right age what are the chances it will ever enroll? (Is there an designable optimum points of reentry?)

*  If a child drops out for whatever reasons beyond its or its families' control what are the chances it wil reenroll? What does it take for reenrollment?

Pasting this in the wiki
.





On Sat, Mar 3, 2012 at 12:23 PM, Rajesh Kasturirangan <rkas...@gmail.com> wrote:

D KALYANARAMAN

unread,
Mar 3, 2012, 5:45:08 AM3/3/12
to bangalore-mo...@googlegroups.com

Assumption 1 : The parent is the decision maker to decide whether or not  send the child to school.


This gives rise to the following possibilities:

1.0 The parent wants to send/continue sending the child to school

1.1 The parent wants to but cannot

1.2. The parent wants to and does.

2.0 The parent does not want to send/continue sending the child to school


There would be potential reasons (perhaps nested in a causes-effect relationship) for each of these three possibilities.


The reasons can be social or economic. The reasons that sound even remotely plausible, given the expertise of (everyone else in) the group, can be worked in as assumptions into the model.


I would have these as the start points. In my mind, community issues are the result of aggregation and infrastructural issues are part of what interventions will work and therefore should be outputs of the model. 


Just my two bits.


regards

kalyanaraman

--
Regards

Kalyanaraman

MG Subramanian

unread,
Mar 3, 2012, 6:05:30 AM3/3/12
to bangalore-mo...@googlegroups.com
break out 1.1 and 1.2 into a few typical cases to give a flavour

Sudhir P

unread,
Mar 3, 2012, 6:13:04 AM3/3/12
to bangalore-mo...@googlegroups.com
On Sat, Mar 3, 2012 at 4:15 PM, D KALYANARAMAN <dkalya...@gmail.com> wrote:

Assumption 1 : The parent is the decision maker to decide whether or not  send the child to school.


This gives rise to the following possibilities:

1.0 The parent wants to send/continue sending the child to school

1.1 The parent wants to but cannot

1.2. The parent wants to and does.

2.0 The parent does not want to send/continue sending the child to school



Sometimes, a students' decision can indirectly change decisions about the enrollment. If the kid is disinterested and starts performing poorly, the parents may decide to not send the kid to school in monetarily tight situations. I dont know how important this factor is in reality. But i have seen it happen with my school classmates.

D KALYANARAMAN

unread,
Mar 3, 2012, 7:00:55 AM3/3/12
to bangalore-mo...@googlegroups.com

quote 
In my mind, community issues are the result of aggregation and infrastructural issues are part of what interventions will work and therefore should be outputs of the model.
Unquote

A little bit of sloppy thinking/writing on my part. These could be inputs as well as out puts

1.1 would point to infrastructural, economic and perhaps even social limitations. These would typically be the 'low hanging fruit' that should be looked at in terms of interventions in the short term. In fact, in the aggregate, these may have a cascading positive effect.
example : too poor, school far away etc.

random thoughts:

1.A random thought that comes to my mind: what is the correlation between level of education, academic performance and jobs? Is there data?

2. Another thing that i heard from the group has been in my mind for a while. The marked preference for army jobs. Army is certainly a large employer. Is it that less 'influence' is required to get army jobs? Is it that the army is Ok with 'lower' academic standards? Are there other psychological factors at work here? (Picture if you will, a pattalaththukkaran (armyman) returning home for a short time -- absence having made the heart fonder -- bringing gifts) 

On the other hand the govt (here I include national, state and municipal) is also possibly a large employer. Why is there not a preference for 'govt' jobs?Or is there?What about the police? is that part of people's aspirations?

kalyan?

PS: (I have so many questions that the question mark even got appended after my name)


 

--
Regards

Kalyanaraman

D KALYANARAMAN

unread,
Mar 3, 2012, 7:08:45 AM3/3/12
to bangalore-mo...@googlegroups.com
That too should then be factored.
kalyan
--
Regards

Kalyanaraman

MG Subramanian

unread,
Mar 3, 2012, 8:31:51 AM3/3/12
to bangalore-mo...@googlegroups.com

Ok..

* One of the thoughts behind explicitly providing for social factors is the diversity that prevails in our country regarding issues the education of girl children, or the felt need to use the boys in agriculture and other social preferences on job types " got to be in the army" "or got to do "just" well enough to get a govt job". Each district may have subtly different parameter values for this. Attitudes like this, I suspect are have highly local context- driven by shared histories of a geography. Look at this fascinating mosaic of literacy map of India.(Source Wikipedia) By the way there are very rich references to potential data sources in  

File:India literacy rate map en.svg



* If we get to the granularity of a district, hopefully we should also find interesting islands- that have parameters well contrasted from each of it neighbours.

-ganu

naresh shah

unread,
Mar 3, 2012, 9:40:17 AM3/3/12
to bangalore-mo...@googlegroups.com
I'll try to help out where I can. Definitely interested. 

It should be relatively simple to code models which are well specified. I've coded models in AI class before.

-Naresh

Janani Subramanian

unread,
Mar 3, 2012, 10:20:42 AM3/3/12
to bangalore-mo...@googlegroups.com
ok. beginning to get a little confused about which of the email threads this post belongs to.
but -

I imagine, ultimately, our model must produce a curve a like this.

(or a more comprehensive acceptable curve if we can find one).

If we can get it to do this, then we can look at appropriate types of interventions that can move the curve to where we want.

If everyone agrees, that this is what our model must be able to recreate, I'll add it to the wiki as a "modeling goal"?

Janani
--
'The time has come,' the Walrus said,
  'To talk of many things:
Of shoes -- and ships -- and sealing wax --
  Of cabbages -- and kings --
And why the sea is boiling hot --
  And whether pigs have wings.'

MG Subramanian

unread,
Mar 3, 2012, 10:33:38 AM3/3/12
to bangalore-mo...@googlegroups.com
ever the conservative, always alive for an improvement around the corner, I'd go with "provisional modelling goal"

-ganu
Reply all
Reply to author
Forward
0 new messages