pymc-examples icon indicating copy to clipboard operation
pymc-examples copied to clipboard

Should you buy a house battery?

Open drbenvincent opened this issue 6 months ago • 2 comments

Notebook proposal

Title: Should you buy a house battery?

Why should this notebook be added to pymc-examples?

This notebook would be a case study which aims to illustrate not only the Bayesian workflow in terms of parameter estimation, but also to illustrate Bayesian decision making. While we have many example notebooks covering parameter estimation, Bayesian decision making is currently not represented in the examples.

An initial guess of structure of the notebooks would be something like:

  1. Load data: Real world dataset of electricity use at weekly resolution. Includes energy imported from the grid, total production by PV panels, how much of that was used by the house vs exported to the grid. Importantly for this example, we do not have a full year's worth of data.
  2. Overview of the problem + data visualisation: I'll outline the various steps to answer the question of whether I should buy a house battery. This is a rich question which balances the financial cost of the battery and savings that come from both: a) storing all PV production for later use, b) time-shifting demand from the grid to charge battery at cheap overnight rate and run down the battery during the day. Parameter estimation will be required to estimate both annual PV production as well as total demand by the house. Decision making will focus on estimating costs (into the future) of not buying a house battery vs buying a house battery.
  3. Parameter estimation: This section will run through how to estimate all the quantities we need. This will include PV production, total demand, etc. There are quite a lot of sources of uncertainty here: cost of importing energy into the future, value of energy export to the grid, fluctuation in annual energy demand due to temperature variations.
  4. Decision making: This section will evaluate the relative merit of buying vs not buying a house battery as a function of time horizon. The initial up front costs make buying a bad decision in the short term, but a good decision if you have a longer time horizon. We could optionally attempt to collapse over time horizons by evaluating the relative present value of each option using temporal discounting. We could also optionally take into account that batteries are getting cheaper over time, so there could be an optimal time of when to buy a house battery - though this is likely too much in terms of complexity for a didactic notebook example.
  5. Summary: Recap what we've done and cover the advantages of taking uncertainty into account. Discussion of the simplifications (e.g. everything totally changes if you upgrade to a heat pump for example) and potential extensions.

Suggested categories:

  • Level: Intermediate
  • Diataxis type: Tutorial or Explanation

I propose that this notebook initially live in the "Case Studies", but once we have at least 2 notebooks on Bayesian decision making then we can create a new examples section dedicated to decision making, or decision making and hypothesis testing.

Related notebooks

At the moment we do not have any example notebooks covering Bayesian decision making. Though @OriolAbril has a draft, see #477.

References

drbenvincent avatar Jan 07 '24 10:01 drbenvincent