Job Search I - Function Inputs

Hi @Gensys,

First, let’s consider what the v_iv object does. We use it only once, when we use it to create the v vector that we iterate on. In other words, v_iv is something like a seed, or an initial value, that we need for the algorithm.

Now let’s see how it’s implemented.

My experience with functions in Julia is that after I have created a function, I specify the inputs (so far I’ve only had parameters as inputs) and the function returns a value.

This is actually what’s happening here. What we’ve said is that v_iv has a default value (a vector of w/(1-b) for each w), but we can deviate from that if we’d like, by calling the function with compute_reservation_wage_direct(params, v_iv = someNewThing).

The reason we do it this way, instead of just defining v_iv as a hardcoded value inside the function, is to allow the user to change it/make the method more flexible.

Hopefully this helps. Please let me know if something is unclear. And no need to apologize for an earnest question; that is why the forum exists.

Yours,
Arnav

Edit: Also, if the Discourse is to be believed, happy birthday.

1 Like