PDSim: A Shiny App for Simulating and Estimating Polynomial Diffusion Models in Commodity Futures

Peilun He, Nino Kordzakhia, Gareth W. Peters, Pavel V. Shevchenko

Published: 2024/9/28

Abstract

PDSim is an R package that enables users to simulate commodity futures prices using the polynomial diffusion model introduced in Filipovic & Larsson (2016) through both a Shiny web application and R scripts. For user-supplied data, a standalone R routine has been developed to provide joint estimation of state variables and model parameters via the Extended Kalman Filter (EKF) or Unscented Kalman Filter (UKF). With its user-friendly interface, PDSim makes the features of simulations and estimations accessible. To date, it is the only package specifically designed for the simulation and estimation of the polynomial diffusion model. The Schwartz-Smith two-factor model (Schwartz & Smith, 2000) is also available within this package for both simulation and calibration. The package is validated through several tests, including replication of the results in Schwartz & Smith (2000), unit testing of the coverage rate, and verification of the outputs of the main functions.