Correlating Stochastic Elements

Frequently, parameters describing a system will be correlated (inter-dependent) to some extent. For example, if one were to plot frequency distributions of the height and the weight of the people in an office, there would likely be some degree of positive correlation between the two: taller people would generally also be heavier (although this correlation would not be perfect).

The degree of correlation can be measured using a correlation coefficient, which varies between 1 and -1. A correlation coefficient of 1 or -1 indicates perfect positive or negative correlation, respectively.

A positive correlation indicates that the parameters increase or decrease together. A negative correlation indicates that increasing one parameter decreases the other. A correlation coefficient of 0 indicates no correlation (the parameters are independent of each other).

The preferred method to represent a correlation is to explicitly model the cause of a dependency. For example, the height and weight of children are correlated primarily due to a common dependency on age (both increase with age). In such a situation, the best way to represent this correlation would be to explicitly define the mean and standard deviation of the height and the weight as functions of  the primary parameter causing the dependency (age).

In many cases, however, specifying such a dependency may be difficult. Therefore, GoldSim provides a mechanism to specify a statistical correlation.

To do so, you must use the Correlation section of the Stochastic dialog (accessed via the More button).  You will note that in that section, GoldSim provides three options for correlation:

None. This is the default. The Stochastic is not correlated.

Correlated to: This allows you to correlate one Stochastic to another Stochastic. You must specify the Element (it must be a Stochastic element), and the Value (the correlation factor). The Value represents a rank correlation coefficient. It must be a value between –1 and 1, inclusive (1 being a perfect positive correlation, and –1 being a perfect negative correlation). It can be entered as a number, a link or an expression.

The algorithm used to implement the correlations is described in Appendix B of the GoldSim User’s Guide.

   Note: If a Stochastic is correlated to a second Stochastic, and that second Stochastic is resampled, the correlated Stochastic will also automatically be resampled.

Percentile. This allows you to specify a percentile of the distribution.  For example, specifying 0.95 would return the 95% percentile.  Among other applications, by using this with multiple elements, you could force a particular correlation scheme. An important point should be noted: when the Correlation is specified in this way, the Stochastic is automatically resampled whenever the specified Percentile or any other input parameter for the distribution is changed.

GoldSim also allows you to autocorrelate a Stochastic element (i.e., correlate a Stochastic to its previously realized value). This is useful, for example, when you are sampling a Stochastic multiple times in a realization (e.g., once a month), and this month's value is correlated to last month's value.

In order to autocorrelate a Stochastic, you must first instruct GoldSim to resample the Stochastic (since autocorrelation only has meaning if a Stochastic is resampled).

After you do so, you will note that in the Correlation section of the Stochastic dialog, GoldSim provides two options for correlation:

None. This is the default. The Stochastic is not autocorrelated.

Autocorrelated. In this case, the Element is autocorrelated (correlated to its previous value).  You must specify the Value (the correlation factor). The Value represents a rank correlation coefficient. It must be a value between –1 and 1, inclusive (1 being a perfect positive correlation, and –1 being a perfect negative correlation). It can be entered as a number, a link or an expression.

If you specify autocorrelation, GoldSim will correlate the next update (sample) of the Stochastic to the previous update of the Stochastic.  Hence, if you trigger the Stochastic to be sampled every day, it will correlate today’s value to yesterday’s value.

When using autocorrelation, it is important to remember that the correlation factor (Value) should actually be a function of the resampling period.  That is, if you resample every 1 minute, the Value should obviously be larger (closer to 1) than if you resample every day.  Therefore, when you define a correlation factor for autocorrelation, you should define it with the resampling period in mind. 

If you know the autocorrelation coefficient for one resampling period, you can compute it for a different sampling period using the following equation:

C2 = exp[ln(C1) * (DT2/DT1)]

where C1 is the coefficient for sampling period DT1, and C2 is the coefficient for sampling period DT2.  Note that if you are resampling every timestep (OnChanged Etime), and need to compute an appropriate value for C2, DT2 should be specified as Timestep_Length (as it may change during the simulation).

The above discussion relates to correlating Stochastics that are defined as scalars.  Stochastics can also be defined as vectors (arrays), and in that case, it is possible to specify a correlation matrix to define how the items of the vector are correlated. Stochastic vectors cannot be autocorrelated.  They can be correlated to other vectors (in which chase the correlation is term-by-term) or to scalars.

An example file which illustrates correlation of Stochastics (Correlation.gsm) is in the General Examples/Stochastic folder in your GoldSim directory (accessed by selecting File | Open Example... from the main menu).

Related Topics…

Learn more about: