All entries for August 2010

August 27, 2010

Week of unproductivity

Not surprisingly, this past week has been rather unproductive.

2 days gone to getting ready for and flying itself. Add in dinners, general enjoyment of being back home, going out and you have not much work done.

I mentioned distance-based fares. So far I've not been taking notice of it. Public transport is cheap when it's half or less than half of what one pays in London or Coventry. So is eating at restaurants - 30 dollars (about 14 pounds) at a good Japanese restaurant is not too bad!

I've left some simulations to run but for some reason the one i started on last Friday aborted itself, and the restart on Tuesday morning still has yet to finish a full simulation.

Now to wait.

August 17, 2010

Distance–based fares

Not related to my project, but of some academic interest IMO.

Original Press Release

Latest News article

Something that I've been following somewhat with interest, mainly because it affects my family and I directly! Also a good distraction as I'm now almost done with the URSS project.

There was a poll conducted in popular Singapore web forum. More than 80% of the people who answered the poll said they saw an increase in their transport fares. I am highly sceptical about this as the thread itself was rather politicised, so there exists a fair amount of bias.

However, I'm also highly sceptical of the figures touted by official sources. Foremost is, how did they arrive at the figure quoted?

Indeed, if you were supposed to give such a figure, how would you model and arrive at your answer? 

Next question: Given how people's travel patterns vary hugely, would quoting a % of people who would see a decrease in fares be meaningful?

From a policy perspective though, I will have to say that a move to distance-based fares is a good idea in principle. However, implementing it would be a bitch wouldn't it? There's also the question of bus routes being far from optimal - this is one of the main reasons why I dislike taking buses in general!

August 05, 2010

Simple simulation – Am I being naive?

Saw this sometime last week:

I will not rehash the main points, but the idea that popped up in my mind was, the patients will not necessarily all have the same mortality rate so what happens if we have a population of patients with different mortality rates?

I thought of possible ways to simulate this, but did not sit down to try it till today. Took me a while to figure out the relevant MATLAB commands and to structure it. Thanks goes to Leonard who gave me some ideas on how to write the code.

Simple assumptions of population of patients:

  • 10% have 6% mortality rate (difficult case)
  • 25% have 3% mortality rate (moderate case)
  • 65% have 1% mortality rate (simple case)

And then each hospital has a certain number of patients, which is fixed. How do the hospitals do?

For size 5:

Value    Count   Percent
     0     2653     26.53%
     1     5081     50.81%
     2     1946     19.46%
     3      301      3.01%
     4       19      0.19%

For size 10:

Value    Count   Percent
     0      541      5.41%
     1     2118     21.18%
     2     3224     32.24%
     3     2488     24.88%
     4     1188     11.88%
     5      370      3.70%
     6       67      0.67%
     7        4      0.04%

I did 10000 realizations on both.

Would it be fair then to say that a hospital with low number of patients can easily get a high mortality rate by just being unlucky?

MATLAB code for those interested below. I may have missed out something as I finished this in less than an hour!


function AAAsim(nRlz,sz)
% Simulation of AAA patients.
% Assume 2% mortality in general
% 3 Classes of Patients:
% 10% chance of patient with 6% mortality
% 25% chance of patient with 3% mortality
% 65% chance of patient with 1% mortality
% Assume each hospital has sz patients

n = nRlz * sz; %population size

index = randperm(n); % Randomly order patients

for i=1:nRlz
   a = sz*(nRlz - 1) + 1;
   b = sz*(nRlz);
   sample = index(a:b);
   sam_death = 0;
   for j=1:sz
       pt = sample(j);
       if(pt <=(0.1*n));
           prob = 0.6;
       elseif(pt > (0.1*n) && pt <=(0.35*n));
           prob = 0.3;
       else(pt > (0.35*n));
           prob = 0.1;
       ptdoa = binornd(1,prob); % Returns 0 if alive, 1 if dead
       sam_death = sam_death + ptdoa;
   deaths(i)= sam_death;
   fprintf('Iteration number %d completed.\n',i);

August 2010

Mo Tu We Th Fr Sa Su
Jul |  Today  | Sep
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31               

Search this blog



Most recent comments

  • Thanks a lot! That does seem to work better! by on this entry
  • You don't need to cat /dev/null into a file to empty it, you can just use > For example: me@mine:/tm… by Mike Willis on this entry

Blog archive

Not signed in
Sign in

Powered by BlogBuilder