Calculating SPI with Lognormal Distribution in R?Drought

I am working on calculating the Standardized Precipitation Index (SPI) using the lognormal distribution in R. However, the spei package does not seem to support this distribution. I would like to know how I can calculate SPI with the lognormal distribution in R.

I have also tried using the fitdistr function from the MASS package to estimate the parameters for the lognormal distribution, but I'm unsure about the next steps to calculate SPI based on these parameters.

Any guidance or code examples would be greatly appreciated. Thank you!

Hi, @med1 Welcome to Posit community.
Maybe the function fitmixture in Package ForestFit is helpful to you.

CRAN - Package ForestFit (r-project.org)

{drought} SDI() function will take a lognormal argument