Monte Carlo Profit Simulation & Pricing Grid Search
nutrivetpet · 2025
Rust, Monte Carlo simulation, Grid search, Binomial sampling, Unit economics
Rust implementation of a profit simulator for the two nutrivetpet online services, ported from an earlier R prototype for a ~100× runtime improvement on the full grid search.
Given a user base, two product prices (commercial / mixed), and a purchase probability, the model draws purchaser counts from a Binomial distribution and computes per-sale net profit net of Italian VAT, IRES, IRAP, and Stripe fees.
Three market-mix scenarios (commercial dominates, mixed dominates, or equal share) are weighted by prior probabilities and sampled to produce a distribution of outcomes. A grid search then sweeps price × purchase-rate pairs and reports, for each cell, the expected profit and the probability that net profit clears a configurable ROI threshold.