Home / Monte Carlo / Model Building / Correlations
Correlations¶
Marked inputs are drawn independently unless you say otherwise. This dialog is where you say otherwise: which inputs move together, how strongly, and in what shape.
QXL Monte Carlo > Design > Correlations
The header reads:
Define, view, change or delete the correlations between marked inputs.
What a correlation is here¶
A correlation is a named group of marked inputs with a rule for how they move together. It is stored in the workbook rather than in a cell, so it survives alongside the markings and is listed whenever the dialog is opened.
Three rules hold for every correlation:
- It holds at least two inputs. A group of one is not a relationship.
- It holds at most ten inputs.
- An input belongs to at most one correlation. An input already in another group appears in the checklist greyed, with the group that holds it named beside it.
The four families¶
The shape of the relationship is chosen from a dropdown called Family. Each family carries a one-line description beside the dropdown.
| Family | Description on screen | What you supply |
|---|---|---|
| Gaussian | Dependence is spread evenly over the whole range of values; jointly extreme values are no more likely than the middle suggests. | a correlation matrix |
| Student-t | Like the Gaussian, with jointly extreme values more likely in both tails; fewer degrees of freedom make them more likely still. | a correlation matrix and a degrees of freedom |
| Clayton | Dependence is strongest at low values: low values of the inputs occur together more than high values do. | one strength number, theta |
| Gumbel | Dependence is strongest at high values: high values of the inputs occur together more than low values do. | one strength number, theta |
The two matrix families let each pair of inputs have its own strength. The two theta families use one number covering the whole group, and add a per-input Reflected setting that turns that input's relationship the other way.
Each input keeps its own distribution whatever family is chosen. A correlation changes which values of the inputs turn up together; it does not change what values each input can take, or how often it takes them.
The matrix holds rank correlations, and only rank correlations¶
The heading above the grid says so:
Rank correlation matrix (Spearman)
The number you type is Spearman's rank correlation coefficient, not Pearson's. It is the correlation of the percentile positions of the two inputs, not of their values. Nowhere in this dialog do you enter a Pearson product-moment correlation, and there is no setting that changes that.
That is the right quantity to ask for here, and the reason is worth a sentence. Turning a percentile into a value of the input's own distribution is a monotone map, and a monotone map leaves percentile positions alone. So a rank correlation survives that step unchanged while a Pearson correlation does not. Ask for a rank correlation of 0.6 and the simulated inputs come back at a rank correlation of 0.6 whatever distributions they carry. Ask a Pearson question of the same pair and the answer would depend on which distributions you had marked.
The scale on which the engine works internally is not this one, and is not shown or entered anywhere. Math Details gives the exact relation between the two, and the one number a reader can check.
Where a number of exactly plus or minus one is allowed¶
A correlation of exactly \(+1\) or \(-1\) is accepted. It means the two inputs always land at the same percentile, or always at opposite percentiles, which is a perfectly good joint distribution and not the same thing as duplicating an input: an input tied at \(+1\) to another with a different distribution still has its own distribution, matched percentile for percentile.
When the numbers cannot all be true at once¶
A matrix can describe relationships no real data could have. If A and B move together strongly and B and C move together strongly, A and C cannot move strongly in opposition; the arithmetic will not allow it. A matrix like that is refused on Save correlation:
Correlation group 1: The correlations are mathematically inconsistent in that the matrix is not positive semi-definite.
When the matrix can be repaired, that sentence is followed by an offer:
Quantum XL can replace these entries with the nearest correlation matrix that is mathematically consistent. The replacement values are placed in the grid for you to review before saving.
Accepting it puts the repaired numbers in the grid and saves nothing. You look at them, and press Save correlation again if you want to keep them. Declining leaves your entries exactly as they were.
The details of the repair are on Math Details.
A discrete input cannot reach the requested correlation¶
When any ticked input has a discrete distribution the dialog says so:
Name is discrete. A correlated discrete input will not reach the requested correlation.
This is a statement about arithmetic rather than a refusal, and the correlation still saves. A discrete input takes a handful of values, so the number of distinct percentile positions it can occupy is limited, and a rank correlation computed over those positions cannot land on an arbitrary target. The dependence is applied; the achieved figure falls short of the requested one.
What the run does with it¶
The correlation is applied while each trial's values are drawn, before any of them reaches the model, so it is carried by the simulation engine and by both optimizer engines. A group whose rule amounts to no dependence at all, an identity matrix or a Gumbel theta of exactly 1, is skipped entirely, and the run reproduces an uncorrelated run exactly.
Correlated inputs also change how the results are attributed, and the choice of attribution method matters once a correlation exists. Of the three Percent Contribution methods, LMG is the one whose attribution stays well defined when the inputs are correlated; Spearman's Method assumes they are independent, and the Type III figures leave the variance two correlated inputs hold in common credited to neither of them, reporting it as Shared Variation instead.
Copying a marked cell that is in a correlation¶
A correlation is between two inputs, so copying only one of them cannot carry it. The paste reports:
The input Name is correlated. The pasted copy is not.
See Also¶
- How-To
- Options
- Math Details
- Mark Input, which is where an input gets its distribution
- Supported Distributions, which says which distributions are discrete
- Percent Contribution