A Step-by-Step Tutorial on Active Inference and its Application to Empirical Data