# JSim Monte Carlo Analysis

## Preface

JSim Monte Carlo analysis provides a mechanism for analyzing parameter confidence limits through statistical analysis of multiple optimizations on noisy data sets.

Monte Carlo analysis is available in JSim releases 2.06 and above. This functionality is supported in applets and other remote server applications in JSim releases 2.07 and above.

Prerequisites:

- Introduction to JSim Optimization (required)
- Using JSim Multiprocessing (recommended)

Contents:

- Overview
- Graphs
- Reports
- Other Outputs
- Using Multiprocessing to Improve Performance
- Comments or Questions?

## Overview

JSim Monte Carlo analysis proceeds as follows. First, set up an parameter optimization as described here. Then, activate the "Config" subtab within the model's "Monte Carlo" tab. The parameter there control the generation of some number (50 by default) noisy data sets based on the datasets to match in the optimization configuration. When the Monte Carlo "Run" button is pressed the noisy datasets are generated and JSim runs an optimization on each. While the analysis proceeds and after it is finished, results from the analysis can be viewed in the "Graph" and "Report" subtabs within the "Monte Carlo" tab.

Parameters controlling the noisy dataset generation are as follows:

**# optimizations:**The number of optimization to run.**random seed:**A random seed of zero will generate a different noise profile each time Monte Carlo is run. Any other seed will generate a noise profile that will be the same each time Monte Carlo is run.**distribution:**Selects the noise distribution. "uniform" selects a uniform distribution between -1 and 1. "gaussian" selects a gaussian normal distribution with mean 0 and variance 1.**magnitude:**Selects the magnitude multiplier for the generated noise.**add method:**Select "proportional" to add the noise proportional to the magnitude of the sample. Select "additive" to add the noise to the sample without scaling. NOTE: In JSim 2.06 and below, substitute "scaled" for "proportional" and "fixed" for "additive".

## Graphs

The Monte Carlo "Graph" subtab provides two principal analysis graphs, as selected via the "View" menu. "Parameter Histograms" show the distribution of values of a single parameter as a histogram. "2-Parameter Scatter Plots" plots any two optimized parameters against each other, allowing the user to discern covariance visually.

For more detailed analysis of a single optimization, the user may select to view any of the 7 optimization plots available. These plots are identical to those available in the "Optimizer" tab.

## Reports

The Monte Carlo "Report" subtab provides two views, selected via the "View" menu. The "Summary" report provides a Monte Carlo statistical analysis, including the optimized parameter means, standard deviations and covariance matrix. The "Detail" report provides optimization report from a single optimization, which is useful when a more detailed analysis is required.

## Other Outputs

Once a Monte Carlo run is completed, you may store either the optimized parameter sets or the generated noisy data as project data sets using options in the "Config" subtab's "File" menu.

## Using Multiprocessing to Improve Performance

Depending upon the model, optimization configuration and # of optimization, a Monte Carlo analsis may require a large amount of processing time. If your computer has multiple processors available, this processing time can be significantly reduced. See Using JSim Multiprocessing for details.

Comments or Questions?[This page was last modified 06Jul12, 3:20 pm.]

**Model development and archiving support at
physiome.org provided by the following grants:** NIH U01HL122199 Analyzing the Cardiac Power Grid, 09/15/2015 - 05/31/2020, NIH/NIBIB BE08407 Software Integration,
JSim and SBW 6/1/09-5/31/13; NIH/NHLBI T15 HL88516-01 Modeling for Heart, Lung and Blood: From Cell to Organ,
4/1/07-3/31/11; NSF BES-0506477 Adaptive Multi-Scale Model Simulation,
8/15/05-7/31/08; NIH/NHLBI R01 HL073598 Core 3: 3D Imaging and Computer
Modeling of the Respiratory Tract, 9/1/04-8/31/09; as well as prior
support from NIH/NCRR P41 RR01243 Simulation Resource in Circulatory Mass
Transport and Exchange, 12/1/1980-11/30/01 and NIH/NIBIB R01 EB001973
JSim: A Simulation Analysis Platform, 3/1/02-2/28/07.