πŸ“˜ FIT2086: Modelling for Data Analysis

Map of Content

Index for FIT2086 Modelling for Data Analysis β€” the statistics spine of the DS degree; W0–1 revision is shared with FIT1058_MOC and FIT1043_MOC, not duplicated.

πŸ“Š Assessment Map

  • Assignment 1 (10%, due W5) Β· Assignment 2 (20%, due W8) Β· Assignment 3 (20%, due W11) βž” carry the whole in-semester half; all involve implementing models in R (LO5).
  • Final exam (50%) βž” (Studio 12 sample paper) nine sections β€” short answer Β· MLE Β· random variables Β· CI & -values Β· regression Β· classification Β· logistic regression Β· bias & variance Β· machine learning β€” all hand-worked, with a formula sheet and table supplied βž” FIT2086 Unit Cheatsheet.
  • LO map βž” LO1 EDA/descriptive (W1–2) Β· LO2 inferential models (W3–5) Β· LO3 predictive models (W6–9, W11) Β· LO4 sampling/simulation/testing (W3, W5, W10) Β· LO5 implement in R (W6–11) Β· LO6 interpret results (W4–11).
  • LO thread so far βž” W1–2 probability models βž” W3–4 fit (MLE), judge (bias/var/MSE), bound (CI) [A1] βž” W5 test βž” W6–7 linear + logistic regression, predictor selection [A2] βž” W8 complexity control (tests Β· IC Β· CV Β· ridge/lasso) βž” W9 trees Β· forests Β· kNN βž” W10 simulation (Monte Carlo Β· bootstrap Β· permutation) βž” W11 unsupervised (k-means Β· mixtures/EM Β· imputation) [A3] βž” W12 revision of L1–L9 + sample paper.

🧰 Toolkit Cheatsheets

  • FIT2086 Unit Cheatsheet β†’ the paper-exam crib: every hand formula with its precondition, πŸ“„ marks what the formula sheet supplies, Studio 12 exam anatomy + model short answers
  • R Toolkit (Cheatsheet) β†’ dual-unit (FIT1043 + FIT2086); FIT2086 blocks: simulation/distributions Β· hypothesis tests Β· lm/step Β· glm/pROC Β· glmnet Β· trees/forests/kNN Β· resampling (hand loops + boot/boot.ci)

πŸ“… Knowledge Index

Week 0 β€” Self-Study / Revision

Week 1 β€” Modelling, Probability & Random Variables

Week 2 β€” Expectations & Probability Distributions

Studio 1 (run in W2 β€” R foundations, heart.csv / Mushroom.csv / wine.csv)

Week 3 β€” Parameter Estimation, Maximum Likelihood & Estimator Quality

Studio 2 (run in W3 β€” drills the W2 distributions; no new notes, merged into the existing four)

  • Gaussian Distribution β€” -table lookup with linear interpolation ( worked three ways); is why the -rules are scale-free
  • Binomial Distribution β€” term-by-term pmf interpretation; a named sequence has no ; fair-coin tails by hand
  • Poisson Distribution β€” additivity run backwards (/week βž” /day); β€œat least one”
  • Uniform Distribution β€” cdf derivation, by integration, out-of-support probabilities are zero
  • Parametric Probability Distributions β€” the family selection drill (15 described variables βž” verdict + reason)
  • R Simulation and Random Sampling β€” running-mean accumulator + the WLLN convergence plot; why converges faster than

Week 4 β€” Central Limit Theorem & Confidence Intervals

Studio 3 (run in W4 β€” drills the W3 estimation material; train.csv / test.csv)

Week 5 β€” Hypothesis Testing

Studio 4 (run in W5 β€” drills the W4 CLT/CI material; train.csv / test.csv / SP500.csv)

Week 6 β€” Linear Regression & Model Selection

Studio 5 (run in W6 β€” drills the W5 hypothesis-testing material; bpdata.csv / SP500.csv)

Week 7 β€” Classification & Logistic Regression

Week 8 β€” Model Selection & Penalized Regression

Studio 7 (run in W8 β€” drills the W7 logistic-regression material; gene.*.csv / pima.*.csv)

Week 9 β€” Trees & Nearest Neighbour Methods

Studio 8 (run in W9 β€” drills the W8 selection/shrinkage material; gene.*.csv / pima.*.csv / wrappers.R)

Week 10 β€” Simulation-Based Statistical Methods

Studio 9 (run in W10 β€” drills the W9 trees/forests/kNN material; diabetes.*.csv / wrappers.R)

Week 11 β€” Introduction to Unsupervised Learning

Studio 10 (run in W11 β€” drills the W10 resampling material; bpdata.csv / pima.*.csv / studio10.prediction.stats.R / perm.log.reg.R)

  • Resampling Inference in R (boot, boot.ci, perm.log.reg) β†’ Parent Framework: Bootstrap (LO5 hand skill: boot βž” boot.ci basic/BCa; permutation vs Wald -values)
  • Bootstrap β€” merged: vs basic vs BCa on BSA, median se and its spiky bootstrap distribution, the AUC interval inherits training optimism
  • Permutation Tests β€” merged: global null vs conditional Wald test, Monte Carlo noise at , reading INS/BP null histograms, the shipped code’s zeros

