Tutorials › Exam PA - Predictive Analytics › Dependence From Shared Time And Environment

Exam PA · Data Design and Study Structure · Tutorial 60 of 966

Dependence From Shared Time And Environment

Identify dependence caused by shared time or environment, quantify it with a simple model, and explain what it means for analysis.

Beginner 10 min read

What You'll Learn

  • Recognize when records share a date, event, or operating condition.
  • Distinguish conditional independence from dependence in the observed data.
  • Use a shared-effect model to calculate covariance and correlation.
  • Explain why treating dependent records as independent can understate uncertainty.
  • Identify when a data split should keep shared events together.

Why Shared Conditions Matter

Two records can be different rows and still reflect the same underlying circumstance. Claims from separate policyholders, for example, may be affected by the same storm. Sales recorded at different stores may respond to the same holiday period. Measurements from separate facilities may all be influenced by a shared temperature or system outage. When that common circumstance changes, several observations can move in the same direction.

This is a form of dependence: knowing something about one observation provides information about another. It does not mean that every pair of observations in the same month or event must be similar. The key question is whether they share an influence that has not been accounted for. If they do, treating every row as independent can make the amount of information in the data appear larger than it is.

Definition: Dependence from shared time or environment occurs when multiple observations are exposed to a common calendar period, event, or operating condition that affects their outcomes. A shared effect is a variable representing that common influence. Observations may be independent after conditioning on the shared effect, yet dependent when that effect is not observed or conditioned on.

A useful distinction is between the row and the circumstance behind the row. Two claims can belong to different policyholders, but both can arise during the same storm. Two measurements can come from different facilities, but both can be taken during the same period of unusually high demand. The observational units differ; the shared source of variation does not.

A Simple Model of a Shared Effect

For a quantitative outcome \(Y_{tj}\), let \(t\) identify a time period or event and \(j\) identify a record within it. Consider the model

$$ Y_{tj}=\mu+B_t+\varepsilon_{tj}. $$

Here, \(\mu\) is the overall mean, \(B_t\) is the shared effect for period \(t\), and \(\varepsilon_{tj}\) is the record-specific deviation. For the calculations below, assume that \(E[B_t]=0\), \(\operatorname{Var}(B_t)=\tau^2\), \(E[\varepsilon_{tj}]=0\), and \(\operatorname{Var}(\varepsilon_{tj})=\sigma^2\). Also assume the shared effects are independent across periods, the individual deviations are independent across records, and the two kinds of terms are mutually independent. These are modeling assumptions, not facts guaranteed by a common date or event.

Under these assumptions, two different records in the same period share \(B_t\). Records in different periods have independent shared effects. The covariance calculation makes the source of their association explicit.

$$ \begin{aligned} \operatorname{Var}(Y_{tj})&=\operatorname{Var}(B_t)+\operatorname{Var}(\varepsilon_{tj}) =\tau^2+\sigma^2,\\ \operatorname{Cov}(Y_{tj},Y_{tk})&=\operatorname{Cov}(B_t+\varepsilon_{tj},B_t+\varepsilon_{tk}) =\tau^2 \qquad (j\ne k),\\ \operatorname{Corr}(Y_{tj},Y_{tk})&=\frac{\tau^2}{\tau^2+\sigma^2}. \end{aligned} $$

The covariance result follows because the two records contain the same \(B_t\), while their separate deviations have zero covariance by assumption. The correlation is the shared variance divided by the total variance of one record. It is sometimes called the within-period correlation under this model. If \(\tau^2=0\), this particular source of dependence is absent. If \(\tau^2\) is large relative to \(\sigma^2\), records from the same period tend to be more alike.

The model also clarifies conditional independence. Once \(B_t\) is fixed, the only variation left in each record is its own \(\varepsilon_{tj}\). The model assumes those deviations are independent. Before \(B_t\) is known, however, observing a high value in one record suggests that the shared effect may be high, which in turn makes a high value in another same-period record more plausible.

Worked Example: Measuring Dependence Within a Storm

Method: represent the storm’s common influence as a shared effect, then calculate the covariance and correlation. Suppose a hypothetical insurer studies claim severity for different households affected by the same storm. In thousands of dollars, assume \(Y_{tj}=50+B_t+\varepsilon_{tj}\), with independent shared effects having mean 0 and variance 4, and independent record-specific deviations having mean 0 and variance 5. Assume the two components are independent.

Step 1: Find the variance of one claim. The overall mean is 50 thousand dollars. The variance is \(4+5=9\) in squared thousands of dollars.

