There are mathematical correlations based on empyrical studies to predict the octane of many refinig products. Most of them use as input PIONA gas cromatographic analysis. So, GC licensors incorporate these correaltions in their software (normally these correlations are too general, they more or less work for any refinery stream, but with a low precision for each specific stream).
There are also specific GC methods for octane determination from GC-PIONA. Some of these studies are published, the most famous being the method developed by Anderson et al. (you can find the references in Google) and tehre are also commercial GC equipment + software specifically designed for this purpose: GC-ON from Grace Davison and Carburane from IFP. These methods include specific correlations for each refinery stream (one correlation for FCC naphtha, other for reformate, and so). Indeed, you basically pay for the correlation developed from a third party, that include the analysis and correlation from a huge number of samples.
Alternatively, you could also developed your own correlation. This will be the most precise, but also the most time and resource consuming (you need support from a laboratory and time to develope your own naphtha samples database).
There are also methods that correalte octane from infrared (or near infrared) spectrometer. But I am not familiar with this specific technique