Free Worked Samples
Verified sample problems from Exam ATPA
Sample 1 · Bayesian Inference, Conjugate Priors & MCMC Diagnostics
TF-IDF Vectorization and Cosine Similarity
From a corpus of N=40 bodily-injury claim notes, three keywords (whiplash,collision,towed) appear in df=(2,8,20) documents, respectively. Using tf-idft,d=tft,dln(N/dft), Note A has raw counts (2,1,0) and Note B has (1,2,1). What is the cosine similarity between the TF-IDF vectors of Note A and Note B?
- 0.7303
- 23.1294
- 3.4706
- 0.8375
Answer: (D) 0.8375
IDF Weights and TF-IDF Vectors
Compute idft=ln(N/dft) and multiply by term frequencies.
idf=(2.9957,1.6094,0.6931) u=(5.9915,1.6094,0.0000),v=(2.9957,3.2189,0.6931) Cosine Similarity
Normalize the inner product by vector Euclidean norms.
u⋅v=23.1294,∥u∥2=6.2039,∥v∥2=4.4515 cos(θ)=(6.2039)(4.4515)23.1294=0.8375 ATPA Executive Recommendation and Scoring Rubric
Rubric bullets for Exam ATPA response: (1) Explain why TF-IDF + cosine similarity prevents longer adjuster notes from dominating similarity scores and emphasizes rare, diagnostic claim terms; (2) Recommend truncated Singular Value Decomposition (SVD / Latent Semantic Analysis) to compress sparse high-dimensional TF-IDF matrices into dense topic features for downstream GLMs/GBMs; (3) Document text-cleaning safeguards (lemmatization, stop-word removal, and scrubbing PII/protected-class tokens before modeling).
Second check: Unit-sphere distance identity: 1−21∥u^−v^∥22=1−21(0.3250)=0.8375.
- A
- Computes cosine similarity on raw term frequencies without IDF down-weighting common terms.
- B
- Reports the unnormalized dot product u⋅v without dividing by ∥u∥2∥v∥2.
- C
- Reports the Euclidean distance ∥u−v∥2 instead of cosine similarity.
Sample 2 · Neural Networks, Regularization & Text Analytics
Class-Weighted Log-Loss Calibration for Imbalanced Claims
An insurer's fraud portfolio has base fraud prevalence π=8.0%. To address class imbalance, a logistic classifier is trained with balanced inverse-prevalence weights w1=2π1=6.250 for fraud and w0=2(1−π)1=0.543 for non-fraud. On a new claim, the weighted model outputs raw score p~=0.65. What is the prior-recalibrated true fraud probability p?
- 13.90 \%
- 5.20 \%
- 65.00 \%
- 95.53 \%
Answer: (A) 13.90 \%
Log-Odds Prior Shift Removal
Subtract the log weight ratio ln(w1/w0) from the weighted model's log-odds.
logit(p~)=ln(0.350.65)=0.6190,ln(w0w1)=ln(0.5436.250)=2.4423 logit(p)=0.6190−2.4423=−1.8233 Calibrated Probability
Apply the inverse logit function.
p=1+e−(−1.8233)1=0.1390=13.90% ATPA Executive Recommendation and Scoring Rubric
Rubric bullets for Exam ATPA response: (1) Explain why SMOTE or class-weighted log-loss sharpens minority-class recall during training but inflates predicted probabilities above true portfolio prevalence; (2) Require prior-offset recalibration (or Platt/isotonic calibration) whenever predicted probabilities drive financial reserving or expected-loss triage; (3) Warn explicitly to apply SMOTE/resampling strictly inside each cross-validation training fold—never before splitting—to prevent synthetic data leakage.
Second check: Direct Bayes odds check: p~w0+(1−p~)w1p~w0=13.90%.
- B
- Multiplies p~ linearly by π instead of adjusting on the log-odds scale.
- C
- Uses the uncalibrated pseudo-probability p~ directly without correcting for 50%/50% class weighting.
- D
- Adds +ln(w1/w0) instead of subtracting it from logit(p~).
Sample 3 · Imbalanced Data, Resampling & Actuarial Ethics
SHAP Additive Attribution and Local Accuracy Check
A two-feature gradient-boosted pure-premium model has baseline portfolio expectation \phi_0 = v(\emptyset) = $500. For a given driver profile x=(x1,x2), the marginal coalition expectations are v(\{1\}) = $700 (age only), v(\{2\}) = $580 (prior violations only), and full prediction f(x) = v(\{1, 2\}) = $870. What is the exact Shapley value ϕ1 attributed to driver age?
- $490.00
- $200.00
- $245.00
- $290.00
Answer: (C) $245.00
Coalition Marginal Contributions
Evaluate the marginal impact of adding feature 1 in both permutations ({1},{2}) and ({2},{1}).
Δ1(∅)=v({1})−v(∅)=700−500=200.00 Δ1({2})=v({1,2})−v({2})=870−580=290.00 Exact Shapley Value $\phi_1$
Average across the 2!=2 feature orderings.
ϕ1=21(200.00+290.00)=$245.00 ATPA Executive Recommendation and Scoring Rubric
Rubric bullets for Exam ATPA response: (1) Verify local accuracy (efficiency): \phi_0 + \phi_1 + \phi_2 = $500 + $245.00 + $125.00 = $870.00 = f(x); (2) Contrast interventional vs. conditional SHAP backgrounds when rating variables are correlated (e.g., credit score and ZIP code); (3) Connect SHAP attributions to ASOP No. 56 governance, model risk validation, and transparent adverse-action notices in underwriting.
Second check: Additive efficiency check: \phi_0 + \phi_1 + \phi_2 = $500 + $245.00 + $125.00 = $870.00 = f(x).
- A
- Sums both permutation marginal contributions without dividing by 2!.
- B
- Uses the first-order marginal contribution v({1})−v(∅) alone, ignoring the interaction split.
- D
- Assigns the entire interaction term to feature 1 via v({1,2})−v({2}).
Sample 4 · Bayesian Inference, Conjugate Priors & MCMC Diagnostics
Conjugate Bayesian Posterior Mean and Credibility
An actuary models Poisson claim frequency λ using a conjugate Gamma prior λ∼Gamma(shape α=15,rate β=40). Over n=80 new exposure-years, S=32 claims are observed. What is the Bayesian posterior mean E[λ∣S]?
- 0.4000
- 1.1750
- 0.3750
- 0.3917
Answer: (D) 0.3917
Conjugate Gamma Posterior
Update shape α′=α+S and rate β′=β+n.
α′=15+32=47,β′=40+80=120 E[λ∣S]=β′α′=12047=0.3917 ATPA Executive Recommendation and Scoring Rubric
Rubric bullets for Exam ATPA response: (1) Frame the posterior mean (0.3917) explicitly as a credibility-weighted blend (Z=0.67) between emerging territory experience and industry prior knowledge; (2) Note that conjugate updating automatically shrinks volatile small-sample estimates toward the prior mean while preserving full posterior uncertainty; (3) Recommend transitioning to hierarchical Bayesian MCMC when sharing information simultaneously across multiple correlated rating cells.
Second check: Credibility weighting check: Z=n+βn=0.6667, Zxˉ+(1−Z)μ0=0.3917.
- A
- Uses the unsmoothed maximum likelihood sample average, ignoring prior credibility.
- B
- Fails to update the denominator/rate parameter with exposure n.
- C
- Reports the prior mean without updating for observed claims.