Step 2: Find the covariance of two different claims from the same storm. Both claims contain the same \(B_t\), and their separate deviations are independent. Thus their covariance is the variance of the shared effect, \(4\) in squared thousands of dollars.

Step 3: Calculate the correlation. The two claims have the same variance, so their correlation is \(4/9=0.4444\), rounded to four decimal places. This is positive dependence: a storm effect that raises one claim’s expected severity also raises the other’s.

Check: The covariance is positive and smaller than the variance of either claim, as expected. The correlation is between 0 and 1. Common mistake avoided: different households do not imply independent outcomes when the households share the same storm.

Why Dependence Changes the Information in an Average

A frequent goal is to average observations. If the observations are positively dependent, an average usually contains less independent information than its row count suggests. To see why, suppose there are \(T\) independent periods and exactly \(m\) records per period, with the shared-effect model and assumptions defined above. The grand mean is

$$ \bar{Y}=\frac{1}{Tm}\sum_{t=1}^{T}\sum_{j=1}^{m}Y_{tj}. $$

Substituting the model separates this average into an average of shared effects and an average of individual deviations:

$$ \bar{Y}=\mu+\frac{1}{T}\sum_{t=1}^{T}B_t+ \frac{1}{Tm}\sum_{t=1}^{T}\sum_{j=1}^{m}\varepsilon_{tj}. $$

The shared effect for a period appears \(m\) times in the original sum. After division by \(Tm\), its contribution is \(B_t/T\). Independence across periods makes the variance of those contributions \(\tau^2/T\). The \(Tm\) independent individual deviations each have coefficient \(1/(Tm)\), so their contribution to variance is \(\sigma^2/(Tm)\). Therefore,

$$ \operatorname{Var}(\bar{Y})=\frac{\tau^2}{T}+\frac{\sigma^2}{Tm}. $$

If all \(Tm\) rows were incorrectly treated as independent, the calculation would instead be \((\tau^2+\sigma^2)/(Tm)\). That calculation divides the shared variation by the number of rows, even though there are only \(T\) independent shared effects. It understates uncertainty when the shared variance is positive and there is more than one record per period.

Worked Example: Comparing the Correct and Naive Variance

Method: calculate the grand-mean variance by separating period-level variation from record-level variation. Suppose a hypothetical study has 4 calendar periods with 5 observations in each period. Use the same model assumptions, with \(\tau^2=9\) and \(\sigma^2=16\).

Step 1: Count the observations. There are \(T=4\) periods and \(m=5\) observations per period, so \(Tm=20\) observations in total.

Step 2: Calculate the correct variance. The contribution from period effects is \(9/4=2.25\). The contribution from individual deviations is \(16/20=0.80\). Thus \(\operatorname{Var}(\bar{Y})=2.25+0.80=3.05\).

Step 3: Calculate the naive variance for comparison. The variance of one observation is \(9+16=25\). Assuming 20 independent observations would give \(25/20=1.25\), rather than 3.05.

Step 4: Interpret the difference. The naive variance is too small by \(3.05-1.25=1.80\). Equivalently, the correct variance is \(3.05/1.25=2.44\) times the naive variance.

Check: The shared component contributes \(2.25\), not \(9/20\), because each of the four period effects is averaged over a period, not independently redrawn for every row. Common mistake avoided: dividing all sources of variation by the total number of rows assumes that the shared effect changes independently from row to row.

Shared Conditions and Data Splits

Dependence also matters when deciding which records belong together in an analysis. A random split of rows can place observations from the same event or time period on both sides of a training-and-test split. The two subsets then share some of the same operating conditions. A test set constructed this way may be useful for a question about additional records from familiar periods, but it does not directly answer how a model performs in entirely new periods or events.

The split should match the intended prediction setting. If predictions will be made for future months, holding out later months provides a more relevant assessment of performance across time. If the target is an unseen catastrophe event, keeping all records from an event together prevents that event from appearing on both sides. This is a study-design choice: neither split is universally correct, and the intended use determines which question to answer.

Worked Example: Checking Whether Events Cross a Data Split

Method: identify the shared event for each record, then count how many test events also occur in the training data. A hypothetical portfolio has two claims for each of four storm dates. A row-level split places these records in the following sets:

  • Training: Date A, claim 1; Date A, claim 2; Date B, claim 1; Date C, claim 1.
  • Test: Date B, claim 2; Date C, claim 2; Date D, claim 1; Date D, claim 2.

