Sutton & Barto compare the objectives a linear value function could minimise, and finds that they disagree. Given a Markov reward process, compute the value function each one picks out.
Write objective_minimizers(X, transitions, start_probs, gamma):
X has shape (n_states, d): one feature row per non-terminal state.transitions is a list of (s, p, r, s_next) tuples: from state s, with probability p, reward r and next state s_next (-1 for the terminal state, whose value is 0 and whose feature vector is zero).start_probs[s] is the probability that an episode starts in s.Use the on-policy distribution : expected visits (with the start distribution and the non-terminal transition matrix), normalised to sum to 1. Let be the expected reward from and . Find:
Solve each with np.linalg.lstsq (for the TD fixed point, apply it to that linear system). Return a dict with keys "VE", "BE", "TDE", "TD", each mapping to the value vector rounded to 4 decimals (add 0.0 to avoid -0.0).