The current compute.growth_rate assumes that all variables have a positive, non-zero value in the first year available in the dataframe. For variables that are initially 0, but begin to increase at some point within the analyzed period, the following error is raised:
ValueError: Cannot compute growth rate when timeseries crosses 0:
We should probably support growth rate calculations where growth starts mid-period. I'll try to tackle this, but also wanted to flag here.
Just keep in mind that the growth rate from 0 to any positive value is infinite. This is why I opted for the "safe" approach in the first implementation.
The current
compute.growth_rate
assumes that all variables have a positive, non-zero value in the first year available in the dataframe. For variables that are initially 0, but begin to increase at some point within the analyzed period, the following error is raised:We should probably support growth rate calculations where growth starts mid-period. I'll try to tackle this, but also wanted to flag here.