MAST90138 · The University of Melbourne · 2023 Semester 2
Multivariate Lab: Seeds & Rainfall
Two assignments from Multivariate Statistics for Data Science, rebuilt as interactive labs. Explore covariance and eigen-decomposition, run a principal component analysis of wheat kernels in your browser, and follow how 365 days of rainfall tell northern and southern Australian weather stations apart.
Every result is reproduced from the original R code. Where the 2023 submission had a bug, an As submitted / Corrected switch shows both.
The coursework
What the assignments asked
Both were individual assignments in R Markdown, submitted in the second semester of 2023.
Assignment 1 · submitted 11 September 2023
Covariance, eigenvectors and PCA
Decide which entries make a 2 × 2 matrix a valid covariance matrix.
Find eigenvalues and orthonormal eigenvectors of a 2 × 2 matrix by hand.
Write the wheat data's sample covariance as S=ΓΛΓ⊤.
Run a PCA: variance explained, ψ, scree plot, PC scatter by variety, correlation circle.
Assignment 3 · submitted 22 October 2023
High-dimensional classification
Explain why QDA and logistic regression fail with 365 predictors and 150 stations.
Logistic regression on q principal components, q chosen by hand-written LOOCV.
A random forest with m tuned by out-of-bag error; Gini importance by day.
A single tree on 50 PLS components, interpreted through correlation curves.
What I built
Three labs
The statistics are ported to TypeScript and checked against R in the test suite: a Jacobi eigen-solver, R's glm.fit with LINPACK's pivoting QR, kernel PLS and the rpart tree-growing algorithm. Your browser recomputes the wheat PCA, every logistic fit, the LOOCV curve (on request) and the PLS tree; the rainfall PCA and PLS scores and the random forests come from R as small JSON files.
Next.js 16, TypeScript, Tailwind CSS 4, KaTeX, Web Workers, Vitest parity tests against R
The original submissions are kept unchanged in the repository for reference. Assignment specifications and the course rainfall files are not published here; tasks are paraphrased and only class-level aggregates and projections of the rainfall data are shown.
Source: github.com/rNLKJA/Unimelb-Master-2023-MAST90138-Assignments (private repository for now)