You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The most elegant solution in the project was:
Before running the code, the illustration of the random draws in question 7 is a great idea. Your illustration in question 1 is also nice (it does plot it twice when the code is run, maybe because both the py.file and the notebook plots it. Also endowment B is very hard to see, as it is behind all the possible allocations).
However, when the code is run for q7 it returns the error "'TotalEndowments' object has no attribute 'pareto_improvements'". This may because it is trying to reference a different py.file, queston1, not entirely sure. An idea to improve question 7 would be to include consumer B (as far as I can tell in the code from question7.py, this was also the intention, at least there is a "label = endowment B").
The hardest section of code in the project to understand was:
The answer to question 2 and 3 is a bit messy. First off, it would be a much smoother and easier to read, if all parameters were defined in the beginning and all following code was gathered in one place instead of 11 different py.files and different classes. This way, it would only be necessary to define endowments, alpha and beta once, only need to define demand etc. once instead of in every py.file. And especially since you've also done it in your notebook for question 2.
For question 2 (and onwards), since p2=1 and does not change, it seems maybe a bit redundant to have every equation depend on this as well as p1, as it does not really make a difference for the outcome. It just adds complexity to the code and another thing to keep track of - it could further be a potential error, if accidentally using p1 instead of p2 or the other way around. For this question also, maybe either illustrate your errors in some diagram or only show maybe first 5 and last 5 – or just some of them at least, the list is very long and not very enlightening.
For the solution to q3, you've defined: initial_guess = ((0.5+3)*1/N, 1) - why is it +3? Adding to the point of not including p2=1 in your equations, setting bounds on p2 would be unnecessary – especially since it is set to be 1 and not a changeable variable, so putting bounds on the value seems redundant.
Also, not entirely sure why the errors are squared for this question, but that may be correct and/or best way to go.
This part of the project could be better documented:
While you do print fine for most of the questions, it would be nice if the answers were more detailed – especially for questions 5a and b, but also 4 and 6. For 4a (4b returns and error, but based on the print, this could be applied here too) could e.g. be what consumer B ends up getting and utility both consumers get. Same goes for questions 5 and 6. And maybe limit the number of decimals you print to maybe 3 or 5, this goes for all questions and not just these 3.
What is happening down in question 8 could also be documented a lot nicer. First off, why have you chosen a different seed from question 7? Second, right now, it first prints a lot of p1 prices, which seems redundant by themselves. Then it prints a lot of allocations, which is just fine and a good idea, but it looks like it prints in pairs of at least 6? Not sure how many are in between, it shows “…”, but there is probably some mistake here assuming it was the idea to print pairs of 2 or 4 maybe?
An idea for an improvement/clarification could be:
It is nice that you have the comments for the codes going along but would also be very nice if you added a markdown cell and just briefly explained what you were about to do overall (what the question is asking). This would very much improve readability. In addition, when importing the template, it starts at question 2.1, then goes to 1 and so on – maybe delete the 2.1 markdown cell and the “note the following” as well.
As already mentioned, instead of having separate py.files for all questions, gather them in one. Further, it says very clearly in the “note the following” cell in the very top, that “1. The inauguralproject.py file includes a function which can be used multiple times in this notebook.” - your file is empty besides a squared function with no arguments. It is much easier to keep track of what you’re doing – and would hopefully limit number of potential mistakes – if everything was gathered in one file.
It looks like in 4b is that you’ve written “x1A, x2A = demand_A(p1), return -utility_A(x1A, x2A, alpha)” and not self.demand_A and self.utility_A. This might help with the error-message.
An idea for an extension could be:
While it would make sense to delete p2=1 as the code is now, since it is already a part of your code, an extension could be to check what happens if both prices vary or p1 is kept still and p2 is the one varying.
Or how different preferences influences decision making, i.e. different alpha/beta values.
The text was updated successfully, but these errors were encountered:
The most elegant solution in the project was:
Before running the code, the illustration of the random draws in question 7 is a great idea. Your illustration in question 1 is also nice (it does plot it twice when the code is run, maybe because both the py.file and the notebook plots it. Also endowment B is very hard to see, as it is behind all the possible allocations).
However, when the code is run for q7 it returns the error "'TotalEndowments' object has no attribute 'pareto_improvements'". This may because it is trying to reference a different py.file, queston1, not entirely sure. An idea to improve question 7 would be to include consumer B (as far as I can tell in the code from question7.py, this was also the intention, at least there is a "label = endowment B").
The hardest section of code in the project to understand was:
The answer to question 2 and 3 is a bit messy. First off, it would be a much smoother and easier to read, if all parameters were defined in the beginning and all following code was gathered in one place instead of 11 different py.files and different classes. This way, it would only be necessary to define endowments, alpha and beta once, only need to define demand etc. once instead of in every py.file. And especially since you've also done it in your notebook for question 2.
For question 2 (and onwards), since p2=1 and does not change, it seems maybe a bit redundant to have every equation depend on this as well as p1, as it does not really make a difference for the outcome. It just adds complexity to the code and another thing to keep track of - it could further be a potential error, if accidentally using p1 instead of p2 or the other way around. For this question also, maybe either illustrate your errors in some diagram or only show maybe first 5 and last 5 – or just some of them at least, the list is very long and not very enlightening.
For the solution to q3, you've defined: initial_guess = ((0.5+3)*1/N, 1) - why is it +3? Adding to the point of not including p2=1 in your equations, setting bounds on p2 would be unnecessary – especially since it is set to be 1 and not a changeable variable, so putting bounds on the value seems redundant.
Also, not entirely sure why the errors are squared for this question, but that may be correct and/or best way to go.
This part of the project could be better documented:
While you do print fine for most of the questions, it would be nice if the answers were more detailed – especially for questions 5a and b, but also 4 and 6. For 4a (4b returns and error, but based on the print, this could be applied here too) could e.g. be what consumer B ends up getting and utility both consumers get. Same goes for questions 5 and 6. And maybe limit the number of decimals you print to maybe 3 or 5, this goes for all questions and not just these 3.
What is happening down in question 8 could also be documented a lot nicer. First off, why have you chosen a different seed from question 7? Second, right now, it first prints a lot of p1 prices, which seems redundant by themselves. Then it prints a lot of allocations, which is just fine and a good idea, but it looks like it prints in pairs of at least 6? Not sure how many are in between, it shows “…”, but there is probably some mistake here assuming it was the idea to print pairs of 2 or 4 maybe?
An idea for an improvement/clarification could be:
It is nice that you have the comments for the codes going along but would also be very nice if you added a markdown cell and just briefly explained what you were about to do overall (what the question is asking). This would very much improve readability. In addition, when importing the template, it starts at question 2.1, then goes to 1 and so on – maybe delete the 2.1 markdown cell and the “note the following” as well.
As already mentioned, instead of having separate py.files for all questions, gather them in one. Further, it says very clearly in the “note the following” cell in the very top, that “1. The
inauguralproject.py
file includes a function which can be used multiple times in this notebook.” - your file is empty besides a squared function with no arguments. It is much easier to keep track of what you’re doing – and would hopefully limit number of potential mistakes – if everything was gathered in one file.It looks like in 4b is that you’ve written “x1A, x2A = demand_A(p1), return -utility_A(x1A, x2A, alpha)” and not self.demand_A and self.utility_A. This might help with the error-message.
An idea for an extension could be:
While it would make sense to delete p2=1 as the code is now, since it is already a part of your code, an extension could be to check what happens if both prices vary or p1 is kept still and p2 is the one varying.
Or how different preferences influences decision making, i.e. different alpha/beta values.
The text was updated successfully, but these errors were encountered: