Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong Calculation of Total Profit [price-optimization-using-dqn-reinforcement-learning] #4

Open
immortal3 opened this issue May 28, 2020 · 0 comments

Comments

@immortal3
Copy link

Filename : pricing/price-optimization-using-dqn-reinforcement-learning.ipynb

at t=0, the Below function evaluates with p[0] and p[-1] as parameters which seems incorrect to me.
because p[-1] in python corresponds to last element of the array.

def profit_total(p, unit_cost, q_0, k, a, b):
  return profit_t(p[0], p[0], q_0, k, 0, 0, unit_cost) + sum(map(lambda t: profit_t(p[t], p[t-1], q_0, k, a, b, unit_cost), range(len(p))))

to fix this, we can use range(1,len(p)).

def profit_total(p, unit_cost, q_0, k, a, b):
  return profit_t(p[0], p[0], q_0, k, 0, 0, unit_cost) + sum(map(lambda t: profit_t(p[t], p[t-1], q_0, k, a, b, unit_cost), range(1,len(p))))

@ikatsov Do let me know if I am wrong or misunderstood something.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant