Text this: Statistical theory and methodology of trace analysis