Predictions and retrodictions of the hierarchical representation of habitat in heterogeneous environments