Open BjornCilleborg opened 5 years ago
Really good questions! All questions (also on the problem sets) should be asked here.
Firstly, on the numerical optimizers:
initial_guess = (I/p)/1
violates this.print(res.message)
to see if the optimizer has converged properly.Common solution: Add options={'maxiter':5000},tol=1e-10
to the optimer calls.
Secondly, on the loops::
Try looking at fac
when N = 5
. The lowest number is 0.25
. I.e. E <= 0
is only satisfied when one of the budget shares is zero. Higher N
is always better in the limit.
I couldn't raise an issue in the PS1 exercise repository, so I am creating it here instead. Feel free to (re)move the post if necessary.
My issue/question is regarding the solvers in PS1: As the utility is dependent on the initial guess how should we define the initial guess so it is robust to a large variance in the denominator?
To illustrate consider the following:
Solution using a constrained optimizer:
Changing
initial_guess = (I/p)/100
toinitial_guess = (I/p)/1
changes the utility from0.768
to0.000
.Conversely, for the solution using an unconstrained optimizer:
Changing the code from
initial_guess = (I/p)/1
toinitial_guess = (I/p)/10000
changes the utility from0.768
to0.000
Looking instead at the loops we consider the code snippet using raw loops:
If we change the original value
N = 15
toN = 6
the utility changes from0.758
to0.768
(same as the the solvers above), however changing it toN = 5
yields a utility of0.000
. How do we determine the "optimal" or correct number of points in each dimension for our linespacing?