Please enable JavaScript to view this site.

The Stochastic Simulations page provides tools you can use to generate distributions of input values for statistical and sensitivity analysis. For example, you could explore how uncertainty in the installation cost of one or more system components might affect a project's net present value and levelized cost of energy (LCOE) over the project life.

Click Stochastic in the lower left corner of the main window to display the Stochastic Simulations page:

SS_MainWindow-StochasticButton

SAM uses the Latin Hypercube Sampling (LHS) and STEPWISE packages from Sandia National Laboratories to generate distributions for stochastic simulations. For information about these packages, see:

Wyss, G; Jorgensen, K. (1998). "A User's Guide To LHS: Sandia's Latin Hypercube Sampling Software." Sandia National Laboratories. SAND98-0210. 140 pp. (PDF 15 MB)

Helton, J.; Davis, F.; (2000). "Sampling-Based Methods for Uncertainty and Sensitivity Analysis." SAND99-2240. 121 pp. (PDF 5 MB)

The LHS package is hosted on Sandia's Dakota platform https://dakota.sandia.gov/content/packages/lhs.

For the stochastic simulation regression results, SAM uses the STEPWISE package also hosted on Dakota at https://dakota.sandia.gov/content/packages/stepwise.

SAM's LK scripting language includes LHS functions so you can create input distributions from your LK scripts. See the LK samples on the SAM GitHub.com repository for an example.

For a video demonstration of stochastic simulations in SAM, see Parametric and Statistical Analysis in SAM.

To run stochastic simulations:

1.For Input variables, click Add to display a list of available input variables.

2.Check the variables in the list that you want to assign a distribution of values and click OK. You can choose one or more variables.

3.For each variable in the list of stochastic input variables, either double-click the variable name, or click the variable and then click Edit.

4.Choose a distribution, enter parameter values for the distribution and click OK.

For example, if you choose a Normal distribution, enter a mean value for the input and a standard deviation. SAM shows the variable's name and its value from the SAM inputs for reference.

5.If you chose more than one variable and want to assign a correlation between two of those variables, click Add under Correlations and choose a pair of variables to correlate with a correlation value between -1 and 1.

6.Under Outputs, click Add to choose the output variables for the stochastic simulations. For example, if you want to see how the net present value varies for a given distribution of installation costs, choose the net present value output variable.

7.Click Run simulations to generate a table of input values based on the distributions you defined and a table of results corresponding to the inputs along with the coefficient of determination R² and Beta coefficient ß for each output.

Notes.
 
When you click Run simulations after changing inputs, correlations, or outputs, SAM automatically generates a new set of samples and displays them in the Stochastic Input Vectors window.
 
You can click Compute samples to generate a new set of samples based on the same inputs and correlations. When you click Run simulations after generating samples, SAM runs the simulations without regenerating the samples so the results will match the samples you generated.
 
If you run stochastic simulations after closing the Stochastic Input Vectors window without changing the inputs, correlations, or outputs, the results are based on the samples that were in the closed window. SAM only generates new samples when you change the inputs, correlations, or outputs or generate a new set of samples.
 
Stochastic simulation inputs, simulations and results are separate from the case simulation and results that you get by clicking the Simulate button.

Tips for Exporting Stochastic Simulation Data

SAM displays stochastic simulation inputs and outputs in separate tables, which makes it difficult to interpret the results. There are two ways to work around this limitation. You can use Show Inputs to see all of the inputs for a given row in the outputs table, or you can copy and paste data from the inputs and outputs table to a spreadsheet or text file.

To use Show Inputs to display all inputs for a row in the outputs table:

1.Click Run simulations to generate a table of outputs.

2.Right-click the row heading for the row whose inputs you want to see, and click Show inputs. For example, here we right-clicked the row heading "4" to show inputs corresponding to the results in Row 4:

SS_Stochastic-ShowInputs
 

This opens the inputs browser so you can see all of the inputs used to generate the results. You can use the Export functions of the inputs browser to export the data to a CSV file or Excel (Windows only).

To copy and paste data from the inputs and outputs table to a spreadsheet or text file:

1.Click Run simulations to generate tables of stochastic inputs and outputs.

2.Click the cell above the row headers and to the left of the column headers to select the entire table. (You can click a column or row header to select a single column or row instead of the entire table. (Selecting more than one column or row header only selects a single column or row in spite of the highlighted cells.)

SS_Stochastic-SelectInputs

3.Press Ctrl-C (Command-C on a Mac) to copy the selected table

4.In your spreadsheet or text file, press Ctrl-V (Command-V) to paste the table. SAM omits column headings, so you will have to type those by hand.

5.Repeat this process with the stochastic results table to copy and paste the data.

System Advisor Model (SAM) Help © National Renewable Energy Laboratory

  

Keyboard Navigation

F7 for caret browsing
Hold ALT and press letter

This Info: ALT+q
Page Header: ALT+h
Topic Header: ALT+t
Topic Body: ALT+b
Contents: ALT+c
Search: ALT+s
Exit Menu/Up: ESC