Posted on February 15, 2013 @ 09:48:00 AM by Paul Meagher
In a previous blog, entitled including uncertainty in your business model, I laid the
groundwork as to how I proposed to integrate uncertainly into a business model. I proposed changing the $num_new_customers_per_month setting in the
business model implementation from a fixed value (e.g., $num_customers_per_month=10) to a new customer distribution setting that could vary and grow as the years go by in your business model.
We can store yearly settings for the "new customer distribution" in
the following data structure:
$ave_customers_per_month[1] = array(10, 5);
$ave_customers_per_month[2] = array(15, 5);
$ave_customers_per_month[3] = array(20, 5);
$ave_customers_per_month[4] = array(25, 5);
The way to parse this is that in the first year of the model the mean of the new customer distribution is 10 and the standard deviation is 5 (mu=10, sigma=5). In the second
year of the model, the mean will increase by 5 to 15, but the standard deviation will remain the same at 5 (mu=15, sigma=5). An so on, for each year that the
model projects to.
In order to utilize these settings, I decided I would integrate the PHP-based Probability Distributions Library, or PDL, that provides implementations of the major probability distributions. In this case, I needed the normal distibution and included it like so:
require_once '../PDL/NormalDistribution.php';
Then, before I started looping through each month in a particular year of the model, I initalized the new customer distribution like so (mean and standard deviation values are being passed into the NormalDistribution constructor call):
$new_customer_distribution = new NormalDistribution($ave_customers_per_month[$y][0], $ave_customers_per_month[$y][1]);
Finally, as each month passes in the business model, I generate a random number from the $new_customer_distribution and assign it to $num_customers_per_month .
$num_customers_per_month = round($new_customer_distribution->RNG());
Voilà, what used to be a fixed value on our business model (i.e, $num_customers_per_month=10 ), is now a quantity that varies each month according to the new customer distribution being sampled from for that year.
It is in this manner that the business model
incorporates uncertainty. Other variables in the model could also be turned into random variables instead of fixed quantities if you felt
it was important to add additional uncertainty to your business model.
Business Model Output
This business model output will differ from other model output that I displayed in previous blogs in two major ways.
First, you will see that the number of customers per month grows in an irregular manner. In the first year you might add 8 new customers one month, and 12
new customers the next month. If you refresh the page that displays this report, a new set of overall estimates of costs, reveneues, and profits will appear
due to the uncertaintly/randomness we have introduced. Indeed, it is critical that you do refresh the model many times to get a sense of the range of variability
you might get out of your business model. Look in particular at the variability in the overall estimates of costs, revenues, and profits. A business
model with uncertainty has the benefit that instead of generating only point estimates of your yearly costs, revenues, and profits, you can re-run
your model to generate range estimates of your yearly costs, revenues, and profits.
The second difference you will see in this model output is that the business model is profitable for the investor. To date, the investor did not recoup their investment of $50,000 after 3 years by offering 20 percent of the profits. In order for the investor to recoup their investment in a 3 year time frame, I steadily increase the expected number of customers per month for each year in the model from 10 to 25. I also offered the investor 50 percent of the ongoing profits. After three years, the investor makes $31,790.00 or a 64% return on investment (keep in mind that this return will change as you refresh the business model).
Without further ado, here is the business model output:
Year | Month | # Customers |
Revenues | Costs | Profits |
Company Profits | Investor Profits |
2013 |
2 |
12 |
$360.00 |
$1,120.00 |
-$760.00 |
-$760.00 |
$0.00 |
2013 |
3 |
28 |
$840.00 |
$1,280.00 |
-$440.00 |
-$440.00 |
$0.00 |
2013 |
4 |
46 |
$1,380.00 |
$1,460.00 |
-$80.00 |
-$80.00 |
$0.00 |
2013 |
5 |
61 |
$1,830.00 |
$1,610.00 |
$220.00 |
$110.00 |
$110.00 |
2013 |
6 |
66 |
$1,980.00 |
$1,660.00 |
$320.00 |
$160.00 |
$160.00 |
2013 |
7 |
80 |
$2,400.00 |
$1,800.00 |
$600.00 |
$300.00 |
$300.00 |
2013 |
8 |
88 |
$2,640.00 |
$1,880.00 |
$760.00 |
$380.00 |
$380.00 |
2013 |
9 |
102 |
$3,060.00 |
$2,020.00 |
$1,040.00 |
$520.00 |
$520.00 |
2013 |
10 |
115 |
$3,450.00 |
$2,150.00 |
$1,300.00 |
$650.00 |
$650.00 |
2013 |
11 |
127 |
$3,810.00 |
$2,270.00 |
$1,540.00 |
$770.00 |
$770.00 |
2013 |
12 |
137 |
$4,110.00 |
$2,370.00 |
$1,740.00 |
$870.00 |
$870.00 |
2013 Totals |
$25,860.00 |
$19,620.00 |
$6,240.00 |
$2,480.00 |
$3,760.00 |
2014 |
1 |
142 |
$4,260.00 |
$2,420.00 |
$1,840.00 |
$920.00 |
$920.00 |
2014 |
2 |
155 |
$4,650.00 |
$2,550.00 |
$2,100.00 |
$1,050.00 |
$1,050.00 |
2014 |
3 |
164 |
$4,920.00 |
$2,640.00 |
$2,280.00 |
$1,140.00 |
$1,140.00 |
2014 |
4 |
177 |
$5,310.00 |
$2,770.00 |
$2,540.00 |
$1,270.00 |
$1,270.00 |
2014 |
5 |
187 |
$5,610.00 |
$2,870.00 |
$2,740.00 |
$1,370.00 |
$1,370.00 |
2014 |
6 |
208 |
$6,240.00 |
$3,080.00 |
$3,160.00 |
$1,580.00 |
$1,580.00 |
2014 |
7 |
230 |
$6,900.00 |
$3,300.00 |
$3,600.00 |
$1,800.00 |
$1,800.00 |
2014 |
8 |
251 |
$7,530.00 |
$3,510.00 |
$4,020.00 |
$2,010.00 |
$2,010.00 |
2014 |
9 |
267 |
$8,010.00 |
$3,670.00 |
$4,340.00 |
$2,170.00 |
$2,170.00 |
2014 |
10 |
282 |
$8,460.00 |
$3,820.00 |
$4,640.00 |
$2,320.00 |
$2,320.00 |
2014 |
11 |
289 |
$8,670.00 |
$3,890.00 |
$4,780.00 |
$2,390.00 |
$2,390.00 |
2014 |
12 |
310 |
$9,300.00 |
$4,100.00 |
$5,200.00 |
$2,600.00 |
$2,600.00 |
2014 Totals |
$79,860.00 |
$38,620.00 |
$41,240.00 |
$20,620.00 |
$20,620.00 |
2015 |
1 |
333 |
$9,990.00 |
$4,330.00 |
$5,660.00 |
$2,830.00 |
$2,830.00 |
2015 |
2 |
350 |
$10,500.00 |
$4,500.00 |
$6,000.00 |
$3,000.00 |
$3,000.00 |
2015 |
3 |
367 |
$11,010.00 |
$4,670.00 |
$6,340.00 |
$3,170.00 |
$3,170.00 |
2015 |
4 |
391 |
$11,730.00 |
$4,910.00 |
$6,820.00 |
$3,410.00 |
$3,410.00 |
2015 |
5 |
412 |
$12,360.00 |
$5,120.00 |
$7,240.00 |
$3,620.00 |
$3,620.00 |
2015 |
6 |
428 |
$12,840.00 |
$5,280.00 |
$7,560.00 |
$3,780.00 |
$3,780.00 |
2015 |
7 |
441 |
$13,230.00 |
$5,410.00 |
$7,820.00 |
$3,910.00 |
$3,910.00 |
2015 |
8 |
468 |
$14,040.00 |
$5,680.00 |
$8,360.00 |
$4,180.00 |
$4,180.00 |
2015 |
9 |
487 |
$14,610.00 |
$5,870.00 |
$8,740.00 |
$4,370.00 |
$4,370.00 |
2015 |
10 |
511 |
$15,330.00 |
$6,110.00 |
$9,220.00 |
$4,610.00 |
$4,610.00 |
2015 |
11 |
535 |
$16,050.00 |
$6,350.00 |
$9,700.00 |
$4,850.00 |
$4,850.00 |
2015 |
12 |
548 |
$16,440.00 |
$6,480.00 |
$9,960.00 |
$4,980.00 |
$4,980.00 |
2015 Totals |
$158,130.00 |
$64,710.00 |
$93,420.00 |
$46,710.00 |
$46,710.00 |
2016 |
1 |
574 |
$17,220.00 |
$6,740.00 |
$10,480.00 |
$5,240.00 |
$5,240.00 |
2016 |
2 |
596 |
$17,880.00 |
$6,960.00 |
$10,920.00 |
$5,460.00 |
$5,460.00 |
2016 Totals |
$35,100.00 |
$13,700.00 |
$21,400.00 |
$10,700.00 |
$10,700.00 |
Overall Totals |
$298,950.00 |
$136,650.00 |
$162,300.00 |
$80,510.00 |
$81,790.00 |
The investor has recouped their $50,000.00 investment.
The investor has earned $31,790.00 in profits so far.
GitHub
If you want to run the latest business model which includes uncertainty, it will require a bit more setup work to get it to run. You need to download the Probability Distributions Library because the newest business model depends on that library now. I'm currently working on getting my https://github.com/mrdealflow Github account setup as a place where I can share code more easily and others can contribute.
I will let you know in a blog next week when everything is ready to go. Until then, here is the code for a business model that now includes uncertainty and a profitable outcome for an investor.
<?php /** * Prototypical business model involving the generation of monthly * revenue based upon the number of existing customers plus new * customers per month with each customer paying a monthly fixed fee. * Costs based upon monthly fee for servicing "rents" and a cost per * customer (variable cost) for providing the service to the customer. * * The involvement of an investor is assumed in this model. The * investor is represented with two variables. An "investment size" * variable and an "investor profit percentage" variable. * * Uncertaintyin the number of new customers per month is also * incorporated in this business model. * * @script: monthly_growth_with_uncertaintly.php * @author: Paul Meagher * @company: Dealflow Solutions Ltd. * @url: http://www.planetdealflow.ca * @version: 0.3 * @modified: Feb 15, 2013 * * Changelog: * + feb 11, 2013 - released * + feb 14, 2013 - add money_format.php fallback * + feb 14, 2013 - add uncertainty to nun new customers per month */
// get rid of inclusion warning error_reporting(0);
// Not all PHP setups implement the money_format function. Current version // of wampserver does not (www.wampserver.com) so must include a php // implementaiton of this function if (!function_exists('money_format')) include_once "utils/money_format.php";
require_once '../PDL/NormalDistribution.php';
// PART 1: CHANGE THESE SETTINGS
// Set number of years for your projections. $num_years = 3;
// Replace fixed variable // $num_new_customers_per_month = 10;
// With distibution settings per year $ave_customers_per_month[1] = array(10, 5); $ave_customers_per_month[2] = array(15, 5); $ave_customers_per_month[3] = array(20, 5); $ave_customers_per_month[4] = array(25, 5);
$monthly_fee_per_customer = 30; $monthly_cost_per_customer = 10;
// Cost of "rents" per month. $fixed_cost_per_month = 1000;
// Starting number of customers customers - default 0. $num_customers = 0;
// New variables added to model investor involvement $investment_size = 50000; $investor_profit_percentage = .50;
// Set money formatting according to a locale setting. setlocale(LC_MONETARY, 'en_CA');
// Starting month - defaults to current month. $start_month = date("n");
// PART 2: DO NOT CHANGE THESE INITIALIZATION SETTINGS
// setup year number to year date mapping for reporting purposes $year_num_to_year_date[1] = $next_year = date("Y"); for($n = 2; $n <= $num_years+1; $n++) { $next_year = $next_year + 1; $year_num_to_year_date[$n] = $next_year; }
// Zero the parameters we will be estimating $costs = array(); $revenues = array(); $profits = array(); $company_profits = array(); $investor_profits = array();
// Zero the accumulator variables $total_profits = 0; $total_costs = 0; $total_revenues = 0; $total_company_profits = 0; $total_investor_profits = 0;
// PART C: GENERATE REPORT PROVIDING ESTIMATES OF COST, REVENUES, & PROFITS
?>
<table border='1' cellpadding='5' cellspacing='0'> <thead> <tr> <th>Year</th><th>Month</th><th># Customers</th> <th>Revenues</th><th>Costs</th><th>Profits</th> <th>Company Profits</th><th>Investor Profits</th> </tr> </thead> <tbody> <?php if ($start_month == 1) $y_end = $num_years; else $y_end = $num_years + 1;
for($y=1; $y<=$y_end; $y++) {
if ($y == 1) $m = $start_month; else $m = 1;
$new_customer_distribution = new NormalDistribution($ave_customers_per_month[$y][0], $ave_customers_per_month[$y][1]);
for ($m; $m<=12; $m++) {
$num_customers_per_month = round($new_customer_distribution->RNG());
$num_customers = $num_customers + $num_customers_per_month;
$year_date = $year_num_to_year_date[$y];
if (($y == $y_end) AND ($m == ($start_month+1))) break; else { // The data structures don't have to be this complicated but they can // be used in downstream calculatios more easily in this format. $costs[$year_date][$m] = ($num_customers * $monthly_cost_per_customer) + $fixed_cost_per_month; $revenues[$year_date][$m] = $num_customers * $monthly_fee_per_customer; $profits[$year_date][$m] = $revenues[$year_date][$m] - $costs[$year_date][$m];
// Allocate perentages of the profit to the investor or the company // when profits are negative investor makes 0 and company takes // the loss. Could also allow both parties to assume the loss. if ($profits[$year_date][$m] < 0) { $investor_profits[$year_date][$m] = 0; $company_profits[$year_date][$m] = $profits[$year_date][$m]; } else { $investor_profits[$year_date][$m] = $profits[$year_date][$m] * $investor_profit_percentage; $company_profits[$year_date][$m] = $profits[$year_date][$m] * (1-$investor_profit_percentage); }
} ?> <tr> <td><?php echo $year_date ?></td> <td align='center'><?php echo $m ?></td> <td align='center'><?php echo $num_customers ?></td> <td align='right'><?php echo money_format('%n', $revenues[$year_date][$m]) ?></td> <td align='right'><?php echo money_format('%n', $costs[$year_date][$m]) ?></td> <td align='right'><?php echo money_format('%n', $profits[$year_date][$m]) ?></td> <td align='right'><?php echo money_format('%n', $company_profits[$year_date][$m]) ?></td> <td align='right'><?php echo money_format('%n', $investor_profits[$year_date][$m]) ?></td> </tr> <?php } $profits[$year_date]['total'] = array_sum($profits[$year_date]); $costs[$year_date]['total'] = array_sum($costs[$year_date]); $revenues[$year_date]['total'] = array_sum($revenues[$year_date]); $company_profits[$year_date]['total'] = array_sum($company_profits[$year_date]); $investor_profits[$year_date]['total'] = array_sum($investor_profits[$year_date]);
$total_profits += $profits[$year_date]['total']; $total_costs += $costs[$year_date]['total']; $total_revenues += $revenues[$year_date]['total']; $total_company_profits += $company_profits[$year_date]['total']; $total_investor_profits += $investor_profits[$year_date]['total']; ?> <tr> <th colspan='3' align='right'><?php echo $year_date." Totals"; ?></th> <td align='right'><?php echo money_format('%n', $revenues[$year_date]['total']); ?></td> <td align='right'><?php echo money_format('%n', $costs[$year_date]['total']); ?></td> <td align='right'><?php echo money_format('%n', $profits[$year_date]['total']); ?></td> <td align='right'><?php echo money_format('%n', $company_profits[$year_date]['total']); ?></td> <td align='right'><?php echo money_format('%n', $investor_profits[$year_date]['total']); ?></td> </tr> <?php } ?> <tr> <th colspan='3' align='right'><?php echo "Overall Totals"; ?></th> <td align='right'><?php echo money_format('%n', $total_revenues); ?></td> <td align='right'><?php echo money_format('%n', $total_costs); ?></td> <td align='right'><?php echo money_format('%n', $total_profits); ?></td> <td align='right'><?php echo money_format('%n', $total_company_profits); ?></td> <td align='right'><?php echo money_format('%n', $total_investor_profits); ?></td> </tr> </tbody> </table>
<?php $amount_owing = $investment_size - $total_investor_profits; if ($amount_owing > 0) { ?> <p> <b>The investor has not recouped their <?php echo money_format('%n', $investment_size) ?> investment yet. You still owe the investor <?php echo money_format('%n', $amount_owing) ?>.</b> </p> <?php } else { $profit_earned = $amount_owing * -1; ?> <p> <b>The investor has recouped their <?php echo money_format('%n', $investment_size) ?> investment. The investor has earned <?php echo money_format('%n', $profit_earned) ?> in profits so far.</b> </p> <?php } ?>
|