Skip to content

Data And Computation ​

Reference notes on statistics, optimization, and numerical methods.

Statistics And Data Analysis ​

Statistics describes uncertainty, variability, inference, and model fit.

Probability assigns likelihood to events:

P(A∪B)=P(A)+P(B)−P(A∩B)

Conditional probability is:

P(A∣B)=P(A∩B)P(B)

Bayes' rule updates probability after observing evidence:

P(Bi∣A)=P(A∣Bi)P(Bi)∑jP(A∣Bj)P(Bj)

A random variable maps outcomes to numbers. Discrete variables use a PMF, continuous variables use a PDF, and both use a CDF:

FX(x)=P(X≤x)

Expected value and variance are:

E[X]=μVar(X)=E[(X−μ)2]

Covariance and correlation describe how variables vary together:

Cov(X,Y)=E[(X−μX)(Y−μY)]ρX,Y=Cov(X,Y)σXσY

Common discrete distributions include Bernoulli, binomial, geometric, negative binomial, hypergeometric, Poisson, and multinomial distributions.

Common continuous distributions include uniform, exponential, gamma, Weibull, beta, and normal distributions.

Common distribution uses:

DistributionTypical use
Bernoullione binary trial
Binomialnumber of successes in fixed independent trials
Geometrictrials until first success
Hypergeometricsampling without replacement
Poissonevent counts over interval or region
Uniformequal density over an interval
Exponentialwaiting time for memoryless events
Gammawaiting time for multiple Poisson-process events
Weibullreliability and life data with flexible failure-rate behavior
Betaprobability-like quantities bounded between 0 and 1
Normalmeasurement variation, CLT approximations, linear model errors

The normal distribution is:

f(x)=1σ2πexp⁡[−12(x−μσ)2]

Descriptive statistics summarize observed data:

x¯=1n∑i=1nxis2=1n−1∑i=1n(xi−x¯)2

Confidence intervals estimate plausible parameter ranges. For a mean with unknown population standard deviation:

x¯±tα/2,n−1sn

Hypothesis tests compare a null hypothesis to an alternative. A p-value measures how extreme the observed data would be if the null hypothesis were true. Type I error rejects a true null hypothesis. Type II error fails to reject a false null hypothesis.

The central limit theorem explains why sample means often become approximately normal even when the original data are not normal, provided the sample size is large enough and the assumptions are reasonable:

X¯−μσ/n⇒N(0,1)

Point estimators can be compared by bias, variance, consistency, and mean squared error:

MSE(θ^)=Var(θ^)+Bias(θ^)2

Test selection depends on the data structure. One-sample tests, paired tests, two-sample tests, proportion tests, variance tests, and nonparametric tests answer different questions.

Linear regression fits:

y=β0+β1x+ϵ

Residuals are:

ei=yi−y^i

Residual analysis checks model form, nonconstant variance, outliers, non-normal error behavior, missing variables, and regime changes. Regression, ANOVA, confidence intervals, prediction intervals, and hypothesis tests all depend on assumptions about sampling, independence, variance, and residual structure.

One-factor ANOVA compares variation between groups to variation within groups:

F=MSbetweenMSwithin

It tests whether group means differ more than expected from within-group variation under the null hypothesis.

For regression, confidence intervals describe uncertainty in the expected mean response. Prediction intervals describe uncertainty for a new observation. Prediction intervals are wider because they include both parameter uncertainty and observation noise.

Correlation does not establish causation. A statistically significant model can still be physically weak if the experiment is confounded, the operating region is narrow, the sample is biased, or the variables are only proxies for the actual mechanism.

Optimization ​

Optimization chooses design variables to minimize or maximize an objective subject to constraints.

General constrained form:

minxf(x)

subject to:

gi(x)≤0hj(x)=0

The gradient gives first-order local sensitivity:

∇f(x)

The Hessian gives second-order curvature:

∇2f(x)

The Lagrangian is:

L(x,λ,μ)=f(x)+∑iλigi(x)+∑jμjhj(x)

KKT conditions combine stationarity, primal feasibility, dual feasibility, and complementary slackness:

∇xL(x,λ,μ)=0gi(x)≤0,hj(x)=0λi≥0λigi(x)=0

First-order optimality for unconstrained problems requires:

∇f(x∗)=0

In convex problems, local optima are also global optima under appropriate assumptions.

Common methods include steepest descent, Newton's method, quasi-Newton methods, conjugate gradient, coordinate descent, line search methods, and trust-region methods.

A descent direction p satisfies:

∇f(x)Tp<0

Line search chooses a step length α along that direction. The Armijo condition requires sufficient decrease:

f(x+αp)≤f(x)+c1α∇f(x)Tp

The Wolfe curvature condition limits steps that are too short:

∇f(x+αp)Tp≥c2∇f(x)Tp

Newton's method uses local quadratic curvature:

∇2f(xk)pk=−∇f(xk)

Quasi-Newton methods build an approximate inverse Hessian from gradient changes instead of forming the exact Hessian. BFGS satisfies a secant condition and can maintain positive definiteness under appropriate conditions.

Sequential quadratic programming approximates a nonlinear constrained problem with a sequence of quadratic subproblems. Interior-point and barrier methods keep iterates inside inequality constraints by penalizing proximity to the boundary, often using logarithmic barrier terms.

Constraint qualifications such as LICQ matter because KKT multipliers and first-order optimality statements require regularity. A solver can return a point that is numerically feasible without the optimization result being well-posed.

Optimization results depend on objective choice, constraints, scaling, parameterization, initial guesses, solver method, tolerances, model fidelity, and uncertainty.

Optimization is most valuable when the objective and constraints represent the real design question. A numerically optimal solution to the wrong problem is still the wrong design.

Numerical Methods ​

Numerical methods approximate mathematical operations that are difficult or impossible to solve exactly.

Common tasks include nonlinear equation solving, linear system solving, interpolation, numerical differentiation, numerical integration, ODE integration, optimization, and curve or surface fitting.

Numerical quality depends on truncation error, roundoff error, conditioning, stability, convergence criteria, and solver tolerances.

A linear system may be solved by direct methods such as factorization or iterative methods such as Krylov subspace methods. Direct methods can be reliable for moderate dense systems. Iterative methods are often necessary for large sparse systems.

Condition number describes sensitivity:

κ(A)=∥A∥∥A−1∥

Large condition numbers mean small data perturbations can produce large solution changes.

For ODE integration:

x˙=f(x,t)

a time-stepping method computes approximate states at discrete times. Step size affects accuracy, runtime, and stability. Stiff systems may require implicit methods or specialized solvers.

Interpolation estimates values between known data points. Regression estimates relationships from noisy data. These are different tasks, even when both produce curves through or near data.

Solver warnings, singular systems, nonconvergence, and sensitivity to tolerances are part of the technical result, not software noise.

Newton's method for solving F(x)=0 updates:

xk+1=xk−JF(xk)−1F(xk)

For optimization, the Newton step solves:

∇2f(xk)pk=−∇f(xk)

These methods can converge quickly near a solution but are sensitive to conditioning, initialization, and whether the local model is trustworthy.

Explicit integration methods compute the next state directly from known quantities. Implicit methods solve equations involving the unknown next state. Implicit methods are more expensive per step but can be much more stable for stiff systems.

A numerical result should usually be accompanied by at least one quality check: mesh or timestep refinement, residual size, conservation error, comparison to a limiting case, sensitivity to tolerance, or reproduction of a known result.

Released as open-source vehicle simulation tooling.