Pages

10/18/2014

Calculating the past growth rate

I want to be able to determine the annual growth rate of data in a directory structure. I know it was created at a certain date and only "new" data was written there -- nothing was migrated from another directory structure.


Mathematically
the total $lastyear would be  $now  / (1 + $growthrate)
so the total  $pastyear $num years ago would be  $now  / (1 + $growthrate)^$num  .
but I am not sure if that would work all the way back to the first year when the total was 0 (if I use 1 GB to approximate zero, especially if the number of years is short, for example 2-3)


Solving for $growthrate:


    $pastyear = $now / ((1 + $growthrate)^$num)


    $pastyear * ((1 + $growthrate)^$num) = $now


    ((1 + $growthrate)^$num) = $now / $pastyear


    1 + $growthrate = ($now / $pastyear)^(1/$num)


    $growthrate = (($now / $pastyear)^(1/$num)) - 1


looking at the above if the $pastyear is very small to approximate zero and $num is pretty small this looks like it will be much bigger than is reasonable.


Subtly
For this specific purpose I could attempt to take a file listing of all the files in the directory structure.  Using Excel for instance:
- import the file listing above, use text to columns to split into fields, hide or delete all but date & file size
- create a 3rd column in between with formula calculating just the year of the date
- sort them by year newest to oldest
- group by year & subtotal the file size
this will tell me how much was there the first year
**when I ignore "growth" during the first year and use the amount at the end of the first year in the above formula it seems to be much more reasonable.

No comments: