5

I'm very limited in my JS and even mathematics knowledge for that matter so I turn to you. I'm using a site linked here to find annual population growth rates for individual Nigerian states. When you click on a state, say Abia, it will give you the annual growth rate. I'm trying to figure out the exact formula that they're using to produce said growth rates. Here is the .js file that containing the code to do this. I believe the block we want is this:

cp.data.computeAnnualChange=function(a,b,c,d){
   if(!a||!b)return null;a=this.dateDiffInYears(a,b);
   return 0<c&&0<a&&0<d?Math.round(1E4*(Math.exp(Math.log(d/c)/a)-1))/100:null};
   cp.data.INT_MODE="i";

Some context: The formula is supposed to take the population of a state from 1991 and the population from 2006 and provide you with the annual rate of growth. I recognize that basic equation on line 4, it's a geometric growth rate. I can make that in excel, but when I do the number I come up with is about .13 percent off, which is significant. My ultimate goal is to make this into a formula I can use in excel.

4

1 回答 1

1

由于有人的评论帮助我解决了这个问题,因此关闭了这个问题。

基本上,我在原始问题中发布的公式是正确的,只是我对数据范围不够精确。两次人口普查相隔 14.32 年,而我只使用 14 年。

正确的公式是 (EXP((LN(pn/p0)/14.32))-1) 其中 pn 和 p0 分别是最新和最旧的人口普查。

于 2013-07-25T02:21:13.133 回答