Skip to main content

Conditional vs. Non-Conditional Studies

Note: This is a first draft and will evolve as new examples and visualizations are added.

Overview:
This document introduces how QLIR treats every measurable feature — price, ATR, slope, funding rate, etc. — as a distribution of statistical likelihoods.
Conditional studies slice this distribution into contextual subsets, while non-conditional studies describe the global shape.
The framework below defines how to interpret, combine, and use those distributions to make context-aware decisions.


⚖️ Conditional vs. Non-Conditional Studies

One of the most common and reasonable critiques of any quantitative study or strategy is:

“That might have worked in that environment — but does it still work now?”

This question motivates the distinction between non-conditional and conditional studies.


Perfect — here’s your fully integrated Section 1 of conditionality.md, now including the new “Events and Contextual Weighting” material. This version preserves your operational clarity (“rerun study on filtered raw data”), adds the bitmask + DAG explanation, and then closes with the event-based reasoning layer you just described.


🧩 1. The Core Idea

Every study describes a statistical landscape — a mapping of how likely certain outcomes are across all observations.

The first step is to run the study on the entire raw dataset, producing a global distribution. This gives us the baseline shape of the phenomenon across all available contexts.

When we apply conditions — temporal, structural, or contextual — we’re not modifying that landscape; we’re rerunning the same study on a filtered version of the raw data. Each filtered subset produces its own independent distribution, built using the same computational process but limited to data that meets the condition.

ModeWhat it RepresentsDescription
Global (Non-Conditional)The study applied to the entire raw dataset.Produces the baseline landscape of statistical likelihoods — the “world map.”
ConditionalThe same study applied to a filtered subset of the raw data.Produces an alternate landscape that reflects how the phenomenon behaves under specific conditions — the “regional view.”

🖼️ Placeholder: Global vs. Conditional Distribution Diagram Visual: bell-curve-like probability density with a shaded region representing a conditional slice (e.g., UTC Monday 09:00–10:00).


Bitmask Interpretation

Each condition acts as a bitmask on the raw dataset — a Boolean selector that defines which observations participate in the study. Multiple masks can be combined to produce narrower subsets:

[ C = C_1 \land C_2 \land \ldots \land C_n ]

Each unique mask combination represents an independent run of the study on that subset of data. Removing or relaxing a condition simply widens the mask, restoring excluded observations.

🖼️ Placeholder: Bitmask Filtering Illustration Visual: binary inclusion diagram showing overlapping bitmasks and resulting intersections.


Combining vs. Merging Distributions

There are two main operational patterns:

  1. Combine Conditions Before Running the Study
  • Apply all bitmasks first, then run the study once on that subset.
  • Produces a single, tightly defined conditional distribution.
  • Ideal when you want to analyze a specific regime directly.
  1. Run Separate Studies, Then Compare or Merge Results
  • Execute the same study independently on each condition (A, B, etc.).
  • Compare shapes, calculate divergence, or merge distributions post-hoc.
  • Useful when you want to measure how contexts differ rather than conflate them.

🧭 Placeholder: Mermaid DAG Diagram Visual: DAG showing two branches — one combining bitmasks before study execution, one running parallel studies and merging outputs afterward.

Example (conceptual DAG):


Events and Contextual Weighting

Both global and conditional studies operate over the same underlying list of events — each event is a discrete observation (a candle, a trade, a feature measurement).

  • The global distribution visualizes all events.
  • A conditional distribution highlights the subset of events that meet one or more conditions.

If visualized in a scatter or box plot (e.g., Tableau), the global distribution can serve as a backdrop while conditional events are highlighted in color. This lets you see where those events land within the larger landscape — how far they sit from the global median, how many σ away they typically fall, and what range they occupy.

🖼️ Placeholder: Event Highlight Visualization Visual: two aligned box plots or dot clouds — the global distribution (gray) with conditional events highlighted in color.

Sometimes the global distribution offers little direct insight — the feature’s structure only becomes meaningful under certain contexts. In those cases, the conditional distribution carries more informational weight.

Study TypeInformational FocusTypical Weight
GlobalBaseline reference; useful for normalization and z-scoringLower
ConditionalContextual insight; used for regime detection or predictive tuningHigher

Practically, you maintain both:

  • the global event list as the universal reference frame, and
  • multiple conditional event sets to illuminate context-specific behavior.

Switching between them — analytically or interactively — shows how a condition doesn’t change the data itself but changes which parts of the data are emphasized in your reasoning.

🖼️ Placeholder: Highlighted-Subset Tableau Mockup Visual: interactive representation where toggling a condition highlights subset events within a global distribution.

🧮 2. Feature-Agnostic Principle

This framework applies to any measurable column — not only price.
Each field defines its own probability landscape.

Example FeaturePossible Conditional Axis
ATRhigh- vs. low-volatility sessions
Funding Ratepositive vs. negative
Slopedirection or magnitude thresholds
Volume Deltamarket-buy imbalance regimes
OI Ratiogrowth vs. contraction phases

🖼️ Placeholder: Multi-Feature Illustration
Visual: stacked histograms (ATR, funding, slope) each with shaded conditional slices.


