Economic flat earth created by ReturnFn?

I’m confused by the behavior of this part of my return function:

%% Allow/Disallow some trivial agent decisions
if (sprime-s>0 && aprime+hprimecost<0 ...             % Cannot buy shares with negative net worth
    || agej*ypp>=11 && aprime<-f_coll*hprimecost ...  % Collateral constraint on borrowing (for older buyers that earn real money)
    || hprime<h && aprime<0 ...                       % Cannot sell down a house that is collateralized
    || agej>=Jr && aprime<0)                          % Ban pensioners from negative assets
    return 
end

In particular, the -Inf return values resulting from the last clause (banning pensioners from negative assets) seems to be poisoning the mapping of what should be reasonable choices reachable within the model. To be sure, I gave pensioners a HUGE pension, which in the periods after retirement, but before my problems start, their stock/asset surface is higher than any pre-retirement age. So there’s absolutely no reason for them to try to take a bank loan, especially if it’s forbidden.

Alas, like toddlers being told they can do anything but the one thing you tell them to not do, my ReturnMatrix for pensioners, well past age Jr but well before the final age J, is just a single NaN and a the rest of the values are -Inf.

When I add a bit of logic to give the pensioners hitting this clause a negative (but not infinitely negative) return value, such as the aforementioned aprime then we get a return matrix that has an albeit flat texture for that age:

if agej>Jr && aprime<0
    F=aprime; % return something to see it reflected in final result
    % The result is a plane at z=-1, the minimum value of aprime
end

Another detail I should add is that I observe this behavior when I have a model with no shocks (I have a z_grid, but z’s value is 1 everywhere). When I add some shocks (both z and e types), then the problem disappears. Hence the question about the flat earth: is it a combination of a shockless world in which the decisions about optimality are so straight and narrow that an edge condition can somehow affect all the non-edges? How large of an edge does there have to be before everything falls off it? In my case, it seems that having a condition where aprime=-1 results in a universally rejected value function, even though there ought to be plenty of choices for non-rejected value functions.

What am I missing?

Not obvious. My suggestion is to try setting beta=0 (the discount factor equal to zero), then solve the ValueFnIter… problem. This should give you essentially just the ‘optimal return function’ values back, and people are solving a one period problem so they will set aprime to its minimum value which is 0 (as you put -Inf if they choose aprime<0). If you don’t observe a reasonable ‘optimal return fn’ and people choosing aprime=0, then something is up.

My other thought: what is the mean value of ‘z’? If you put a constant in the version without shocks that equals the mean of z, in the position z would appear, does this resolve things?

PS. The advantage of the beta=0 setting is you can easily think through exactly what you should see for optimal behaviour, once you eliminate the dynamic expecations aspects the remaining problem tends to be pretty simple. So it is easy to check that you get the answer you know you should get.

Thanks for the response!

I just wanted to clarify that aprime’s minimum value is set to -1 so that agents can take out a loan equal to the cost of minhouse. (And for completeness, that minimum value has the index value of 1 on the grid, for all those of you who, like me, think of that as index zero.)

The mean value of z is 1 (after exponentiation) in both cases. In the case where the matrix has only a single value, that single value is 1 (after exponentiation), so it changes nothing.

I hadn’t thought of changing beta to zero, since it typically lives near one, but I see the point and will add it to my thinking.