The Stochastic element has an advanced option to be correlated to either its previous values or to values of another Stochastic element.
Correlation input fields can be found under the More button. 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.
The Autocorrelation (correlation to itself) option is available when values are "Resampled." The element can be correlated to another element when it is set to “Sampled once.” The correlation coefficient varies between 1 and -1, and as it becomes closer to 1 (or -1), the correlation becomes stronger.
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.
The autocorrelation factor can be dynamic so that you can simulate a system that starts out very random from one point in time to the next and gradually becomes more correlated to the value sampled on each successive time point.
Defining a Correlation Matrix
You can specify correlations between members of the Stochastic or History Generator vector via a correlation matrix. A correlation matrix specifies the correlations between variables, and generally has the following form:
Note that by definition, a correlation matrix is symmetric around its diagonal (since the cross diagonal terms define the same correlation coefficient). The plot below shows how all vector items are correlated according to the correlation matrix.
By default, all off-diagonal correlation coefficients are zero. The matrix is symmetrical, so you need only define one of the cross-diagonal terms. The value represents a rank correlation coefficient, and must vary between -1 and 1. It must be a number (i.e., you cannot specify a link).
To Open the Model File:
- Start GoldSim
- Click on the File and select Open Example...
- Browse to General Examples --> Stochastic
- Select the file called Correlation.gsm
Please sign in to leave a comment.