Implement percentage RMSE and bootstrap its CI
GoogleData Scientist · Technical ScreenLast updated
This question evaluates implementation and statistical reasoning skills, focusing on robust numerical computation of percentage RMSE (including handling zeros/negatives, optional country weights, and numerical stability) and nonparametric bootstrap methods for confidence intervals.
Given a CSV with columns [country, actual_revenue, predicted_revenue], define percentage RMSE as pRMSE = sqrt(mean_i((pred_i/actual_i − 1)^2)). a) Implement pRMSE carefully: handle zeros/negatives, optional country weights, and numerical stability. b) Implement a nonparametric n‑of‑n bootstrap to obtain a 95% CI for pRMSE; justify the choice of resample size and discuss when a stratified or cluster bootstrap is preferable. c) What is the exact probability that one bootstrap resample equals the original sample in exactly the same order? Provide the formula in terms of n and explain why it is typically tiny. d) Discuss limitations of bootstrapping this metric (heavy tails, dependence across countries) and mitigations.
Solution walkthrough is for members
Get the full walkthrough with reference code and complexity analysis, plus Kitty Coach at 300 messages a day. Hints, the code runner and community answers stay free.