Implement Sampling and Minimize Loss in Numerical Coding
GoogleData Scientist · Technical ScreenLast updated
This question evaluates proficiency in probability and numerical methods, focusing on sampling from truncated distributions and analytical properties of estimators under various loss functions.
Scenario
Numerical coding challenges on sampling and loss minimization.
Question
a) Implement functions to sample from truncated normal distributions for x>1, 4<x<4.05, and x>4. b) For an array X, find the value minimizing Σ(x−θ)², then the value minimizing Σ|x−θ|, and derive the loss that yields the 90th percentile.
Hints
Use rejection or CDF-inverse methods; derivatives show mean, median, and quantile solutions.
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.