Week 12 β€” Revision

Studio 12 (run in W12 β€” sample exam questions)

Revision sheets (L1–6 formula summary + W7–9 worked examples)

πŸ”­ Outline topics not seen in the material

  • Dirichlet Β· exploratory vs confirmatory analysis Β· Bayesian classification & inverse probability (closest: the posterior in Mixture Models (EM Algorithm)).

🧭 Suggested Reading Order

(read left→right · bold = assessment-critical)

🎯 Learning Outcomes (key skills per week)

  • W0 βž”
    • classify data (nominal/ordinal/discrete/continuous)
    • compute + interpret centrality (, median, mode) and spread (range, , , percentiles/IQR, boxplots)
    • read Pearson correlation and know independence
    • apply the log/exp identities and differentiate (power/log/exp, product, chain, partial) toward log-likelihoods
  • W1 βž”
    • separate population/sample/model Β· sampling/inference/model-checking Β· three sources of randomness
    • state a pmf (, ); apply inclusion–exclusion
    • joint marginal (sum rule) conditional (product rule); test independence; write the iid product
    • continuous: is not a probability, , split piecewise integrals
    • derive cdf pdf, survival , quantile , mode
    • in R: set.seed, sample, the d/p/q/r family
  • W2 βž”
    • compute , , from a pmf
    • apply linearity and ; know products need independence
    • read population / and why independence
    • state the WLLN; test whether exists at all
    • derive and
    • select a family by support: Β· Β· Β· Β· , with each mean/variance
    • (Studio 1) subset a data frame by condition; write an R function returning a list; factor + table + prop.table; screen predictors with cor
  • W3 βž”
    • separate the three inference tasks: point / interval / hypothesis testing
    • derive an MLE cold: β†’ β†’ β†’
    • quote , , ,
    • use the plug-in distribution for probability statements
    • derive and say what naming the family buys
    • compute , , ; rank by efficiency; test consistency
    • (Studio 2) read a -table by interpolation; justify a family choice from a data description; code an running mean and read a convergence plot
  • W4 βž”
    • state the CLT for sums and derive from it
    • approximate by and by
    • recognise an estimator as an average ⟹ asymptotically normal
    • derive the interval by inverting
    • select among the four CI cases: known Β· unknown Β· difference of means Β· CLT-approximate
    • state coverage correctly (procedure, not the one interval) and read a difference CI containing zero
    • (Studio 3) derive the Bernoulli MLE and explain ML’s boundary overconfidence
    • (Studio 3) fit on train, predict with pnorm, check against empirical proportions, rank models by held-out NLL
    • (Studio 3) code a simulation study returning bias/variance/MSE, and read RelMSE for efficiency vs robustness
  • W5 βž”
    • set up vs and identify one-sided vs two-sided from the wording
    • define a -value as and grade it ( / )
    • select the test: known Β· unknown small- Β· large- approximate Β· two-sample difference
    • compute / by hand and bracket with tabulated criticals
    • test a proportion via the CLT, pooling for two Bernoulli samples
    • explain why a large never proves , and why -thresholding is deprecated
    • (Studio 4) state how CI width scales with and ( data to halve the width); read at any
    • (Studio 4) write calcCI cold and report an interval as a sentence about the population
    • (Studio 4) build a difference-of-means CI for two groups and read it against zero
    • (Studio 4) derive , , MSE, consistency and the CLT limit for the Bernoulli
    • (Studio 4) simulate coverage and explain why plug-in intervals undercover at small
  • W6 βž”
    • separate classification (categorical target) from regression (numerical target)
    • write ; read each as a per-unit change
    • fit by least squares; state , , and the requirement
    • compute and say why it can never select a model
    • derive ⟹ LS ML; quote vs
    • build indicators, polynomial terms, and interaction columns
    • rank predictors by , test , score models by
    • contrast AIC (, overfits) with BIC (, underfits); is significant
    • search all-subsets vs forward/backward stepwise; run step(…, k = log(n)) in R
    • (Studio 5) run t.test with the right mu, alternative, conf.level and var.equal
    • (Studio 5) explain why weakens the evidence, and read a of correctly
    • (Studio 5) judge a large effect with a borderline β€” demand a larger trial, not a verdict
    • (Studio 5) compare approximate , Welch and pooled on one difference, and say which interval is overconfident
    • (Studio 5) test one and two proportions by hand, then check against binom.test / prop.test
  • W7 βž”
    • separate classification (categorical ) from regression; predict by
    • count joint cells β€” the curse of dimensionality that kills direct estimation
    • convert odds probability , and read as log-odds per unit
    • derive the Bernoulli NLL ; state convex, no closed form
    • compute , , from a confusion matrix, against the class-frequency baseline
    • compute AUC by hand from ranked scores, and say what log-loss adds that AUC cannot
  • W8 βž”
    • define and over repeated training samples
    • state and add for predicting a new β€” irreducible
    • map underfitting βž” high bias/low variance and overfitting βž” low bias/high variance; say what more does and doesn’t fix
    • compute expected false positives and the Bonferroni threshold ; distinguish FWER from FDR
    • write AIC , KIC , BIC , RIC and say which over/underfits
    • describe -fold, repeated -fold and LOO CV, and choose a model by smallest CV error
    • explain why all-or-nothing subset selection is statistically unstable
    • write the penalised LS objective, justify standardising, and read a path
    • contrast ridge (, stable, no zeros) with lasso (, sparse, biased large coefficients); pick by CV then refit on all data
    • explain penalisation as adding bias to cut variance, and why it helps with multicollinearity and
    • (Studio 7) fit glm(…, family = binomial) and read deviance, AIC deviance , and each -test
    • (Studio 7) predict probabilities with type = "response", threshold at , and score CA/sens/spec/AUC/log-loss on test data
    • (Studio 7) prune with step at k = 2 / 3 / log(n) and argue BIC (interpretable) vs KIC (predictive)
    • (Studio 7) add log(), I(x^2) and a*b terms and justify each from its -value and deviance drop
    • (Studio 7) write a pruned model’s log-odds equation and read each coefficient’s effect
  • W9 βž”
    • explain how a tree partitions predictor space into leaves and predicts with each leaf’s Bernoulli/Normal model
    • compute a leaf’s minimised NLL and pick the purer split
    • explain why splitting never raises the NLL ⟹ size trees by IC, pruning, or -fold CV over
    • explain how bootstrap samples and random candidate variables let a forest cut variance, and what it costs in interpretability
    • apply kNN: Euclidean distance on standardised predictors, then vote / average / kernel-weighted average
    • choose , distance and kernel by LOO CV
    • (Studio 8) derive bias, variance and MSE of , find where it beats , and prove it is the ridge solution
    • (Studio 8) count false discoveries against , apply Bonferroni, and run RIC stepwise with k = 2*log(p)
    • (Studio 8) fit lasso/ridge with cv.glmnet.f, read the lambda.min coefficients, and compare with BIC stepwise on test data
    • (Studio 8) explain why penalisation beats stepwise when is small relative to
  • W10 βž”
    • write and prove convergence via indicator βž” Bernoulli βž” WLLN
    • state the resolution and size for a rare event
    • approximate , , quantiles and from simulated draws
    • explain a PRNG as a seeded deterministic recurrence; trace an LCG
    • enumerate an exact bootstrap () and compute its bias and variance by hand
    • run the bootstrap algorithm: resample rows with replacement, refit, take percentiles for a CI
    • say why bootstrapping training MSE does not remove its optimism, and how bagging cuts a tree’s variance
    • justify a permutation test from and compute
    • choose CV vs bootstrap vs permutation test from the question asked
    • (Studio 9) read an rpart print-out and follow a new individual to its leaf
    • (Studio 9) size a tree with learn.tree.cv and compare test RMSE against a lasso benchmark
    • (Studio 9) read a forest’s OOB error, % Var explained and %IncMSE; tune ntree
    • (Studio 9) choose and kernel with train.kknn and predict with fitted(kknn(…))
    • (Studio 9) score tree/forest classifiers by probability ([, 2], type = "prob") and kNN by accuracy only
  • W11 βž”
    • contrast supervised with unsupervised structure in
    • run k-means by hand: assign to the nearest centroid, re-centre, stop when nothing moves
    • state the WCSS objective , why seeds give local minima, and what k-means++ changes
    • list k-means’ limitations: hard assignment, mixed attributes, no statistical reading, choosing
    • write the mixture density and the conditional-independence product
    • compute posterior memberships and assign by the largest
    • describe EM (E-step soft assign, M-step weighted ML) as a generalisation of k-means
    • choose by an information criterion / MML and say why the search needs split/merge/restart moves
    • read and of a multivariate normal off a scatter; name the spherical/diagonal/elliptical structures
    • compare univariate, multivariate-normal and kNN imputation; impute a ratings matrix with kNN on co-observed columns
    • (Studio 10) write a boot statistic function(data, indices) and get basic and BCa intervals with boot.ci
    • (Studio 10) explain the spiky bootstrap distribution of a median
    • (Studio 10) bootstrap a refitted model’s AUC and say why the interval does not remove training optimism
    • (Studio 10) run a coefficient-wise permutation test on a glm and explain why its -values differ from the Wald -values
  • W12 βž”
    • answer a definition question as what it is + one or two properties, in 2–3 sentences
    • separate what the formula sheet supplies (known- CI and -test, differentiation rules, table) from what must be recalled (pmfs, means/variances, MLEs, , , IC penalties)
    • read a -value off the table at the nearest row, double it for two-sided, and grade the evidence
    • label every / step as linearity (always) or independence (needs it)
    • judge a predictor by comparing across its values, and judge logistic regression’s fit by whether a straight boundary separates the classes
    • score a model table by AIC and BIC by hand, and diagnose under/overfitting from the training vs held-out error gap