Step 1: List the training dates. The training set contains Dates A, B, and C.

Step 2: List the test dates. The test set contains Dates B, C, and D, so it has 3 distinct dates.

Step 3: Count shared dates. Dates B and C occur in both sets. Thus 2 of the 3 test dates, or \(2/3=0.6667\), rounded to four decimal places, are also represented in training.

Step 4: Change the split to match a new-event goal. If the goal is evaluation on unseen events, keep all claims for a date together. For example, training on Dates A and B and testing on Dates C and D produces no date overlap.

Check: The row counts are four training claims and four test claims in the original split, but the number of distinct shared dates is two. Common mistake avoided: checking that rows differ is not enough; the event or period that can induce dependence must also be checked.

Recognizing the Source and Scope of Dependence

A shared date or environment is a reason to investigate dependence, not proof that it exists. If all observations are recorded in the same month but the month has no relevant effect on the outcome, the calendar label alone does not create a meaningful shared influence. Conversely, the shared factor need not be a calendar date: a common equipment failure, a severe weather event, a policy change, or a temporary operating constraint can affect records taken at different locations.

It is also important to distinguish shared observed conditions from unobserved ones. If relevant conditions are recorded and included in the analysis, some of their effect can be represented explicitly. Residual dependence may still remain if important shared influences are omitted or if the model represents them inadequately. The model in this tutorial is a simplified way to reason about that possibility; it does not establish a causal effect or guarantee a particular data-generating process.

SituationShared influence to considerQuestion to ask
Claims reported on the same dateA storm, outage, or other eventCould the event shift several claims together?
Sales from several sites in one periodSeasonality, a holiday, or a supply constraintDo the sites face the same period-specific conditions?
Measurements from several facilitiesCommon equipment, weather, or operating policyAre the measurements independent after accounting for the shared condition?
Records with different dates but one eventA continuing event or operating disruptionDoes the event span more than one calendar period?

Common Mistakes

  • Equating separate rows with independent observations. Rows may describe different people or locations but share an event or operating condition.
  • Assuming every record in one period is dependent. Dependence requires a relevant shared influence; a common timestamp by itself is not a proof.
  • Dividing shared variation by the number of rows. In the model, the shared effect is independently drawn once per period, not once per record.
  • Using a split that does not match the intended prediction setting. A row-level split can answer a different question from a split that holds out entire periods or events.
  • Assuming a simple shared-effect model captures every source of association. The model is a useful description under stated assumptions, not a guarantee that all dependence has been identified.
Key takeaway: When several records share time, an event, or operating conditions, ask whether that common influence can make their outcomes move together. Identify the relevant shared unit, state the assumptions behind any dependence calculation, and make sure averages and data splits reflect the prediction question.

Check Your Understanding

For each problem, identify the shared influence and apply the stated assumptions where calculations are requested.

  1. In the model \(Y_{tj}=\mu+B_t+\varepsilon_{tj}\), suppose \(\operatorname{Var}(B_t)=3\) and \(\operatorname{Var}(\varepsilon_{tj})=4\), with all independence assumptions as stated in this tutorial. Find the variance of one observation, the covariance of two different observations in the same period, and their correlation. (Answer: variance \(7\); covariance \(3\); correlation \(3/7=0.4286\).)
  2. A study has 5 independent days with 3 measurements per day. Under the shared-effect model, let \(\tau^2=6\) and \(\sigma^2=10\). Find the variance of the grand mean and the variance obtained by incorrectly treating all 15 measurements as independent. (Answer: correct variance \(6/5+10/15=28/15=1.8667\); naive variance \(16/15=1.0667\).)
  3. A test set contains records from Dates P, Q, and R. The training set also contains records from Dates P and R, but not Q. What fraction of the distinct test dates also appears in training, and what does that imply if the goal is performance on unseen dates? (Answer: \(2/3=0.6667\); two test dates are familiar, so the split does not hold out all dates.)
  4. Several facilities record demand during the same week. Give one possible shared influence and explain why separate facility identifiers do not, by themselves, establish independence. (Answer: a common holiday or supply disruption could affect all facilities; different identifiers do not remove that shared influence.)
  5. Suppose a shared effect has variance 0 while the record-specific variance is positive. Under the stated model, what is the covariance between two different observations in the same period, and what does this say about this source of dependence? (Answer: covariance \(0\); this shared-effect source contributes no within-period dependence under the model.)
Clinical Biostats