Compute SPI index