# Stop Sum

### Introduction

The Stop Sum function is used to answer the following question:

how many samples need to be drawn randomly from a specified distribution to meet (or just exceed) a specific total?

The answer is in itself a distribution, from which we can generate random values.

To understand the use, consider the following example.

A company selling loan contracts wants to know how many contracts they wills sell next year. The company employs seven sales people and each of them works 230 days a year. The time to make a loan contract can be modelled by a Gamma(3,5) distribution shifted by 10.

The number of contracts that will be sold in one year by one sales person is then:

=VoseStopSum(VoseGammaObject(3,5,,VoseShift(10)),230)

To know the total number of contracts that will be sold next year by the company, we add 7 generated values from this function together.

This is shown in the example model   VoseStopSum.xls

### Window elements

In the Distribution field comes a univariate Distribution Object. This can be linked to the spreadsheet or chosen directly from the Select Distribution window, by clicking the appropriate button next to the field.

In the Total field comes the sum that needs to be met or just exceeded. This needs to be a positive real number.

In the Chart options region, the number of random samples to be drawn from the Stop Sum distribution can be chosen. By default this is 1000. This number needs to be larger than 100. It should be a positive integer.

In the Output Location field, you can specify where in the spreadsheet to insert the randomly sampled values of the Stop Sum distribution. These will be inserted upon pressing the OK button.

Two graphs are shown. With the M and C buttons, you can switch between viewing cumulative or normal (probability density/mass) graphs.

With the generate button you can generate a new set of random values of the Stop Sum distribution.

Above is the graph of the univariate Distribution object chosen in the Distribution field.

Below is the graph of the resulting Stop Sum distribution.

On the right of each graph, summary statistics (like the mean, standard deviation, percentiles...) are shown.

For explanations about other fields, buttons, graphs and summary statistics tables in this window, see

### Useful tips and tricks

The output of ModelRisk windows always corresponds to VoseFunctions (the functions ModelRisk adds to Excel) being entered into one or more spreadsheet cells.

You can always re-open the window for a ModelRisk function that is in a spreadsheet cell by using View Function. Select the spreadsheet cell and then select View Function from the ModelRisk menu/toolbar/ribbon.