Pātuhitia tēnei: Simulation and optimization in finance