COMP 521 · DATA AND INFERENCE

Measurements, probability, and geometry

How do imperfect measurements constrain a physical quantity?

Anna Rosen · San Diego State University

THE ROAD THROUGH THE FOUNDATIONS

Today: from light to inference

  1. Light and models: What produces a transit and what does a detector measure?

  2. Probability: How do repeated measurements vary, and how can measurements be related?

  3. Geometry: How do vectors and matrices organize measurements and transformations?

Use right for the main sequence and down for additional worked details.

THE SCIENTIFIC QUESTION

A transit: from geometry to a light curve

A transit occurs when a planet passes in front of its star, blocking some of its light. The curve shows brightness relative to the star’s usual level.

Uniform star; central transit; no limb darkening.

LIGHT FROM STAR TO DETECTOR

What is flux?

Flux is the energy arriving per unit time per unit collecting area, in a specified wavelength band.

F=dEdA dt.F=\frac{dE}{dA\,dt}.

A detector records counts from the light collected during an exposure.

Light travels from a star to a telescope, which collects it; a detector records counts.

MEASURE BRIGHTNESS OVER TIME

From detector counts to a light curve

After calibration, compare brightness at each time with the out-of-transit brightness:

f(t)=F(t)Fout.f(t)=\frac{F(t)}{F_{\rm out}}.

This normalized flux is dimensionless. Outside transit it is near 1; a transit makes a dip.

The measured counts depend on the telescope, detector, exposure time, and background as well as the incoming light.

AN IDEALIZED FORWARD MODEL

What does the depth tell us?

For the fully overlapping planet in this model, the blocked fraction of a uniformly bright stellar disk is

depth=(RpR⋆)2=(0.1)2=0.01.\text{depth}=\left(\frac{R_p}{R_\star}\right)^2=(0.1)^2=0.01.

The normalized flux falls from 1 to 0.99. Real stars have limb darkening, and real light curves include additional variation and measurement error.

SIGNAL AND VARIATION

Why are measurements uncertain?

  • Photon counting: the number of detected photons fluctuates between exposures.

  • Background and detector noise: sky light and electronic readout add variation.

  • Instrument and star: changing sensitivity and stellar variability can add patterns to the light curve.

Some variation is random; other patterns can be correlated in time or reflect real stellar behavior. Their size matters when deciding which transit models fit the data.

FROM A PHYSICAL EVENT TO DATA

What do we actually measure?

Synthetic normalized flux measurements over time, with an illustrative box-shaped transit model.

Each point is a flux measurement at a time.

A transit produces a dip; a forward model predicts its shape. The scatter and remaining patterns need explanation too.

QUESTION → PREDICTION → COMPARISON

Forward model and inference

A forward model predicts measurements from physical parameters.

yi=m(ti;θ)+ϵi.y_i=m(t_i;\boldsymbol\theta)+\epsilon_i.

yiy_i is observed flux; mm is the predicted flux; ϵi\epsilon_i is their discrepancy.

Inference compares predictions with observations.

Physical parameters feed a forward model and predicted light curve; inference compares the prediction with observations to constrain parameters.

PHYSICAL PARAMETERS → LIGHT CURVE

Forward modeling: predict the observations

Physical parameters feed a forward model and predicted light curve; inference compares the prediction with observations to constrain parameters.

Choose the star, planet, orbit, and observation times. The model predicts a flux at each time.

For the uniform-star transit,

δ=(RpR⋆)2.\delta=\left(\frac{R_p}{R_\star}\right)^2.

The radius ratio determines the full-transit depth.

THE UNIFORM-STAR MODEL

Project 1: geometry predicts the dip

p=Rp/R⋆p=R_p/R_\star is the radius ratio; z=d/R⋆z=d/R_\star is the projected separation in stellar radii.

As the projected separation changes, the overlap between the planet and stellar disk changes.

A planet overlaps a stellar disk. The arrow from the center of the star to the center of the planet shows projected separation.

THE UNIFORM-STAR MODEL

Transit model: three geometric cases

For a smaller planet in front of a uniform star:

