Test how changes in income, spending, and timeline affect your financial goal success probability with actionable recommendations
Drift’s sensitivity analysis reveals which financial levers have the biggest impact on your goal success, helping you make informed decisions about spending cuts, income growth, and timeline adjustments.
interface SensitivityAnalysis { baseProbability: number // Original success probability sensitivities: { [scenarioName: string]: { delta: number // Change in probability (-1 to +1) newProbability: number // Updated success probability impact: number // Absolute value of delta } } mostImpactful: string // Scenario name with largest impact recommendations: string[] // Actionable advice}
From /home/daytona/workspace/source/simulation/sensitivity.py:80-127:
def generate_recommendations( sensitivities: Dict[str, SensitivityResult], base_probability: float) -> List[str]: """Generate actionable recommendations based on sensitivity analysis.""" recommendations = [] # Check spending impact spending_impact = sensitivities.get("spending_minus_10", SensitivityResult(delta=0, new_probability=0, impact=0)) if spending_impact.impact > 0.05: recommendations.append( f"Reducing spending by 10% could improve your success probability by " f"{spending_impact.impact:.0%} (to {spending_impact.new_probability:.0%})." ) # Check income impact income_impact = sensitivities.get("income_plus_10", SensitivityResult(delta=0, new_probability=0, impact=0)) if income_impact.impact > 0.05: recommendations.append( f"Increasing income by 10% (raise, side gig) could boost your odds by " f"{income_impact.impact:.0%}." ) # Check timeline impact timeline_impact = sensitivities.get("timeline_plus_6mo", SensitivityResult(delta=0, new_probability=0, impact=0)) if timeline_impact.impact > 0.05: recommendations.append( f"Extending your timeline by 6 months improves probability to " f"{timeline_impact.new_probability:.0%}." ) # Low probability warning if base_probability < 0.5: recommendations.append( "Your current plan has less than 50% success probability. " "Consider adjusting your goal, timeline, or savings rate." ) # High probability encouragement if base_probability > 0.8: recommendations.append( "You're on track! Your current plan has strong odds of success. " "Stay consistent with your savings." ) return recommendations
The What-If Service generates concrete action plans based on your spending patterns:From /home/daytona/workspace/source/apps/api/src/services/whatIfService.ts:4-10:
interface WhatIfScenario { name: string description: string savingsPerMonth: number projectedSuccessProbability: number implementationTips: string[]}
From /home/daytona/workspace/source/apps/api/src/services/whatIfService.ts:136-171:
private getTips(category: string): string[] { const lower = category.toLowerCase() if (lower.includes('dining') || lower.includes('restaurant') || lower.includes('food')) { return [ 'Cook at home 4-5 times per week', 'Pack lunch for work instead of buying', 'Meal prep on Sundays for the week', 'Use grocery delivery instead of restaurants', ] } if (lower.includes('entertainment') || lower.includes('shopping')) { return [ 'Unsubscribe from unused streaming services', 'Cancel unnecessary subscriptions', 'Set a weekly shopping budget', 'Use 30-day rule for non-essentials', ] } if (lower.includes('travel')) { return [ 'Plan trips during off-season', 'Use rewards points and miles', 'Travel locally more often', 'Split accommodations with friends', ] } return [ 'Track spending in this category weekly', 'Set a specific budget limit', 'Find alternatives or substitutes', 'Gradually reduce over time', ]}
{ "currentSuccessProbability": 0.58, "gap": 800, // Need to save $800/mo more to reach 75% probability "spendingByCategory": { "Dining": 7200, // $600/mo "Shopping": 4800, // $400/mo "Entertainment": 3600 // $300/mo }}
{ "scenarios": [ { "name": "Reduce Dining", "description": "Cut Dining by 50% (save $300/mo from $600/mo)", "savingsPerMonth": 300, "projectedSuccessProbability": 0.68, "implementationTips": [ "Cook at home 4-5 times per week", "Pack lunch for work instead of buying", "Meal prep on Sundays for the week", "Use grocery delivery instead of restaurants" ] }, { "name": "Balance cuts across categories", "description": "Reduce Dining, Shopping, Entertainment to save $800/mo total", "savingsPerMonth": 800, "projectedSuccessProbability": 0.76, "implementationTips": [ "Identify your most flexible categories", "Set specific spending limits", "Track weekly spending", "Build in occasional treats to stay motivated" ] }, { "name": "Increase income", "description": "Earn $80/mo more (1.2% raise or side income)", "savingsPerMonth": 80, "projectedSuccessProbability": 0.61, "implementationTips": [ "Ask for a raise or promotion", "Develop side hustle (5-10 hrs/week)", "Freelance in your skill area", "Negotiate better salary at next job" ] } ]}