Non-autoregressive Linear baseline update + wrote further at thesis

This commit is contained in:
2024-04-18 00:30:25 +02:00
parent 8fb2a7fc7b
commit dc102926fa
13 changed files with 1557 additions and 101 deletions

View File

@@ -1,20 +1,21 @@
\relax
\providecommand\hyper@newdestlabel[2]{}
\@writefile{toc}{\contentsline {section}{\numberline {2}Background}{2}{section.2}\protected@file@percent }
\@writefile{toc}{\contentsline {subsection}{\numberline {2.1}Electricity market}{2}{subsection.2.1}\protected@file@percent }
\@writefile{lot}{\contentsline {table}{\numberline {1}{\ignorespaces Overview of the most important parties in the electricity market}}{2}{table.1}\protected@file@percent }
\newlabel{tab:parties}{{1}{2}{Overview of the most important parties in the electricity market}{table.1}{}}
\@writefile{lot}{\contentsline {table}{\numberline {2}{\ignorespaces Prices paid by the BRPs}}{4}{table.2}\protected@file@percent }
\newlabel{tab:imbalance_price}{{2}{4}{Prices paid by the BRPs}{table.2}{}}
\@writefile{toc}{\contentsline {subsection}{\numberline {2.2}Generative modeling}{4}{subsection.2.2}\protected@file@percent }
\@writefile{toc}{\contentsline {subsection}{\numberline {2.3}Diffusion models}{5}{subsection.2.3}\protected@file@percent }
\@writefile{toc}{\contentsline {subsubsection}{\numberline {2.3.1}Overview}{5}{subsubsection.2.3.1}\protected@file@percent }
\@writefile{toc}{\contentsline {subsubsection}{\numberline {2.3.2}Applications}{6}{subsubsection.2.3.2}\protected@file@percent }
\@writefile{toc}{\contentsline {subsubsection}{\numberline {2.3.3}Generation process}{6}{subsubsection.2.3.3}\protected@file@percent }
\@writefile{lof}{\contentsline {figure}{\numberline {1}{\ignorespaces Diffusion process}}{7}{figure.1}\protected@file@percent }
\newlabel{fig:diffusion_process}{{1}{7}{Diffusion process}{figure.1}{}}
\@writefile{toc}{\contentsline {section}{\numberline {2}Background}{3}{section.2}\protected@file@percent }
\@writefile{toc}{\contentsline {subsection}{\numberline {2.1}Electricity market}{3}{subsection.2.1}\protected@file@percent }
\@writefile{lot}{\contentsline {table}{\numberline {1}{\ignorespaces Overview of the most important parties in the electricity market\relax }}{3}{table.caption.1}\protected@file@percent }
\providecommand*\caption@xref[2]{\@setref\relax\@undefined{#1}}
\newlabel{tab:parties}{{1}{3}{Overview of the most important parties in the electricity market\relax }{table.caption.1}{}}
\@writefile{lot}{\contentsline {table}{\numberline {2}{\ignorespaces Prices paid by the BRPs\relax }}{5}{table.caption.2}\protected@file@percent }
\newlabel{tab:imbalance_price}{{2}{5}{Prices paid by the BRPs\relax }{table.caption.2}{}}
\@writefile{toc}{\contentsline {subsection}{\numberline {2.2}Generative modeling}{5}{subsection.2.2}\protected@file@percent }
\@writefile{toc}{\contentsline {subsection}{\numberline {2.3}Diffusion models}{6}{subsection.2.3}\protected@file@percent }
\@writefile{toc}{\contentsline {subsubsection}{\numberline {2.3.1}Overview}{6}{subsubsection.2.3.1}\protected@file@percent }
\@writefile{toc}{\contentsline {subsubsection}{\numberline {2.3.2}Applications}{7}{subsubsection.2.3.2}\protected@file@percent }
\@writefile{toc}{\contentsline {subsubsection}{\numberline {2.3.3}Generation process}{7}{subsubsection.2.3.3}\protected@file@percent }
\@writefile{lof}{\contentsline {figure}{\numberline {1}{\ignorespaces Diffusion process}}{8}{figure.caption.3}\protected@file@percent }
\newlabel{fig:diffusion_process}{{1}{8}{Diffusion process}{figure.caption.3}{}}
\@setckpt{sections/background}{
\setcounter{page}{8}
\setcounter{page}{9}
\setcounter{equation}{0}
\setcounter{enumi}{0}
\setcounter{enumii}{0}
@@ -32,6 +33,10 @@
\setcounter{table}{2}
\setcounter{parentequation}{0}
\setcounter{float@type}{4}
\setcounter{caption@flags}{2}
\setcounter{continuedfloat}{0}
\setcounter{subfigure}{0}
\setcounter{subtable}{0}
\setcounter{tabx@nest}{0}
\setcounter{listtotal}{0}
\setcounter{listcount}{0}

View File

@@ -1,8 +1,8 @@
\relax
\providecommand\hyper@newdestlabel[2]{}
\@writefile{toc}{\contentsline {section}{\numberline {1}Introduction}{1}{section.1}\protected@file@percent }
\@writefile{toc}{\contentsline {section}{\numberline {1}Introduction}{2}{section.1}\protected@file@percent }
\@setckpt{sections/introduction}{
\setcounter{page}{2}
\setcounter{page}{3}
\setcounter{equation}{0}
\setcounter{enumi}{0}
\setcounter{enumii}{0}
@@ -20,6 +20,10 @@
\setcounter{table}{0}
\setcounter{parentequation}{0}
\setcounter{float@type}{4}
\setcounter{caption@flags}{0}
\setcounter{continuedfloat}{0}
\setcounter{subfigure}{0}
\setcounter{subtable}{0}
\setcounter{tabx@nest}{0}
\setcounter{listtotal}{0}
\setcounter{listcount}{0}

View File

@@ -196,7 +196,7 @@ Multiple methods exist to provide such information to the model. The quarter of
\text{sin}(\frac{2\pi}{96} \times \text{quarter}) \quad \text{and} \quad \text{cos}(\frac{2\pi}{96} \times \text{quarter})
\end{equation}
The sine and cosine values are then concatenated with the input features. Another method that can be used is adding an embedding layer to the model. The discrete quarter of the day value can then be mapped to a vector. The embedding layer itself is learned during the training process which allows the model to learn patterns between quarters. The length of the embedding vector can be chosen and experimented with. The quarter-of-the-day information is then concatenated with the input features. Other information (eg. day of the week, month, year) can also easily be added to the model using this method by just increasing the size of the embedding layer. The results of the linear model with the quarter embeddings are shown in table \ref{tab:autoregressive_linear_model_quarter_embedding_baseline_results}. The results show that adding the quarter embedding to the model improves the performance of the linear model.
The sine and cosine values are then concatenated with the input features. Another method that can be used is adding an embedding layer to the model. The discrete quarter of the day value can then be mapped to a vector. The embedding layer itself is learned during the training process which allows the model to learn patterns between quarters. The length of the embedding vector can be chosen and experimented with. The quarter-of-the-day information is then concatenated with the input features. Other information (eg. day of the week, month, year) can also easily be added to the model using this method by just increasing the size of the embedding layer. The results of the linear model with the quarter information are shown in table \ref{tab:autoregressive_linear_model_quarter_embedding_baseline_results}. The results show that adding the quarter embedding to the model improves the performance of the linear model.
\\\\
% TODO: Ask Jonas: Find cleaner way to present this table (remove repitition)
% TODO: Add more time information like day of week, month
@@ -209,11 +209,13 @@ The sine and cosine values are then concatenated with the input features. Anothe
& Train & Test & Train & Test & Train & Test \\
\midrule
NRV & 35307.34 & 39222.41 & 146.38 & 152.49 & 88.46 & 91.56 \\
NRV + Quarter Trigonometric & 35243.28 & 39069.96 & 146.18 & 152.06 & 87.84 & 90.90 \\
NRV + Quarter Embedding \textbf{(2 dim)} & 34412.60 & \textbf{38216.27} & 144.35 & \textbf{150.41} & 86.59 & \textbf{89.69} \\
NRV + Quarter Embedding \textbf{(5 dim)} & 34801.22 & 38617.17 & 145.22 & 151.20 & 86.64 & 89.72 \\
NRV + Quarter Embedding \textbf{(8 dim)} & 34558.29 & 38423.30 & 144.73 & 150.89 & 86.59 & 89.81 \\
\midrule
NRV + Load + PV + Wind + Net Position & 29034.53 & 35725.42 & 131.87 & 145.64 & 76.23 & 83.30 \\
NRV + Load + PV + Wind + Net Position \\ + Quarter Trigonometric & 28239.01 & 34783.13 & 130.30 & 143.98 & 76.59 & 84.21 \\
NRV + Load + PV + Wind + Net Position \\ + Quarter Embedding \textbf{(2 dim)} & 28667.13 & 35746.01 & 131.20 & 146.01 & 77.28 & 85.54 \\
NRV + Load + PV + Wind + Net Position \\ + Quarter Embedding \textbf{(5 dim)} & 27407.41 & \textbf{34031.71} & 128.31 & \textbf{142.29} & 72.06 & \textbf{79.99} \\
\bottomrule
@@ -254,7 +256,11 @@ Some examples of the sampled full NRV day samples are shown in figure \ref{fig:a
\label{fig:autoregressive_linear_model_samples}
\end{figure}
The linear model is a simple model and can be used as a baseline to compare the more complex models.
The linear model is a simple model and can be used as a baseline to compare with the more complex models. From the examples in figure \ref{fig:autoregressive_linear_model_samples}, it can be seen that the model is already modeling the NRV reasonably well. There is, however, room for improvement.
\\\\
% ----------- Non-autoregressive model -----------
Until now, only the autoregressive linear model has been discussed. The non-autoregressive linear model can also be used to model the NRV and generate full-day samples. The model will now output the quantiles for every quarter of the day. The number of output values can be calculated as the number of quarters in a day multiplied by the number of quantiles. From this output, the cumulative distribution functions for every quarter of the day can be reconstructed. These functions can then be used to sample the NRV values for each quarter. There is a problem with this approach. The sampled NRV values are independent of each other. The NRV sample for the next quarter does not depend on what value was sampled for the quarter before.
\\\\
Training the non-autoregressive quantile model can be done in the same way as the autoregressive model. Now the pinball loss is calculated for every quarter of the day and the mean is taken over all the quarters. The models are also trained using the Adam optimizer with a learning rate of 1e-4. Early stopping is used with a patience of 5 epochs.
\newpage
\subsection{Diffusion}
\subsection{Diffusion}

Binary file not shown.

View File

@@ -22,35 +22,41 @@
\abx@aux@refcontext{nyt/apasortcite//global/global}
\abx@aux@cite{0}{ho2020denoising}
\abx@aux@segm{0}{0}{ho2020denoising}
\@writefile{toc}{\contentsline {section}{\numberline {3}Literature Study}{8}{section.3}\protected@file@percent }
\@writefile{toc}{\contentsline {section}{\numberline {4}TODO: Better title for this section}{8}{section.4}\protected@file@percent }
\@writefile{toc}{\contentsline {section}{\numberline {5}NRV Prediction}{8}{section.5}\protected@file@percent }
\@writefile{toc}{\contentsline {subsection}{\numberline {5.1}Data}{8}{subsection.5.1}\protected@file@percent }
\@writefile{toc}{\contentsline {subsection}{\numberline {5.2}Quantile Regression}{10}{subsection.5.2}\protected@file@percent }
\@writefile{lof}{\contentsline {figure}{\numberline {2}{\ignorespaces Example of quantiles}}{10}{figure.2}\protected@file@percent }
\newlabel{fig:quantile_example}{{2}{10}{Example of quantiles}{figure.2}{}}
\@writefile{lof}{\contentsline {figure}{\numberline {3}{\ignorespaces Example of quantile regression output for one-quarter of the NRV, showing interpolated values for quantiles at 1\%, 5\%, 10\%, 15\%, 30\%, 40\%, 50\%, 60\%, 70\%, 85\%, 90\%, 95\%, and 99\%. These quantiles are used to reconstruct the cumulative distribution function.}}{11}{figure.3}\protected@file@percent }
\newlabel{fig:quantile_regression_example}{{3}{11}{Example of quantile regression output for one-quarter of the NRV, showing interpolated values for quantiles at 1\%, 5\%, 10\%, 15\%, 30\%, 40\%, 50\%, 60\%, 70\%, 85\%, 90\%, 95\%, and 99\%. These quantiles are used to reconstruct the cumulative distribution function}{figure.3}{}}
\@writefile{toc}{\contentsline {subsubsection}{\numberline {5.2.1}Training}{12}{subsubsection.5.2.1}\protected@file@percent }
\@writefile{toc}{\contentsline {subsubsection}{\numberline {5.2.2}Evaluation}{13}{subsubsection.5.2.2}\protected@file@percent }
\@writefile{lof}{\contentsline {figure}{\numberline {4}{\ignorespaces Visualization of the CRPS metric}}{14}{figure.4}\protected@file@percent }
\newlabel{fig:crps_visualization}{{4}{14}{Visualization of the CRPS metric}{figure.4}{}}
\@writefile{toc}{\contentsline {subsubsection}{\numberline {5.2.3}Models}{14}{subsubsection.5.2.3}\protected@file@percent }
\newlabel{tab:autoregressive_linear_model_baseline_results}{{5.2.3}{15}{Models}{equation.5.6}{}}
\@writefile{lot}{\contentsline {table}{\numberline {3}{\ignorespaces Autoregressive linear model results}}{15}{table.3}\protected@file@percent }
\newlabel{tab:autoregressive_linear_model_quarter_embedding_baseline_results}{{5.2.3}{16}{Models}{equation.5.7}{}}
\@writefile{lot}{\contentsline {table}{\numberline {4}{\ignorespaces Autoregressive linear model results with time features}}{16}{table.4}\protected@file@percent }
\@writefile{toc}{\contentsline {subsection}{\numberline {5.3}Diffusion}{18}{subsection.5.3}\protected@file@percent }
\@writefile{lof}{\contentsline {figure}{\numberline {5}{\ignorespaces Sample 1}}{19}{figure.5}\protected@file@percent }
\newlabel{fig:autoregressive_linear_model_sample_1}{{5}{19}{Sample 1}{figure.5}{}}
\@writefile{lof}{\contentsline {figure}{\numberline {6}{\ignorespaces Sample 2}}{19}{figure.6}\protected@file@percent }
\newlabel{fig:autoregressive_linear_model_sample_2}{{6}{19}{Sample 2}{figure.6}{}}
\@writefile{lof}{\contentsline {figure}{\numberline {7}{\ignorespaces Sample 3}}{19}{figure.7}\protected@file@percent }
\newlabel{fig:autoregressive_linear_model_sample_3}{{7}{19}{Sample 3}{figure.7}{}}
\@writefile{lof}{\contentsline {figure}{\numberline {8}{\ignorespaces Sample 4}}{19}{figure.8}\protected@file@percent }
\newlabel{fig:autoregressive_linear_model_sample_4}{{8}{19}{Sample 4}{figure.8}{}}
\@writefile{lof}{\contentsline {figure}{\numberline {9}{\ignorespaces Test examples of the autoregressive linear model. The plots show the confidence intervals calculated from 1000 generated full-day NRV samples.}}{19}{figure.9}\protected@file@percent }
\newlabel{fig:autoregressive_linear_model_samples}{{9}{19}{Test examples of the autoregressive linear model. The plots show the confidence intervals calculated from 1000 generated full-day NRV samples}{figure.9}{}}
\abx@aux@read@bbl@mdfivesum{nohash}
\abx@aux@refcontext{nyt/apasortcite//global/global}
\abx@aux@cite{0}{ho2020denoising}
\abx@aux@segm{0}{0}{ho2020denoising}
\@input{sections/literature_study.aux}
\@writefile{toc}{\contentsline {section}{\numberline {4}TODO: Better title for this section}{10}{section.4}\protected@file@percent }
\@writefile{toc}{\contentsline {section}{\numberline {5}NRV Prediction}{10}{section.5}\protected@file@percent }
\@writefile{toc}{\contentsline {subsection}{\numberline {5.1}Data}{10}{subsection.5.1}\protected@file@percent }
\@writefile{toc}{\contentsline {subsection}{\numberline {5.2}Quantile Regression}{12}{subsection.5.2}\protected@file@percent }
\@writefile{lof}{\contentsline {figure}{\numberline {2}{\ignorespaces Example of quantiles\relax }}{12}{figure.caption.4}\protected@file@percent }
\newlabel{fig:quantile_example}{{2}{12}{Example of quantiles\relax }{figure.caption.4}{}}
\@writefile{lof}{\contentsline {figure}{\numberline {3}{\ignorespaces Example of quantile regression output for one-quarter of the NRV, showing interpolated values for quantiles at 1\%, 5\%, 10\%, 15\%, 30\%, 40\%, 50\%, 60\%, 70\%, 85\%, 90\%, 95\%, and 99\%. These quantiles are used to reconstruct the cumulative distribution function.\relax }}{13}{figure.caption.5}\protected@file@percent }
\newlabel{fig:quantile_regression_example}{{3}{13}{Example of quantile regression output for one-quarter of the NRV, showing interpolated values for quantiles at 1\%, 5\%, 10\%, 15\%, 30\%, 40\%, 50\%, 60\%, 70\%, 85\%, 90\%, 95\%, and 99\%. These quantiles are used to reconstruct the cumulative distribution function.\relax }{figure.caption.5}{}}
\@writefile{toc}{\contentsline {subsubsection}{\numberline {5.2.1}Training}{14}{subsubsection.5.2.1}\protected@file@percent }
\@writefile{toc}{\contentsline {subsubsection}{\numberline {5.2.2}Evaluation}{15}{subsubsection.5.2.2}\protected@file@percent }
\@writefile{lof}{\contentsline {figure}{\numberline {4}{\ignorespaces Visualization of the CRPS metric\relax }}{16}{figure.caption.6}\protected@file@percent }
\newlabel{fig:crps_visualization}{{4}{16}{Visualization of the CRPS metric\relax }{figure.caption.6}{}}
\@writefile{toc}{\contentsline {subsubsection}{\numberline {5.2.3}Models}{16}{subsubsection.5.2.3}\protected@file@percent }
\newlabel{tab:autoregressive_linear_model_baseline_results}{{\caption@xref {tab:autoregressive_linear_model_baseline_results}{ on input line 187}}{17}{Models}{table.caption.7}{}}
\@writefile{lot}{\contentsline {table}{\numberline {3}{\ignorespaces Autoregressive linear model results\relax }}{17}{table.caption.7}\protected@file@percent }
\newlabel{tab:autoregressive_linear_model_quarter_embedding_baseline_results}{{\caption@xref {tab:autoregressive_linear_model_quarter_embedding_baseline_results}{ on input line 223}}{18}{Models}{table.caption.8}{}}
\@writefile{lot}{\contentsline {table}{\numberline {4}{\ignorespaces Autoregressive linear model results with time features\relax }}{18}{table.caption.8}\protected@file@percent }
\newlabel{fig:autoregressive_linear_model_sample_1}{{5a}{19}{Sample 1\relax }{figure.caption.9}{}}
\newlabel{sub@fig:autoregressive_linear_model_sample_1}{{a}{19}{Sample 1\relax }{figure.caption.9}{}}
\newlabel{fig:autoregressive_linear_model_sample_2}{{5b}{19}{Sample 2\relax }{figure.caption.9}{}}
\newlabel{sub@fig:autoregressive_linear_model_sample_2}{{b}{19}{Sample 2\relax }{figure.caption.9}{}}
\newlabel{fig:autoregressive_linear_model_sample_3}{{5c}{19}{Sample 3\relax }{figure.caption.9}{}}
\newlabel{sub@fig:autoregressive_linear_model_sample_3}{{c}{19}{Sample 3\relax }{figure.caption.9}{}}
\newlabel{fig:autoregressive_linear_model_sample_4}{{5d}{19}{Sample 4\relax }{figure.caption.9}{}}
\newlabel{sub@fig:autoregressive_linear_model_sample_4}{{d}{19}{Sample 4\relax }{figure.caption.9}{}}
\@writefile{lof}{\contentsline {figure}{\numberline {5}{\ignorespaces Test examples of the autoregressive linear model. The plots show the confidence intervals calculated from 1000 generated full-day NRV samples.\relax }}{19}{figure.caption.9}\protected@file@percent }
\newlabel{fig:autoregressive_linear_model_samples}{{5}{19}{Test examples of the autoregressive linear model. The plots show the confidence intervals calculated from 1000 generated full-day NRV samples.\relax }{figure.caption.9}{}}
\@writefile{toc}{\contentsline {subsection}{\numberline {5.3}Diffusion}{20}{subsection.5.3}\protected@file@percent }
\@writefile{toc}{\contentsline {section}{\numberline {6}Policies for battery optimization}{20}{section.6}\protected@file@percent }
\@writefile{toc}{\contentsline {subsection}{\numberline {6.1}Baselines}{20}{subsection.6.1}\protected@file@percent }
\@writefile{toc}{\contentsline {subsection}{\numberline {6.2}Policies using NRV predictions}{20}{subsection.6.2}\protected@file@percent }
\abx@aux@read@bbl@mdfivesum{D41D8CD98F00B204E9800998ECF8427E}
\abx@aux@read@bblrerun
\gdef \@abspage@last{20}
\gdef \@abspage@last{21}

View File

@@ -2830,6 +2830,7 @@
</bcf:bibdata>
<bcf:section number="0">
<bcf:citekey order="1" intorder="1">ho2020denoising</bcf:citekey>
<bcf:citekey order="2" intorder="1">ho2020denoising</bcf:citekey>
</bcf:section>
<!-- SORTING TEMPLATES -->
<bcf:sortingtemplate name="nyt">

1401
Reports/Thesis/verslag.log Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -15,3 +15,6 @@
\BOOKMARK [3][-]{subsubsection.5.2.2}{\376\377\000E\000v\000a\000l\000u\000a\000t\000i\000o\000n}{subsection.5.2}% 15
\BOOKMARK [3][-]{subsubsection.5.2.3}{\376\377\000M\000o\000d\000e\000l\000s}{subsection.5.2}% 16
\BOOKMARK [2][-]{subsection.5.3}{\376\377\000D\000i\000f\000f\000u\000s\000i\000o\000n}{section.5}% 17
\BOOKMARK [1][-]{section.6}{\376\377\000P\000o\000l\000i\000c\000i\000e\000s\000\040\000f\000o\000r\000\040\000b\000a\000t\000t\000e\000r\000y\000\040\000o\000p\000t\000i\000m\000i\000z\000a\000t\000i\000o\000n}{}% 18
\BOOKMARK [2][-]{subsection.6.1}{\376\377\000B\000a\000s\000e\000l\000i\000n\000e\000s}{section.6}% 19
\BOOKMARK [2][-]{subsection.6.2}{\376\377\000P\000o\000l\000i\000c\000i\000e\000s\000\040\000u\000s\000i\000n\000g\000\040\000N\000R\000V\000\040\000p\000r\000e\000d\000i\000c\000t\000i\000o\000n\000s}{section.6}% 20

Binary file not shown.

Binary file not shown.

View File

@@ -23,6 +23,7 @@
\usepackage{float}
\usepackage{bbm}
\usepackage{booktabs}
\usepackage{subcaption}
\newcolumntype{C}{>{\centering\arraybackslash}X}
@@ -66,7 +67,7 @@
%% Note: a stricter UGent style could be achieved with, e.g.:
\usepackage{ulem} % for colored underline
\renewcommand{\ULthickness}{2pt} % adjust thickness of underline
\thetitle{Forecasting and generative modeling of the Belgian electricity market}
\thetitle{Generative modeling of electricity imbalance prices for battery optimization}
% Note: do not forget to reset the \ULthickness to 1pt after invoking \maketitle
% (otherwise all underlines in the rest of your document will be too thick):
%\renewcommand{\ULthickness}{1pt}
@@ -114,8 +115,8 @@
% =====================================================================
% ------------ TABLE OF CONTENTS ---------
% {\hypersetup{hidelinks}\tableofcontents} % hide link color in toc
% \newpage
{\hypersetup{hidelinks}\tableofcontents} % hide link color in toc
\newpage
% \begin{titlepage}
% \centering % Centers everything on the page
@@ -131,22 +132,26 @@
% {\Large Victor Mylle\par}
% \vspace{1cm}
% {\large Period of Internship: 3 July 2023 - 31 August 2023\par}
% {\large }
% \vspace{1cm}
% {\large Mentor: dr. ir. Femke De Backere\par}
% {\large Mentor: }
% \end{titlepage}
\newpage
% ------------ ABSTRACT ---------
% ------------ Introduction ---------
\include{sections/introduction}
\include{sections/background}
\section{Literature Study}
- Literatuur forecasting imbalance price
- Literatuur policies adhv forecasts
\include{sections/literature_study}
\section{TODO: Better title for this section}
This thesis can be divided into two main parts. The first part focuses on modeling the Net Regulation Volume (NRV) of the Belgian electricity market for the next day. This modeling is conditioned on multiple inputs that can be obtained from Elia (TODO: add citation to the open data of Elia). The second part of the thesis focuses on optimizing a simple policy using the NRV generations for the next day. The policy tries to maximize profit by charging and discharging a battery and thereby buying and selling electricity on the market. Multiple models are trained and tested to model the NRV and compared to each other based on their profit optimization.
@@ -154,5 +159,9 @@ This thesis can be divided into two main parts. The first part focuses on modeli
\input{sections/nrv_prediction}
\end{document}
\section{Policies for battery optimization}
\subsection{Baselines}
\subsection{Policies using NRV predictions}
\end{document}

View File

@@ -0,0 +1,21 @@
\babel@toc {english}{}\relax
\contentsline {section}{\numberline {1}Introduction}{2}{section.1}%
\contentsline {section}{\numberline {2}Background}{3}{section.2}%
\contentsline {subsection}{\numberline {2.1}Electricity market}{3}{subsection.2.1}%
\contentsline {subsection}{\numberline {2.2}Generative modeling}{5}{subsection.2.2}%
\contentsline {subsection}{\numberline {2.3}Diffusion models}{6}{subsection.2.3}%
\contentsline {subsubsection}{\numberline {2.3.1}Overview}{6}{subsubsection.2.3.1}%
\contentsline {subsubsection}{\numberline {2.3.2}Applications}{7}{subsubsection.2.3.2}%
\contentsline {subsubsection}{\numberline {2.3.3}Generation process}{7}{subsubsection.2.3.3}%
\contentsline {section}{\numberline {3}Literature Study}{9}{section.3}%
\contentsline {section}{\numberline {4}TODO: Better title for this section}{10}{section.4}%
\contentsline {section}{\numberline {5}NRV Prediction}{10}{section.5}%
\contentsline {subsection}{\numberline {5.1}Data}{10}{subsection.5.1}%
\contentsline {subsection}{\numberline {5.2}Quantile Regression}{12}{subsection.5.2}%
\contentsline {subsubsection}{\numberline {5.2.1}Training}{14}{subsubsection.5.2.1}%
\contentsline {subsubsection}{\numberline {5.2.2}Evaluation}{15}{subsubsection.5.2.2}%
\contentsline {subsubsection}{\numberline {5.2.3}Models}{16}{subsubsection.5.2.3}%
\contentsline {subsection}{\numberline {5.3}Diffusion}{20}{subsection.5.3}%
\contentsline {section}{\numberline {6}Policies for battery optimization}{20}{section.6}%
\contentsline {subsection}{\numberline {6.1}Baselines}{20}{subsection.6.1}%
\contentsline {subsection}{\numberline {6.2}Policies using NRV predictions}{20}{subsection.6.2}%

View File

@@ -1,7 +1,7 @@
from src.utils.clearml import ClearMLHelper
#### ClearML ####
clearml_helper = ClearMLHelper(project_name="Thesis/NrvForecast")
clearml_helper = ClearMLHelper(project_name="Thesis/NAQR: Linear")
task = clearml_helper.get_task(task_name="NAQR: Non Linear")
task.execute_remotely(queue_name="default", exit_process=True)
@@ -27,23 +27,23 @@ from src.models.time_embedding_layer import TimeEmbedding
data_config = DataConfig()
data_config.NRV_HISTORY = True
data_config.LOAD_HISTORY = True
data_config.LOAD_FORECAST = True
data_config.LOAD_HISTORY = False
data_config.LOAD_FORECAST = False
data_config.WIND_FORECAST = True
data_config.WIND_HISTORY = True
data_config.WIND_FORECAST = False
data_config.WIND_HISTORY = False
data_config.QUARTER = True
data_config.DAY_OF_WEEK = True
data_config.PV_FORECAST = False
data_config.PV_HISTORY = False
data_config.NOMINAL_NET_POSITION = True
data_config.NOMINAL_NET_POSITION = False
data_config = task.connect(data_config, name="data_features")
data_processor = DataProcessor(data_config, path="", lstm=False)
data_processor.set_batch_size(512)
data_processor.set_full_day_skip(False)
data_processor.set_full_day_skip(True)
#### Hyperparameters ####
@@ -83,17 +83,17 @@ time_embedding = TimeEmbedding(
# dropout=model_parameters["dropout"],
# )
non_linear_model = NonLinearRegression(
time_embedding.output_dim(inputDim),
len(quantiles) * 96,
hiddenSize=model_parameters["hidden_size"],
numLayers=model_parameters["num_layers"],
dropout=model_parameters["dropout"],
)
# non_linear_model = NonLinearRegression(
# time_embedding.output_dim(inputDim),
# len(quantiles) * 96,
# hiddenSize=model_parameters["hidden_size"],
# numLayers=model_parameters["num_layers"],
# dropout=model_parameters["dropout"],
# )
# linear_model = LinearRegression(time_embedding.output_dim(inputDim), len(quantiles))
linear_model = LinearRegression(time_embedding.output_dim(inputDim), len(quantiles))
model = nn.Sequential(time_embedding, non_linear_model)
model = nn.Sequential(time_embedding, linear_model)
model.output_size = 96
optimizer = torch.optim.Adam(model.parameters(), lr=model_parameters["learning_rate"])
@@ -110,7 +110,7 @@ trainer = NonAutoRegressiveQuantileRegression(
data_processor,
quantiles,
"cuda",
policy_evaluator=policy_evaluator,
policy_evaluator=None,
debug=False,
)
@@ -122,32 +122,32 @@ trainer.plot_every(5)
trainer.train(task=task, epochs=epochs, remotely=True)
### Policy Evaluation ###
idx_samples = trainer.test_set_samples
_, test_loader = trainer.data_processor.get_dataloaders(
predict_sequence_length=trainer.model.output_size, full_day_skip=False
)
# idx_samples = trainer.test_set_samples
# _, test_loader = trainer.data_processor.get_dataloaders(
# predict_sequence_length=trainer.model.output_size, full_day_skip=False
# )
# policy_evaluator.evaluate_test_set(idx_samples, test_loader)
# policy_evaluator.plot_profits_table()
# policy_evaluator.plot_thresholds_per_day()
optimal_penalty, profit, charge_cycles = (
policy_evaluator.optimize_penalty_for_target_charge_cycles(
idx_samples=idx_samples,
test_loader=test_loader,
initial_penalty=1000,
target_charge_cycles=283,
learning_rate=15,
max_iterations=150,
tolerance=1,
)
)
# optimal_penalty, profit, charge_cycles = (
# policy_evaluator.optimize_penalty_for_target_charge_cycles(
# idx_samples=idx_samples,
# test_loader=test_loader,
# initial_penalty=1000,
# target_charge_cycles=283,
# learning_rate=15,
# max_iterations=150,
# tolerance=1,
# )
# )
print(
f"Optimal Penalty: {optimal_penalty}, Profit: {profit}, Charge Cycles: {charge_cycles}"
)
task.get_logger().report_single_value(name="Optimal Penalty", value=optimal_penalty)
task.get_logger().report_single_value(name="Optimal Profit", value=profit)
task.get_logger().report_single_value(name="Optimal Charge Cycles", value=charge_cycles)
# print(
# f"Optimal Penalty: {optimal_penalty}, Profit: {profit}, Charge Cycles: {charge_cycles}"
# )
# task.get_logger().report_single_value(name="Optimal Penalty", value=optimal_penalty)
# task.get_logger().report_single_value(name="Optimal Profit", value=profit)
# task.get_logger().report_single_value(name="Optimal Charge Cycles", value=charge_cycles)
task.close()