f(p,z)={1z≥1+p,1−p2z≤1−p,1−overlap areaπR⋆2partial overlap.f(p,z)=\begin{cases} 1 & z\geq 1+p,\\ 1-p^2 & z\leq 1-p,\\ 1-\dfrac{\text{overlap area}}{\pi R_\star^2} & \text{partial overlap}. \end{cases}

The normalized flux is the fraction of the stellar disk that remains visible.

CIRCULAR, EDGE-ON ORBIT

Project 1: position becomes a light curve

For orbital radius aa and period PP, near a primary transit with mid-transit at t=0t=0:

z(t)=aR⋆∣sin⁡ ⁣(2πtP)∣,fmodel(t)=f(p,z(t)).z(t)=\frac{a}{R_\star}\left|\sin\!\left(\frac{2\pi t}{P}\right)\right|,\qquad f_{\rm model}(t)=f\bigl(p,z(t)\bigr).

Time gives the planet’s projected position. The overlapping area gives the predicted brightness.

The projected separation alone does not tell us whether the planet is in front of or behind the star.

PROJECT 2 · LIMB DARKENING

Why does position on the star matter?

A stellar disk is brightest at its center and dimmer toward its edge, with a small planet covering part of the disk.

The center of a star’s disk can appear brighter than its edge. A planet of the same size blocks more light where the surface is brighter.

The transit shape therefore depends on both the planet’s path and the star’s brightness pattern.

LIMB DARKENING

Project 2: stars are not uniformly bright

In the linear limb-darkening model, rr is distance from the disk center in units of R⋆R_\star:

μ(r)=1−r2,I(r)=I0[1−u(1−μ)].\begin{aligned} \mu(r)&=\sqrt{1-r^2},\\ I(r)&=I_0\left[1-u(1-\mu)\right]. \end{aligned}

I0I_0 is the central intensity; uu sets the strength of limb darkening. For u>0u>0, the edge is dimmer.

Model light curves for a uniform star and a limb-darkened star. The limb-darkened model is deeper at the center of transit.
Same orbit and planet; two stellar brightness models.

INTEGRATE ACROSS THE STELLAR DISK

Project 2: add up the blocked light

For each annulus, c(r,z)c(r,z) is the fraction covered by the planet. Add the blocked contribution from all annuli:

ΔF(z)=∫01I(r) 2πr c(r,z) drFtot,Ftot=πI0(1−u/3).\Delta F(z)=\frac{\int_0^1 I(r)\,2\pi r\,c(r,z)\,dr}{F_{\rm tot}},\qquad F_{\rm tot}=\pi I_0(1-u/3).

The normalized model is f(z)=1−ΔF(z)f(z)=1-\Delta F(z). When u=0u=0, it recovers the uniform-disk model.

TIME → ORBIT → LIGHT CURVE

Project 3: an eccentric orbit

For eccentricity ee and period PP, take t=0t=0 at periastron. The mean anomaly MM advances uniformly; solve Kepler’s equation for eccentric anomaly EE:

M=2πtP,M=E−esin⁡E.M=\frac{2\pi t}{P},\qquad M=E-e\sin E.

Then compute the orbital position and projected separation z(t)z(t), check that the planet is in front, and evaluate the transit model.

Changing the orbit changes when and how the planet crosses the star. Changing the stellar brightness model changes how much light it blocks.

LIGHT CURVE → PARAMETER ESTIMATES

Inverse modeling: learn from measurements

Which parameter values reproduce the observed light curve?

Try parameters, calculate predictions, and compare them with the data.

Different combinations can produce similar curves. Uncertainty determines how precisely the data distinguish them.

Physical parameters feed a forward model and predicted light curve; inference compares the prediction with observations to constrain parameters.

PREDICTION MEETS KEPLER DATA

From a forward model to Project 5

The projects built a path from physical parameters to predicted brightness:

orbit  ⟶  z(t)  ⟶  fmodel(t;θ).\text{orbit}\;\longrightarrow\; z(t)\;\longrightarrow\; f_{\rm model}(t;\boldsymbol\theta).

With observations, compare the prediction at each observation time to the measured flux:

ri=yi−fmodel(ti;θ).r_i=y_i-f_{\rm model}(t_i;\boldsymbol\theta).

The residuals tell us where the model and the light curve disagree. Project 5 brings this modeling idea to Kepler photometry.

A FIRST INVERSE PROBLEM

A simple model for depth

Before fitting a full transit curve, use a fixed-shape model to see how fitting works. Take a baseline of 1 and a fixed transit template:

mi(δ)=1−δTi,T=(0,1,1,0).m_i(\delta)=1-\delta T_i,\qquad \mathbf T=(0,1,1,0).

Ti=0T_i=0 outside transit; Ti=1T_i=1 inside. The unknown parameter δ\delta is the depth.

For δ=0.01\delta=0.01, the model predicts (1.00,0.99,0.99,1.00)(1.00,0.99,0.99,1.00). Press down for the worked fit.

FOUR OBSERVATIONS

Compare candidate light curves

Four flux measurements compared with three box-shaped model curves of different transit depths.

The data are (1.00,0.98,0.99,1.00)(1.00,0.98,0.99,1.00).

Each curve uses the same baseline and timing. Only the depth changes.

Which depth best matches the two in-transit measurements?

DATA MINUS MODEL

Residuals make the comparison quantitative

For each observation, subtract the model:

ri(δ)=yi−mi(δ)=yi−1+δTi.\begin{aligned} r_i(\delta)&=y_i-m_i(\delta)\\ &=y_i-1+\delta T_i. \end{aligned}

With equal weights, compare candidate depths:

S(δ)=∑iri(δ)2.S(\delta)=\sum_i r_i(\delta)^2.

A fit minimizes this sum.

Four flux measurements compared with three box-shaped model curves of different transit depths.

MINIMIZE THE RESIDUALS

Derive the best-fitting depth

S(δ)=∑i(yi−1+δTi)2.S(\delta)=\sum_i(y_i-1+\delta T_i)^2.
dSdδ=2∑iTi(yi−1+δTi)=0.\frac{dS}{d\delta}=2\sum_iT_i(y_i-1+\delta T_i)=0.
δ^=∑iTi(1−yi)∑iTi2=0.02+0.012=0.015.\hat\delta=\frac{\sum_iT_i(1-y_i)}{\sum_iT_i^2}=\frac{0.02+0.01}{2}=0.015.

A DEPTH OF 1.5%

Inspect the fit and residuals

Four flux measurements and a fitted transit model, with a lower panel showing residuals of negative and positive 0.005 inside transit.

The in-transit prediction is 0.985.

Residuals: -0.005 and +0.005.

The fitted depth summarizes the dip. The residuals show what remains around the model.

FROM A FIT TO A PHYSICAL QUANTITY

What did we infer?

For a uniform star and a fully overlapping planet:

δ^=0.015⇒RpR⋆=0.015≈0.122.\hat\delta=0.015\quad\Rightarrow\quad \frac{R_p}{R_\star}=\sqrt{0.015}\approx0.122.

The light curve constrains a radius ratio through the forward model. To find RpR_p itself, we also need R⋆R_\star.

Here we held the transit timing, shape, and baseline fixed. Estimating them changes the inverse problem.

PART I

Probability describes variation

If we repeated a measurement under the same conditions, how would its outcomes vary?

A probability distribution describes that variation.

RANDOM VARIABLES

From a measurement to a distribution

A random variable YY represents possible measurement outcomes.

For a continuous quantity:

P(a<Y<b)=∫abp(y) dy.P(a<Y<b)=\int_a^b p(y)\,dy.

Probability is area over an interval.

A probability-density curve with the region between a and b shaded to show the probability of that interval.

The density at a single value is not the probability of that exact value.

AVERAGE OVER POSSIBLE OUTCOMES

What is an expectation value?

The expectation of a random quantity is its probability-weighted average over possible outcomes.

For discrete outcomes yky_k with probabilities P(Y=yk)P(Y=y_k):

E[Y]=∑kyk P(Y=yk).E[Y]=\sum_k y_k\,P(Y=y_k).

It is a property of the probability model. With many independent repetitions from the same distribution, the sample average approaches it when the mean is finite.

WEIGHT EACH OUTCOME BY ITS PROBABILITY

Expectation: a worked example

Suppose a repeat measurement of normalized brightness YY is 0.98 with probability 1/41/4 and 1.00 with probability 3/43/4:

E[Y]=0.98(14)+1.00(34)=0.995.E[Y]=0.98\left(\frac14\right)+1.00\left(\frac34\right)=0.995.

Across repeated measurements, the average approaches 0.995. In this example, neither individual outcome equals the expectation.

THE SAME IDEA FOR ANY QUANTITY

Expectation of a function

To average a function g(Y)g(Y), weight each value of the function by the same outcome probabilities:

E[g(Y)]=∑kg(yk)P(Y=yk).E[g(Y)]=\sum_k g(y_k)P(Y=y_k).

For a continuous variable with density p(y)p(y), replace the sum with an integral:

E[g(Y)]=∫−∞∞g(y)p(y) dy.E[g(Y)]=\int_{-\infty}^{\infty}g(y)p(y)\,dy.

The expectation exists when the relevant weighted sum or integral is finite.

SUMMARIZE A DISTRIBUTION

Center and spread

μ=E[Y],Var⁡(Y)=E[(Y−μ)2],σ=Var⁡(Y).\mu=E[Y],\qquad \operatorname{Var}(Y)=E[(Y-\mu)^2],\qquad \sigma=\sqrt{\operatorname{Var}(Y)}.

Mean μ\mu: center of the distribution.

Standard deviation σ\sigma: scale of the spread, in the same units as YY.

EXPECTATION FOR A CONTINUOUS VARIABLE

From a density to a mean

μ=E[Y]=∫−∞∞y p(y) dy.\mu=E[Y]=\int_{-\infty}^{\infty}y\,p(y)\,dy.

Each possible value contributes according to its probability density. The density integrates to one; the mean is a property of the distribution.

The same expectation rule applies to other functions, including squared deviations from the mean.

SPREAD ABOUT THE MEAN

From a density to a variance

Var⁡(Y)=∫−∞∞(y−μ)2p(y) dy,σ=Var⁡(Y).\operatorname{Var}(Y)=\int_{-\infty}^{\infty}(y-\mu)^2p(y)\,dy,\qquad \sigma=\sqrt{\operatorname{Var}(Y)}.

The variance is the density-weighted mean squared deviation. The standard deviation is in the original units.

CALCULATING MEAN AND SPREAD

Worked example: a uniform distribution

Let p(y)=1/2p(y)=1/2 for 0≤y≤20\leq y\leq2, and zero elsewhere. Then

μ=∫02y12 dy=1.\mu=\int_0^2 y\frac12\,dy=1.
Var⁡(Y)=∫02(y−1)212 dy=13,σ=13.\operatorname{Var}(Y)=\int_0^2(y-1)^2\frac12\,dy=\frac13,\qquad \sigma=\frac1{\sqrt3}.

DISTRIBUTION AND DATA

One dataset, one estimated mean

Given measurements y1,…,yny_1,\ldots,y_n, their sample mean is

yˉ=1n∑i=1nyi.\bar y=\frac{1}{n}\sum_{i=1}^{n}y_i.

yˉ\bar y is computed from the observed sample. μ\mu is the mean of the underlying distribution we are trying to learn about.

For a changing star or changing transit signal, separate measurements may have different expected values. A common mean is a model assumption.

DISTRIBUTION AND DATA

Sample variance describes observed spread

For n>1n>1 observed measurements with sample mean yˉ\bar y:

s2=1n−1∑i=1n(yi−yˉ)2.s^2=\frac{1}{n-1}\sum_{i=1}^n(y_i-\bar y)^2.

The sample mean is estimated from the same data. The n−1n-1 correction makes s2s^2 unbiased for independent, identically distributed measurements with finite variance.

WHY REPEATED MEASUREMENTS HELP

Spread of data vs. spread of an estimate

If independent measurements have a common mean and variance σ2\sigma^2:

Var⁡(Yˉ)=σ2n,SD⁡(Yˉ)=σn.\operatorname{Var}(\bar Y)=\frac{\sigma^2}{n},\qquad \operatorname{SD}(\bar Y)=\frac{\sigma}{\sqrt n}.

σ\sigma: spread of individual outcomes.

σ/n\sigma/\sqrt n: standard error of the mean across repeated samples.

A shared calibration bias need not average away.

DEPENDENCE

Independence is a model assumption

Events AA and BB are independent if P(A,B)=P(A)P(B)P(A,B)=P(A)P(B).

A shared instrumental drift can make nearby errors dependent.

Two measurement deviations that rise and fall together because they share an instrumental drift.

For random variables, independence means the joint distribution factors into the individual distributions.

DEPENDENCE AND LINEAR ASSOCIATION

Covariance: how deviations combine

Cov⁡(X,Y)=E[(X−E[X])(Y−E[Y])].\operatorname{Cov}(X,Y)=E[(X-E[X])(Y-E[Y])].

Positive covariance: the average product of deviations is positive.

Negative covariance: the average product is negative.

Four paired deviations showing an upward pattern.

Covariance carries the product of the variables’ units.

NORMALIZE BY THE SPREADS

Correlation puts covariance on a common scale

Four paired deviations showing an upward pattern.
ρXY=Cov⁡(X,Y)σXσY.\rho_{XY}=\frac{\operatorname{Cov}(X,Y)}{\sigma_X\sigma_Y}.

Correlation has no units and ranges from -1 to 1 when both standard deviations are nonzero.

The sign and magnitude describe the direction and strength of the linear association.

DIRECTION AND STRENGTH

What do correlation values mean?

Near +1

Strong positive linear association.

Near 0

Little linear association.

Near -1

Strong negative linear association.

Correlation measures association, not causation. A nonlinear dependence can have zero correlation.

SAMPLE COVARIANCE AND CORRELATION

Calculate correlation from paired data

sXY=1n−1∑i(xi−xˉ)(yi−yˉ),rXY=sXYsXsY.s_{XY}=\frac{1}{n-1}\sum_i(x_i-\bar x)(y_i-\bar y),\qquad r_{XY}=\frac{s_{XY}}{s_Xs_Y}.

Each product uses the XX and YY deviations from the same observation.

Divide by the two sample standard deviations to remove units and compare linear associations on the same scale.

FROM PAIRED DEVIATIONS TO A NUMBER

Four pairs: work out the correlation

Four labeled paired observations, increasing from lower left to upper right, shown relative to the two means.

xˉ=yˉ=0\bar x=\bar y=0.

∑xiyi=4\sum x_iy_i=4, ∑xi2=5\sum x_i^2=5, ∑yi2=4\sum y_i^2=4.

r=45⋅4≈0.894.r=\frac{4}{\sqrt{5\cdot4}}\approx0.894.

The positive value matches the upward pattern.

KEEP THE SCALE AND THE ASSOCIATION DISTINCT

From covariance to correlation: a second example

If σX=2\sigma_X=2, σY=3\sigma_Y=3, and Cov⁡(X,Y)=3\operatorname{Cov}(X,Y)=3, then

ρXY=32⋅3=0.5.\rho_{XY}=\frac{3}{2\cdot3}=0.5.

Covariance carries the product of the variables’ units. Correlation divides out their spreads and has no units.

COVARIANCE IS NOT ALL DEPENDENCE

Three patterns

Three synthetic point patterns: increasing, decreasing, and a symmetric curved relation with zero covariance.
Centered example points. The curved relation has zero covariance.

Press down for the worked counterexample.

OPTIONAL DETAIL · A COMPLETE COUNTEREXAMPLE

Uncorrelated can still be dependent

Let XX be -1, 0, or 1, each with probability 1/31/3. Let Z=X2Z=X^2.

E[X]=0,E[XZ]=E[X3]=0,Cov⁡(X,Z)=0.E[X]=0,\quad E[XZ]=E[X^3]=0,\quad \operatorname{Cov}(X,Z)=0.

Yet knowing X=0X=0 tells us Z=0Z=0 with certainty, while P(Z=0)=1/3P(Z=0)=1/3 without that information.

Independence implies zero covariance when the relevant moments exist; the converse fails.

UNCERTAINTY IN A SUM

Why do cross terms appear?

Let Z=X+YZ=X+Y, and write ΔX=X−μX\Delta X=X-\mu_X and ΔY=Y−μY\Delta Y=Y-\mu_Y.

Then Z−E[Z]=ΔX+ΔYZ-E[Z]=\Delta X+\Delta Y. Its variance starts with the square

Var⁡(Z)=E[(ΔX+ΔY)2].\operatorname{Var}(Z)=E[(\Delta X+\Delta Y)^2].

The two deviations appear together because the result depends on both quantities.

THE MIXING TERM

Expand the square

Var⁡(X+Y)=E[(ΔX+ΔY)2].\operatorname{Var}(X+Y)=E[(\color{#087e81}{\Delta X}+\color{#486d9f}{\Delta Y})^2].
(ΔX+ΔY)2=ΔX2+ΔY2+2ΔXΔY.(\Delta X+\Delta Y)^2=\color{#087e81}{\Delta X^2}+\color{#486d9f}{\Delta Y^2}+\color{#9b6617}{2\Delta X\Delta Y}.
Var⁡(X+Y)=Var⁡(X)+Var⁡(Y)+2Cov⁡(X,Y).\operatorname{Var}(X+Y)=\color{#087e81}{\operatorname{Var}(X)}+\color{#486d9f}{\operatorname{Var}(Y)}+\color{#9b6617}{2\operatorname{Cov}(X,Y)}.

The cross term is the average product of the deviations.

THE CROSS TERM CHANGES SIGN

Sums and differences

Var⁡(X+Y)=Var⁡(X)+Var⁡(Y)+2Cov⁡(X,Y),\operatorname{Var}(X+Y)=\operatorname{Var}(X)+\operatorname{Var}(Y)+2\operatorname{Cov}(X,Y),
Var⁡(X−Y)=Var⁡(X)+Var⁡(Y)−2Cov⁡(X,Y).\operatorname{Var}(X-Y)=\operatorname{Var}(X)+\operatorname{Var}(Y)-2\operatorname{Cov}(X,Y).

Positive shared variation reinforces the sum and partly cancels in the difference.

TWO CORRELATED QUANTITIES

Work the cross terms out

With σX=2\sigma_X=2, σY=3\sigma_Y=3, and ρ=0.5\rho=0.5:

Cov⁡(X,Y)=ρσXσY=0.5(2)(3)=3.\operatorname{Cov}(X,Y)=\rho\sigma_X\sigma_Y=0.5(2)(3)=3.
Var⁡(X+Y)=4+9+2(3)=19.\operatorname{Var}(X+Y)=4+9+2(3)=19.
Var⁡(X−Y)=4+9−2(3)=7.\operatorname{Var}(X-Y)=4+9-2(3)=7.

At zero covariance, both variances would be 4+9=134+9=13.

SUM VS. DIFFERENCE

Shared variation changes the spread

Horizontal standard-deviation bars comparing the sum and difference of two variables at correlation 0.5 and correlation zero.
Bars show one standard deviation of each combination.

APPLY THE SUM FORMULA

Derive the uncertainty of an average

Var⁡ ⁣(Y1+Y22)=Var⁡(Y1)+Var⁡(Y2)+2Cov⁡(Y1,Y2)4.\operatorname{Var}\!\left(\frac{Y_1+Y_2}{2}\right) =\frac{\operatorname{Var}(Y_1)+\operatorname{Var}(Y_2)+2\operatorname{Cov}(Y_1,Y_2)}{4}.

The factor 1/41/4 comes from squaring the coefficient 1/21/2.

The covariance term tells us how the two measurements move together.

TWO EQUALLY PRECISE MEASUREMENTS

Dependence changes the mean’s uncertainty

For common variance σ2\sigma^2 and correlation ρ\rho:

Var⁡ ⁣(Y1+Y22)=σ22(1+ρ).\operatorname{Var}\!\left(\frac{Y_1+Y_2}{2}\right)=\frac{\sigma^2}{2}(1+\rho).

ρ=0\rho=0: variance is σ2/2\sigma^2/2.

ρ>0\rho>0: shared variation reduces the gain in precision.

A shared bias shifts the mean; correlation describes shared variation.

A PROBABILITY MODEL

Why Gaussian distributions?

p(y)=12πσexp⁡[−(y−μ)22σ2].p(y)=\frac{1}{\sqrt{2\pi}\sigma}\exp\left[-\frac{(y-\mu)^2}{2\sigma^2}\right].

The center is μ\mu; σ\sigma sets the spread.

Many small contributions can produce an approximately Gaussian error under suitable conditions.

BUILDING TOWARD THE CLT

One outcome is not Gaussian

Imagine an outcome that is 1 with probability 1/21/2 and 0 with probability 1/21/2.

One outcome has only two possible values. Its mean is 1/21/2, and its variance is (1/2)(1/2)=1/4(1/2)(1/2)=1/4.

Take 100 independent outcomes. Their sample mean is the fraction of 1s.

DISTRIBUTIONS OF SAMPLE MEANS

What happens as the sample grows?

Exact probability distributions of sample means for one, four, and one hundred independent binary outcomes.
Exact probabilities; each panel has its own vertical scale.

Each experiment supplies one mean. Larger samples concentrate those means around 0.5.

THE DISTRIBUTION OF A SAMPLE MEAN

Repeat the entire experiment

Each experiment produces one fraction.

Across repeated experiments, those fractions have mean 0.5 and standard deviation

1/4100=0.05.\sqrt{\frac{1/4}{100}}=0.05.
Exact binomial probabilities for the fraction of ones in 100 outcomes compared with a Gaussian approximation.
Exact binomial probabilities; curve is Gaussian density multiplied by bin width.

WHAT APPROACHES A GAUSSIAN?

The central limit theorem

For independent, identically distributed variables with finite mean μ\mu and finite nonzero variance σ2\sigma^2:

Yˉ−μσ/n→ d N(0,1)as n→∞.\frac{\bar Y-\mu}{\sigma/\sqrt n}\xrightarrow{\ d\ }\mathcal N(0,1)\quad\text{as }n\to\infty.

The distribution of the standardized mean approaches a Gaussian. Individual outcomes do not become Gaussian.

WHY A GAUSSIAN CAN BE USEFUL

From the CLT to measurement errors

A recorded measurement can combine many small contributions to its error. When those contributions satisfy appropriate independence and balance conditions, their sum can be approximately Gaussian.

The resulting distribution describes possible errors in a measurement. A shared instrumental drift or a few dominant effects can change that distribution.

CONNECT THE MODEL TO THE MEASUREMENTS

When is the Gaussian approximation useful?

  • Strong dependence changes how observations combine.

  • Heavy tails or a few dominant effects can make the approximation poor.

  • A systematic bias can remain even when random errors average down.

  • Selection changes which measurements we see.

The accuracy of the approximation depends on the measurement process and sample size.

WHY SHOULD UNCERTAINTY AFFECT A FIT?

Two brightness measurements

Two normalized brightness measurements with one-standard-deviation error bars and vertical lines for the weighted and unweighted means.

0.980±0.0100.980\pm0.010 and 1.000±0.0201.000\pm0.020.

Assume independent, unbiased Gaussian errors, known σi\sigma_i, and one constant brightness.

The ordinary mean is 0.990. Press down for the likelihood and weighted fit.

A MODEL FOR MEASUREMENT VARIATION

A likelihood for two measurements

With independent Gaussian errors and known σi\sigma_i:

L(μ)=∏i12πσiexp⁡ ⁣[−(yi−μ)22σi2].L(\mu)=\prod_i\frac{1}{\sqrt{2\pi}\sigma_i} \exp\!\left[-\frac{(y_i-\mu)^2}{2\sigma_i^2}\right].

Each measurement contributes one factor.

Relative likelihood curves for the two measurements and their joint likelihood, peaking at brightness 0.984.
Each curve is scaled to its own maximum.

TAKE THE LOGARITHM

From likelihood to a fitting objective

log⁡L(μ)=constant−12∑i(yi−μ)2σi2.\log L(\mu)=\text{constant}-\frac12\sum_i\frac{(y_i-\mu)^2}{\sigma_i^2}.
Relative likelihood curves for the two measurements and their joint likelihood, peaking at brightness 0.984.
Each curve is scaled to its own maximum.

The constant does not depend on μ\mu because the uncertainties σi\sigma_i are fixed.

Maximizing likelihood minimizes the weighted squared residuals.

FROM A NOISE MODEL TO AN OBJECTIVE

Derive the weighted mean

With independent Gaussian errors, maximizing the likelihood is equivalent to minimizing

Q(μ)=∑i(yi−μ)2σi2.Q(\mu)=\sum_i\frac{(y_i-\mu)^2}{\sigma_i^2}.

Differentiating and setting dQ/dμ=0dQ/d\mu=0 gives

μ^=∑iyi/σi2∑i1/σi2.\hat\mu=\frac{\sum_i y_i/\sigma_i^2}{\sum_i1/\sigma_i^2}.

Each residual is divided by its uncertainty; the objective sums the squared ratios.

INVERSE-VARIANCE WEIGHTING

The weighted result

The first measurement has one-quarter the variance and four times the weight:

μ^=4(0.980)+1.0005=0.984.\hat\mu=\frac{4(0.980)+1.000}{5}=0.984.
SD⁡(μ^)=1∑i1/σi2≈0.0089.\operatorname{SD}(\hat\mu)=\frac{1}{\sqrt{\sum_i1/\sigma_i^2}}\approx0.0089.

PART II

Data live in representations

Vectors and matrices organize the quantities we measure and the operations we perform on them.

ONE STAR, MANY TIMES

Why vectors?

A light curve contains measurements at ordered times:

y=[y1y2⋮yn],r=y−m(θ).\mathbf y=\begin{bmatrix}y_1\\y_2\\\vdots\\y_n\end{bmatrix},\qquad \mathbf r=\mathbf y-\mathbf m(\boldsymbol\theta).

A prediction and a residual have one entry for each observation.

The order, units, and correspondence between time and flux matter.

A DIFFERENT DATASET

Rows are objects; columns are features

Two illustrative stars, each measured in two normalized flux bands:

X=[0.91.11.00.8].X=\begin{bmatrix}0.9&1.1\\1.0&0.8\end{bmatrix}.

Rows: stars. First star’s feature vector: (0.9,1.1)(0.9,1.1).

Columns: band A and band B. Each is a feature.

Here there are two feature dimensions, not two spatial dimensions.

HOW A MATRIX COMBINES FEATURES

Matrix multiplication, one row at a time

[abcd][x1x2]=[ax1+bx2cx1+dx2].\begin{bmatrix}a&b\\c&d\end{bmatrix} \begin{bmatrix}x_1\\x_2\end{bmatrix} =\begin{bmatrix}ax_1+bx_2\\cx_1+dx_2\end{bmatrix}.

Each row supplies the weights for one output.

Two inputs each contribute to two outputs; each output combines the inputs using one row of a matrix.

A RULE THAT MAPS VECTORS TO VECTORS

What is a matrix transformation?

z=Ax.\mathbf z=A\mathbf x.

The columns of AA tell us where the input basis directions go. Matrix multiplication combines those directions to produce the output.

Linear transformations preserve addition and scaling:

A(ax+by)=aAx+bAy.A(a\mathbf x+b\mathbf y)=aA\mathbf x+bA\mathbf y.

A matrix can scale, rotate, combine, or project coordinates. The physical model itself need not be linear.

VARIANCES AND COVARIANCES

Put the terms in a covariance matrix

For the same pair, Var⁡(X)=4\operatorname{Var}(X)=4, Var⁡(Y)=9\operatorname{Var}(Y)=9, and Cov⁡(X,Y)=3\operatorname{Cov}(X,Y)=3:

Σ=[Var⁡(X)Cov⁡(X,Y)Cov⁡(X,Y)Var⁡(Y)]=[4339].\Sigma=\begin{bmatrix}\operatorname{Var}(X)&\operatorname{Cov}(X,Y)\\ \operatorname{Cov}(X,Y)&\operatorname{Var}(Y)\end{bmatrix} =\begin{bmatrix}4&3\\3&9\end{bmatrix}.

The diagonal entries are variances; off-diagonal entries are the mixing terms.

UNCERTAINTY OF A LINEAR COMBINATION

A matrix computes every mixing term

For Z=aX+bYZ=aX+bY and a=(a,b)T\mathbf a=(a,b)^T:

Var⁡(Z)=a2Var⁡(X)+b2Var⁡(Y)+2abCov⁡(X,Y).\operatorname{Var}(Z)=a^2\operatorname{Var}(X)+b^2\operatorname{Var}(Y)+2ab\operatorname{Cov}(X,Y).

The same expression is compactly written

Var⁡(Z)=aTΣa.\operatorname{Var}(Z)=\mathbf a^T\Sigma\mathbf a.

Multiplying aTΣa\mathbf a^T\Sigma\mathbf a produces both variance terms and the covariance cross term.

TRANSFORMING A RANDOM VECTOR

How does a transformation change covariance?

If z=Ax\mathbf z=A\mathbf x and x\mathbf x has covariance Σ\Sigma, the covariance of z\mathbf z is

Σz=AΣAT.\Sigma_{\mathbf z}=A\Sigma A^T.

Each output is a combination of inputs. The multiplication carries their variances and covariances into the output.

THE CROSS TERMS REAPPEAR

Sum and difference as a transformation

Choose z=(X+Y,X−Y)T\mathbf z=(X+Y,X-Y)^T. Then

A=[111−1],Σ=[4339].A=\begin{bmatrix}1&1\\1&-1\end{bmatrix},\qquad \Sigma=\begin{bmatrix}4&3\\3&9\end{bmatrix}.
AΣAT=[19−5−57].A\Sigma A^T=\begin{bmatrix}19&-5\\-5&7\end{bmatrix}.

The output variances, 19 and 7, agree with the earlier sum-and-difference calculation.

AVERAGE TWO BANDS

A transformation we can compute

x=[0.91.1],A=12[1111].\mathbf x=\begin{bmatrix}0.9\\1.1\end{bmatrix},\qquad A=\frac12\begin{bmatrix}1&1\\1&1\end{bmatrix}.
Ax=[1.01.0].A\mathbf x=\begin{bmatrix}1.0\\1.0\end{bmatrix}.

Both output coordinates equal the average. The result lies on the equal-band line.

EIGENVECTORS AND EIGENVALUES

Directions preserved by a matrix

A transformation usually changes a vector’s direction as well as its length. An eigenvector stays on the same line: the matrix can stretch, shrink, or reverse it.

Av=λv.A\mathbf v=\lambda\mathbf v.

The eigenvalue λ\lambda gives the scale factor. For a covariance matrix, eigenvectors give the principal directions and eigenvalues give the variances along them.

AN UNCERTAINTY ELLIPSE

The geometry of covariance

An upward-tilted ellipse representing a two-dimensional covariance matrix with positive covariance.
A contour of the covariance matrix, centered on the mean.

For deviations Δx\Delta\mathbf x from the mean, the ellipse shows ΔxTΣ−1Δx=1\Delta\mathbf x^T\Sigma^{-1}\Delta\mathbf x=1.

Its tilt shows the positive covariance: deviations along the longer direction change together.

The principal axes follow the eigenvectors. Their lengths are the square roots of the corresponding eigenvalues.

THE GEOMETRY OF A REPRESENTATION

Projection retains one component

A two-band vector, its orthogonal projection on the equal-band line, and the discarded component connecting projection to original.

Original = projection + difference.

(0.9,1.1)=(1.0,1.0)+(−0.1,0.1).\begin{aligned} (0.9,1.1)&=(1.0,1.0)\\ &\quad+(-0.1,0.1). \end{aligned}

The discarded difference might contain useful color information.

A CHOICE ABOUT INFORMATION

Why reduce dimensionality?

A spectrum may have thousands of wavelength features. A smaller representation can make patterns easier to visualize, store, and model.

But compression discards information. A low-variance feature can carry a rare and scientifically important signal.

Later: PCA finds directions of large variance in centered data; SVD provides a way to compute them. Scaling and the scientific question matter.

COMPARING VECTORS

Dot products connect geometry and fitting

xTy=∑ixiyi.\mathbf x^{\mathsf T}\mathbf y=\sum_i x_i y_i.

The dot product combines corresponding entries and describes alignment together with vector lengths.

Suppose a model predicts axa\mathbf x: a known direction x≠0\mathbf x\ne\mathbf0, with amplitude aa to estimate.

A SIMPLE LEAST-SQUARES MODEL

Fit an amplitude by projection

Choose aa to minimize the squared residual:

S(a)=∥y−ax∥2.S(a)=\|\mathbf y-a\mathbf x\|^2.
S′(a)=−2xTy+2axTx=0.S'(a)=-2\mathbf x^{\mathsf T}\mathbf y+2a\mathbf x^{\mathsf T}\mathbf x=0.
a^=xTyxTx.\hat a=\frac{\mathbf x^{\mathsf T}\mathbf y}{\mathbf x^{\mathsf T}\mathbf x}.

This unweighted model has no separate baseline.

DATA = FIT + RESIDUAL

Work through the projection

Let x=(1,2)\mathbf x=(1,2) and y=(2,3)\mathbf y=(2,3):

a^=2+61+4=1.6,a^x=(1.6,3.2).\hat a=\frac{2+6}{1+4}=1.6,\qquad \hat a\mathbf x=(1.6,3.2).

The residual is (0.4,−0.2)(0.4,-0.2) and its dot product with x\mathbf x is zero. The fitted vector is the closest point on the model line.

THURSDAY

From foundations to a first fit

  1. Inspect measurements, units, flags, gaps, and uncertainties.

  2. Choose a forward model and calculate residuals.

  3. Use a noise model to weight those residuals.

  4. Examine what the fit leaves unexplained.

Kepler photometry will provide the application. Today also includes Project 4 questions and completion time.