Compute ancestral character states from discrete variables