🧭 3. Unequal and Irregular Slices

Conditions rarely yield slices with equal bar counts.
A filter such as RSI > 70 may produce:

  • a 5-bar cluster here,
  • a 25-bar stretch there,
  • and long gaps of exclusion in between.

Each slice is still valid; it simply carries a different temporal density.
Sometimes that density itself has meaning — the duration or frequency of a condition can be treated as another feature.

PropertyInterpretation
Slice lengthHow long the condition persists (regime duration)
Slice frequencyHow often the regime appears
Slice overlapInteractions between multiple conditions

🖼️ Placeholder: Irregular Slice Timeline
Visual: time axis showing shaded RSI>70 intervals of varying widths.


⚙️ 4. How These Distributions Are Used

Conditional and non-conditional studies aren’t only descriptive.
They form the reference distributions you consult when current conditions are known.

Think of it as:

“Given today’s market snapshot, which historical distributions are relevant?”

Example: Slope Persistence

Suppose you maintain historical slope-persistence distributions under various regimes:

ConditionDescriptionDataset Tag
NoneGlobal / Non-conditionalD_global
VolHighATR above 80th percentileD_volHigh
VolLowATR below 20th percentileD_volLow
RSI>70Overbought contextD_rsiHigh
RSI>70 & VolHighComposite conditionD_rsiHigh_volHigh

At runtime you input the current state:

{
"ATR_percentile": 0.84,
"RSI": 74,
"FundingRate": -0.0015
}

The system resolves this into applicable conditions (VolHigh, RSI>70), then queries the corresponding conditional distributions (D_rsiHigh_volHigh) to estimate the likelihood that slope persistence increases from here.

🖼️ Placeholder: Runtime Query Flow Visual: “Current Market State → Match Conditions → Fetch Conditional Distribution → Display Likelihood Range.”


Practical Interpretation

  • Global distributions are your defaults.
  • Conditional distributions are your contextual overrides.
  • Combining or removing conditions is equivalent to adding or collapsing dimensions in your statistical space.

🖼️ Placeholder: Dimensionality Cube Diagram Visual: 3-axis cube (ATR, RSI, Funding) with highlighted slice representing current condition intersection.


🧮 6. Dimensionality Explosion and Reduction

As you introduce more conditions, the number of possible distribution combinations grows exponentially:

nconditions=2kn_{\text{conditions}} = 2^k

(where k = number of binary condition axes).

This is the dimensionality explosion problem — each new condition doubles the number of possible intersections.

In practice, you manage this by:

  1. Feature importance pruning → keep only conditions that materially deform distributions.
  2. Hierarchical reduction → merge similar conditional profiles back into parent distributions.
  3. Dynamic resolution → compute fine-grained distributions only when the system is in that region of state space.

🖼️ Placeholder: Dimensionality Reduction Illustration Visual: branching tree that prunes low-impact branches back toward the trunk.


Conceptual Loop

  1. Observe current state (inputs from live data).
  2. Locate matching conditional distributions.
  3. Evaluate feature likelihoods within those distributions.
  4. If conditions change, shift to the new slice.
  5. Periodically recompute or merge underutilized slices to control dimensionality.

This is how conditional studies evolve from historical analysis to decision-time inference engines.

🖼️ Placeholder: Adaptive Loop Diagram Visual: circular flow “Observe → Match → Evaluate → Update → Merge.”


🧭 7. Measuring Distance in Likelihood Space

Instead of describing “average” outcomes, we measure positions within the probability landscape.

z=xmedian(D)σ(D)z = \frac{x - \text{median}(D)}{\text{σ}(D)}

A conditional result that lies several σ away from the global median indicates a distributional deformation — that regime produces outcomes that are globally rare.

🖼️ Placeholder: Z-Score Axis Diagram Visual: standard-deviation axis with markers showing where conditional results land.


🔁 8. Diagnostic Workflow

  1. Global baseline: establish the full distribution ( D ).
  2. Conditional slice: derive local ( D|C ).
  3. Map back: locate conditional outcomes on the global axis.
  4. Interpret: measure deviation (σ-distance) to quantify regime effect.

🖼️ Placeholder: Flow Diagram Visual: “Global Study → Apply Condition → Conditional Study → Map Back to Global.”


🧱 9. Design Philosophy

  • Global studies define the coordinate system — the zero point.
  • Conditional studies explore deviations from that system.
  • The transition is reversible: remove conditions to recover the global view, or project global results into any conditional frame.

🔗 See also:


Summary

StepQuestionOutput
1What is the global statistical likelihood landscape?( D )
2How does that landscape change under condition C?( DC )
3How far does ( DC ) drift from ( D )?σ-distance, Δp(x)
4What does that imply about regime sensitivity?Contextual insight for decision-making

🖼️ Placeholder: Combined Summary Illustration Visual: layered plot showing global curve, conditional slice, z-axis distances, and interpretation arrows.


In short:

Non-conditional studies define the global distribution of likelihoods. Conditional studies reveal how those likelihoods shift and deform under specific contexts. Together they describe not just whether a phenomenon “works,” but where in the statistical landscape it holds — and how far it drifts when real-world conditions change.