简体   繁体   中英

Calculate Bell Curve Values

In an MS Access 2007 app, which manages contracts and changes for large construction projects, I need to create a Bell Curve representing a Contract Value, over a time period.

For example, a $500m contract runs for, say, 40 months, and I need a Bell Curve that distributes the Contract Value over these 40 months. The idea is to present a starting point for cashflow projections during the life of the contract.

Using VBA, I had thought to create the 'monthly' values and store them in a temp table, for later use in a report chart. However, I'm stuck trying to work out an algorithm.

Any suggestions on how I might tackle this would be most appreciated.

You will need the =NORMSDIST() function borrowed from Excel as follows:

Public Function Normsdist(X As Double) As Double
Normsdist = Excel.WorksheetFunction.Normsdist(X)
End Function

Requires some knowledge of statistics to use this function to distribute a cash flow over x periods, assuming a standard-normal. I created an Excel sheet to demonstrate how this function is used and posted it here:

Normal Distribution of a cash flow sample .XLSX

If for some reason you hated the idea of using an Excel function, you can pull any statistics text or search for the formula that generates a series of normal values. In your case you want to distribute the cash flow over three standard deviations in each tail. So that's a total of six (6) standard deviations. To divide 40 months over 6 standard deviations it's 6/40 = 0.15 standard deviations each data point (month). Use a for/next/step or similar loop to generate that to a temporary table, as you suggested, and graph it with a column chart (as seen in the above Excel example). Will take just a little VBA coding to make this variable as to user-supplied number of months and total contract.

A standard-normal distribution has a mean of 0 and standard deviation of 1. If you want a flatter bell curve, you can use the NormDist function instead where you can specify the mean and st. dev.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM