Portfolio choice with housing (model 35): down payment, mortgage repayment, home equity, and housing value dynamics

EZ prefs are coded. Codes in same place as linked above. Cleaned the ReturnFn. I’ll hopefully create pdf explaining model tomorrow.

2 Likes

pdf explaining the model with Epstein-Zin preferences is now in the repo:
https://github.com/robertdkirkby/riskyassetsemiz

pdf might be missing some detail, let me know if something needs elaboration

2 Likes

I am working on a similar model: portfolio choice with housing. I am trying to modify the code to allow for two permanent types: fixed education type and fixed patiente types. Education and subjective patiente are both important drivers of financial choices.
How do I set up this in the toolkit? I have two education types (no college and college) and two patience types (low and high)

2 Likes

Interesting question! Here is one way of doing it

You combine the two permanent types together, getting 4 permanent types. Specifically, you led education vary first and define

t1: e low, beta low
t2: e high, beta low
t3: e low, beta high
t4: e high, beta high

where e denotes education and \beta denotes patience

Then

Names_i={'t1','t2','t3','t4'};

Then if you have a parameter, say kappa, that depends on the fixed types, you can code it as

kappa.t1 = 0.1;
kappa.t2 = 0.2;
kappa.t3 = 0.3;
kappa.t4 = 0.4;

Finally, do not forget to set the probability distribution for the permanent types:

%% How many of each permanent type are there
PTypeDistParamNames={'alphadist'};
Params.alphadist=[0.25,0.25,0.25,0.25]; % Must sum to one

(I copied from one of Robert’s examples)
Last but not least, you have to invoke all commands with _Ptype suffix

Hope this helps!

3 Likes

Thanks, this is helpful! I have some parameters that depend on education only (i.e. fixed cost of participation) and others that depend only on patience type, i.e. subjective discount factor. I actually don’t have any parameter that depends on both fixed types simulatneously. For the discount factor, for example, can I write

beta.t1 = 0.85;
beta.t3 = 0.95;
?

More generally, when I set the initial distribution, I have some statistics like mean and standard deviation for each type and their correlation rho, so I cannot set the discrete mass as your example shows.

1 Like

Uhmm I’m not sure. I think that if you follow my method, the toolkit will think that there are always 4 permanent types, so whenever a paramter is type dependent, you have to write 4 different fields

3 Likes

As Alessandro described, you have to set this up as four permanent types. This is because VFI Toolkit only understands a single layer/level of permanent types [adding two layers is something I want to do at some point, so you could have e.g., three countries and within each country have five income levels, but is currently not high on my list of things to implement]

If you use the setup described:
t1: e low, beta low
t2: e high, beta low
t3: e low, beta high
t4: e high, beta high
where e denotes education and β denotes patience

Then you just set parameters something like

Params.beta.t1=0.8;
Params.beta.t2=Params.beta.t1;
Params.beta.t3=0.9;
Params.beta.t4=Params.beta.t3;

when I set the initial distribution, I have some statistics like mean and standard deviation for each type and their correlation rho, so I cannot set the discrete mass as your example shows.
You can do this by setting up the initial distribution as a multivariate-normal on the grids that you are using. This is done using the command MVNormal_ProbabilitiesOnGrid()
You can see examples using this command in Life-Cycle Model 46 (although it is hidden inside LifeCycleModel46_InitialDist.m) and also in the example for Huggett, Ventura & Yaron (2006) (although it is hidden inside HuggettVenturaYaron2006_jequaloneDistFn.m) and in the example for Borella, De Nardi & Yang (2018).
[Note: the ‘hiding’ is because both of those examples calibrate/estimate the parameters of the normal distribution]
[It is possible I misunderstood what you meant by your comment as I am not entirely certain you asked what I answered, if so please let me know]

2 Likes

Thanks I will follow this set up

Params.beta.t1=0.8;
Params.beta.t2=Params.beta.t1;
Params.beta.t3=0.9;
Params.beta.t4=Params.beta.t3;

For the initial distribution I cannot set it up as a bivariate normal because education and patience are discrete random variables with two points each (low and high education, low and high patience). I want them to have a certain mean and variance and a given correlation between the two.

I think I understand now. What you want are two dimensions of permanent type: e (education) and beta (patience). And the values they take are correlated.

The way to do this is to take your joint distribution over e and beta and discretize it into some values for e and beta, and probabilities for those values. I am going to assume it is bivariate normal for simplicity. So what you want to do then is to discretize the bivariate normal disribution
[e; beta] \sim N(\mu,\Sigma)
(where \mu is 2-by-1 and \Sigma is 2-by-2)

VFI Toolkit has two quadrature methods that can do this, Tauchen ( discretizeVAR1_Tauchen) and Farmer-Toda (discretizeVAR1_FarmerToda). [Note: bivariate normal is a bivariate VAR with zeros for the coefficents on lags, same as Normal is an AR(1) with zero autocorrelation.]

Either of these two methods will create a grid on e, a grid on beta (possibly a joint-grid on e and beta, depends on which method), and probabilities for (e,beta).

You then use the grid on e as Params.e, and the grid on beta as Params.beta, and use the probabilities on (e,beta) as the distribution over permanent types.

PS. If this is not what you want, please explain the exact equations that e and beta have to follow. [You can email me a pdf of the write up of the model equations if you like.]

PPS. Technically, two points on each with associated probabilities will give a mean, variance and correlation for the two. The approximation would be very poor, but it is possible to perform the approximation. In practice though, you want to use more points.

PPPS. What I just described is unrelated to the initial distribution (there is not point putting permanent types as dimensions of the initial distribution unless you need it for other reasons)

1 Like