Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

name: op-mat-partial-correlation
description: Partial correlation matrix of a vector's numeric members — each pair with every other member, or the params.control fields, held fixed — listwise or pairwise, weighted; non-PSD input refused unless repair "nearest", singular input refused; p-values and confidence intervals on request (params.inference).
kind: operator
category: MAT
operator: MAT_PARTIAL_CORRELATION
type: reference
applies_to: process, compose, predict
examples_tags: [matrix, correlation-analysis]

Slot and members as for op-mat-covariance.

Use when

How closely each pair of numeric fields moves together once other fields are held fixed, as one square table of values from -1 to 1.

Questions it answers:

  • Does satisfaction still track price once delivery time is held fixed?
  • Which of these ratings are linked directly, rather than only through the overall score?

Use something else:

  • MAT_CORRELATION when you want each pair’s link with nothing held fixed.

Params

NameTypeDefaultDescription
controllistall"all" or a field list: the held-fixed set; a listed member leaves the axis.
repairenum—nearest: repair a non-PSD input.
inferenceboolfalseauxiliary.p / ci_lower / ci_upper, df = N* − 2 − g.
alphafloat0.05In (0, 1): interval level; needs inference.
missingenumlistwisePairwise adds auxiliary.n (matrix-results).
max_drop_sharefloat—0–1: listwise drop-share warning.
fitstring—Emit from a bound vector fit’s listwise state, reading no row (vector-row-scores).

Spec multiplicity implies inference (multiplicity-correction).

Inputs

Integer / float members and controls.

Output

primary: partial r over the non-control members, diagonal 1. Pairwise auxiliary.n. inference: per pair p (t test, as ppcor) and Fisher-z interval; diagonal null.

Reading the output

  • primary.values: Each off-diagonal cell is the correlation of its row and column members once the held-fixed fields are taken out of both (every other member, or the params.control fields), from -1 to +1. 0 means no straight-line link is left after holding them fixed. The diagonal is 1.
    • Caveat: Correlation is not causation: a third factor may drive both fields.
  • auxiliary.p: a p-value. Below alpha (0.05 unless the request sets another) the result is called significant; that is not the same as important, so read the effect size for how big it is.

Components

  • Counts run over the members plus the outside controls.

Contract

  • Member types (vector, fields): f32, f64, packed_bool, u16, u32, u4, u64, u8 (packed_bool only under coerce: "binary"; a vec_* field’s elements are members); any other is PULSE_VECTOR_MEMBER_TYPE.
  • Weight: weighted under frequency and probability weights.
  • Multiplicity: a spec multiplicity block (implying params.inference; an inherited method reaches only a spec under params.inference) adds p_adjusted and significant_adjusted beside p; families request, matrix (default).
  • Streaming: streamable; partial states merge; components mergeable.
  • Components: n, n_null, n_listwise_dropped; optional min_pair_n, max_pair_n, sum_weights, n_eff, n_weight_invalid.

Gotchas

  • Non-PSD pairwise input: FATAL PULSE_MATRIX_NOT_PSD; repair: "nearest" (Higham) warns with frobenius_adjustment.
  • Collinear fields: PULSE_MATRIX_SINGULAR (dependent_fields).
  • inference N*: listwise the fold’s, pairwise the smallest pair’s (PULSE_MATRIX_PAIRWISE_N_STAR); too thin ⇒ null + PULSE_MATRIX_INSUFFICIENT_N.

See