Energy Exchange Istanbul (EXIST)

1. Introduction

Energy Exchange Istanbul (EXIST) was established on March 12, 2015 upon the Electricity Market Law and Turkish Trade Law. Main objective and principal business activity is to plan, establish, develop, and manage energy market in a transparent manner that fulfills the requirements of energy market. Energy market in Turkey changes hourly and the related data can be found in the official webpage of EXIST. You can click, and filter the date you wish to check hourly data. This report has been prepared to examine the month of July 2020 using EXIST data for the electricity market.

The basic approach in electricity energy markets is to ensure that electricity production and electricity consumption are equal. There is a balance that should be struck for this. To preserve this balance, energy markets are conducted and these can be summarized in three groups:
1.Day Ahead Market (DAM): It is the market created according to the next day’s hourly electricity plan. Transactions are made on the Market Clearing Price(MCP). The second column in the data we use while creating the report gives hourly MCP information.
2.Intraday Market (IDM): It is the market that continues throughout the day similar to stock exchange. The reason for the creation of this market is that in most cases, the forecast due to previous day’s plan does not fully comply with the actual demand.Transactions are made on the Weighted Average Price(WAP).
3.Balancing Power Market (BPM): It is the market that is formed due to the electricity energy trade made at the last moment to ensure the balance.Transactions are made on the System Marginal Price(SMP). The third column in the data we use while creating the report gives hourly SMP information.

Before we get into the details of the report, there are a few more terms we should be familiar to. These are energy deficit and energy surplus. In cases where the actual demand is higher than the predicted demand, energy deficit arises, otherwise energy surplus occurs. System Marginal Price(SMP) is always higher than Market Clearing Price(MCP) if system has Energy Deficit, and lower if there is Energy Surplus. Market operator also penalizes the operations in BPM by 3%. This is called Imbalance Price. Negative (Deficit) Imbalance Price is calculated as max(MCP,SMP)1.03 ,and Positive Imbalance Price is calculated as min(MCP,SMP)0.97.

2. July, 2020 Report

After downloading the data between 1 July 2020 and 31 July 2020 from the official webpage of EXIST, the analyses can be started. Firstly, a few edits on this data are done in order to have a better comprehension. The basic packages tidyverse and lubridate are used throughout the report. In addition to these, the reshape2 package was also useful for the plots.

library(tidyverse) 
library(lubridate)
library(reshape2)
EXIST_data <- read.csv("ptf-smf.csv")
EXIST_raw_df <- EXIST_data%>%transmute(Date = gsub(pattern = "\\.","-",Date),
            MCP,
            SMP,
            PositiveIP = Positive.Imbalance.Price..TL.MWh.,
            NegativeIP = Negative.Imbalance.Price..TL.MWh.,
            SMPDirection = SMP.Direction)

EXIST_raw_df$Date<-as.POSIXct(EXIST_raw_df$Date,format="%d-%m-%y %H:%M")
head(EXIST_raw_df)
##                  Date    MCP    SMP PositiveIP NegativeIP   SMPDirection
## 1 2020-07-01 11:00:00 329.99 329.99     320.09     339.89 Energy Deficit
## 2 2020-07-01 12:00:00 324.21 342.80     314.48     353.08 Energy Deficit
## 3 2020-07-01 13:00:00 327.83 355.83     318.00     366.50 Energy Deficit
## 4 2020-07-01 14:00:00 332.37 377.37     322.40     388.69 Energy Deficit
## 5 2020-07-01 15:00:00 331.29 376.29     321.35     387.58 Energy Deficit
## 6 2020-07-01 16:00:00 331.14 375.00     321.21     386.25 Energy Deficit
tail(EXIST_raw_df)
##                    Date    MCP    SMP PositiveIP NegativeIP   SMPDirection
## 739 2020-07-31 17:00:00 304.73 205.00     198.85     313.87 Energy Surplus
## 740 2020-07-31 18:00:00 310.78 206.18     199.99     320.10 Energy Surplus
## 741 2020-07-31 19:00:00 317.79 260.00     252.20     327.32 Energy Surplus
## 742 2020-07-31 20:00:00 324.94 205.00     198.85     334.69 Energy Surplus
## 743 2020-07-31 21:00:00 325.98 266.98     258.97     335.76 Energy Surplus
## 744 2020-07-31 23:00:00 321.78 210.00     203.70     331.43 Energy Surplus

We can also use the glimpse function to inspect our data. By using it,each column is represented in a row with its data type and first few entries. We have 744 rows and 6 variables namely Date, MCP, SMP, Positive Imbalance Price, Negative Imbalance Price, and SMP Direction.

EXIST_raw_df%>%glimpse()
## Rows: 744
## Columns: 6
## $ Date         <dttm> 2020-07-01 11:00:00, 2020-07-01 12:00:00, 2020-07-01 ...
## $ MCP          <dbl> 329.99, 324.21, 327.83, 332.37, 331.29, 331.14, 330.81...
## $ SMP          <dbl> 329.99, 342.80, 355.83, 377.37, 376.29, 375.00, 360.81...
## $ PositiveIP   <dbl> 320.09, 314.48, 318.00, 322.40, 321.35, 321.21, 320.89...
## $ NegativeIP   <dbl> 339.89, 353.08, 366.50, 388.69, 387.58, 386.25, 371.63...
## $ SMPDirection <fct> Energy Deficit, Energy Deficit, Energy Deficit, Energy...

In order to limit the number of displayed rows, the following global option can be used.

options(tibble.print_max = 5, tibble.print_min = 5)

Before making a more detailed analysis, it would be useful to give the average prices for the full month of July.The average MCP value is 296 and the average SMP value is 299 in July, 2020. These values can be obtained by using commands below:

round(mean(EXIST_raw_df$MCP))
round(mean(EXIST_raw_df$SMP))

We can check scatter plot in order to see which interval of prices occured more frequently during July, 2020. The plot below shows that for most of the days, MCP lies between 300-330 and SMP lies between 150-350.

ggplot(EXIST_raw_df, aes(x=MCP, y=SMP, color=Date)) + geom_point() +  labs(x="MCP", y="SMP",  title="MCP and SMP Prices",subtitle=" Energy Exchange Turkey(EXIST), between July 01 and July 31")+theme_test()+geom_abline(slope=1, intercept=0, color="red")

The bar chart showing the daily change of System Marginal Price and Market Clearing Price values is given below.

plot1<-EXIST_raw_df %>% group_by(Day=lubridate::day(Date))%>% summarise(daily_average_MCP = mean(MCP), daily_average_SMP = mean(SMP)) %>% 
      ungroup()%>%select(Day, daily_average_MCP, daily_average_SMP)
plot2<-melt(plot1, id.vars='Day')
plot2%>%ggplot(.,aes(x=Day,y=value, fill=variable)) + geom_bar(stat="identity", position="dodge")+theme_test()+
      labs(x="Day", y="TL/MWh", 
           title="Daily MCP and SMP Change",
           subtitle=" Energy Exchange Turkey(EXIST), between July 01 and July 31")

We may be also interested in the daily difference between these prices.

plot3<-EXIST_raw_df %>% group_by(Day=lubridate::day(Date))%>% summarise(daily_average_MCP = mean(MCP), daily_average_SMP = mean(SMP),Difference = abs(mean(MCP)-mean(SMP)))%>%print(plot3)
## # A tibble: 31 x 4
##     Day daily_average_MCP daily_average_SMP Difference
##   <int>             <dbl>             <dbl>      <dbl>
## 1     1              320.              268.       51.8
## 2     2              298.              357.       58.6
## 3     3              317.              373.       56.2
## 4     4              306.              321.       15.3
## 5     5              258.              198.       59.8
## # ... with 26 more rows
plot3%>%ggplot(aes(x=Day)) + geom_line(aes(y = Difference, color = "Difference of average values")) +
     labs(x = "Day", y = "TL/MWh",
          title = "Difference between Daily Average MCP and SMP Change",
          subtitle = " Energy Exchange Turkey(EXIST), between July 01 and July 31")+theme_test()

2.1. Day Ahead Market (DAM)

2.1.1 Hourly Day Ahead Market

Since the electricity energy market prices are planned on an hourly basis, it will be useful to find the hourly average, minimum, and maximum values in order to gain some insights about the data. Firstly, the plot data is provided, and then the plot is constructed.

plot4<-EXIST_raw_df%>% group_by(Hour=lubridate::hour(Date))%>%summarise(hourly_average_MCP=mean(MCP), hourly_min_MCP=min(MCP), hourly_max_MCP=max(MCP))%>%print()
## # A tibble: 24 x 4
##    Hour hourly_average_MCP hourly_min_MCP hourly_max_MCP
##   <int>              <dbl>          <dbl>          <dbl>
## 1     0               297.           230.           324.
## 2     1               306.           293            327.
## 3     2               298.           230.           324.
## 4     3               284.           199.           322.
## 5     4               285.           219.           320 
## # ... with 19 more rows
plot4 %>% pivot_longer(.,-Hour) %>% ggplot(.,aes(x=Hour,y=value,color=name)) + geom_line()+
      labs(x="Hour", y="MCP (TL/MWh)", 
           title=  "Average, Minimum and Maximum Hourly Market Clearing Price(MCP)",
           subtitle=" Energy Exchange Turkey(EXIST), between July 01 and July 31")+theme_test()

2.1.2. Daily Day Ahead Market

Day Ahead Market daily prices for the minimum, maximum, and average values can be see below.

plot5<-EXIST_raw_df%>% group_by(Day=lubridate::day(Date))%>%summarise(daily_average_MCP=mean(MCP), daily_min_MCP=min(MCP), daily_max_MCP=max(MCP))%>%print()
## # A tibble: 31 x 4
##     Day daily_average_MCP daily_min_MCP daily_max_MCP
##   <int>             <dbl>         <dbl>         <dbl>
## 1     1              320.          210.          332.
## 2     2              298.          199.          322.
## 3     3              317.          293           331.
## 4     4              306.          238.          314.
## 5     5              258.          174.          306.
## # ... with 26 more rows
plot5 %>% pivot_longer(.,-Day) %>% ggplot(.,aes(x=Day,y=value,color=name)) + geom_line()+
      labs(x="Day", y="MCP (TL/MWh)", 
           title=  "Average, Minimum and Maximum Daily Market Clearing Price(MCP)",
           subtitle=" Energy Exchange Turkey(EXIST), between July 01 and July 31")+theme_test()

2.1.3. Weekly Day Ahead Market

Day Ahead Market weekly prices for the minimum, maximum, and average values can be seen below. Week numbers correspond to the sequence in a year of 52 weeks.

plot6<-EXIST_raw_df %>% group_by(Week = lubridate::week(Date))%>% summarise(Weekly_average_MCP = mean(MCP),Weekly_min_MCP=min(MCP),Weekly_max_MCP=max(MCP))%>%print()
## # A tibble: 5 x 4
##    Week Weekly_average_MCP Weekly_min_MCP Weekly_max_MCP
##   <dbl>              <dbl>          <dbl>          <dbl>
## 1    27               299.           165.           350.
## 2    28               283.           140.           321.
## 3    29               300.           195.           335.
## 4    30               304.           193.           350 
## 5    31               294.           196.           350.
plot6 %>% pivot_longer(.,-Week) %>% ggplot(.,aes(x=Week,y=value,color=name)) + geom_line()+
      labs(x="Week", y="MCP (TL/MWh)", 
           title=  "Average, Minimum and Maximum Weekly Market Clearing Price(MCP)",
           subtitle=" Energy Exchange Turkey(EXIST), between July 01 and July 31")+theme_test()

2.1.4. Day of the Week Day Ahead Market

Day Ahead Market prices according to the days of the week can be seen below. It should be noted that weekday 1 is equal to Sunday.

plot7<-EXIST_raw_df %>% group_by(Week_Day= lubridate::wday(Date))%>% summarise(Weekday_average_MCP = mean(MCP),Weekday_min_MCP=min(MCP),Weekday_max_MCP=max(MCP)) %>%print()
## # A tibble: 7 x 4
##   Week_Day Weekday_average_MCP Weekday_min_MCP Weekday_max_MCP
##      <dbl>               <dbl>           <dbl>           <dbl>
## 1        1                275.            174.            320.
## 2        2                302.            140.            350 
## 3        3                299.            194.            350.
## 4        4                307.            197.            350.
## 5        5                297.            197.            327.
## # ... with 2 more rows
plot7%>% pivot_longer(.,-Week_Day) %>% ggplot(.,aes(x=Week_Day,y=value,color=name)) + geom_line()+
     labs(x="Week Day", y="MCP (TL/MWh)", 
           title=  "Average, Minimum and Maximum Week Day Market Clearing Price(MCP)",
           subtitle=" Energy Exchange Turkey(EXIST), between July 01 and July 31")+theme_test()

2.1.5. Periodic Day Ahead Market

In the electricity energy market reports, the day is generally divided into three periods. The reason for this is to track and compare time periods in which energy useage is similar. The names of these periods are day, night and peak.

plot8<-EXIST_raw_df %>% 
transmute(MCP,SMP,Hour = as.numeric(lubridate::hour(Date)),Period=ifelse(8<=Hour & Hour<=16,"Day Period",ifelse(17<=Hour & Hour<=22,"Peak Period","Night Period")))%>%  group_by(Period)%>% summarise(Period_average_MCP=mean(MCP))%>% print()
## # A tibble: 3 x 2
##   Period       Period_average_MCP
##   <chr>                     <dbl>
## 1 Day Period                 303.
## 2 Night Period               279.
## 3 Peak Period                313.
plot8%>% ggplot(.,aes(x=Period,y=Period_average_MCP, fill=Period)) + geom_bar(stat="identity")+theme_test()+
    labs(x="Periods", y="MCP (TL/MWh)",
         title=  "Average Market Clearing Price(MCP) of different periods",
         subtitle=" Energy Exchange Turkey(EXIST), between July 01 and July 31")

2.1.6. Percentage Change of Daily Total MCP

The percentage change of total MCP according to previous day data can be seen below.

Change1<-EXIST_raw_df %>%select(Date, MCP)%>%group_by(Day = lubridate::day(Date))%>%summarise(Daily_total_MCP = sum(MCP)) %>% ungroup()%>%mutate(Daily_total_MCP_previous=lag(Daily_total_MCP,1))%>%transmute(Day,Daily_total_MCP_previous, Daily_total_MCP, Percentage_change=((Daily_total_MCP-Daily_total_MCP_previous)/Daily_total_MCP_previous)*100)

knitr::kable(Change1, format="markdown")
Day Daily_total_MCP_previous Daily_total_MCP Percentage_change
1 NA 7683.25 NA
2 7683.25 7158.44 -6.8305730
3 7158.44 7598.72 6.1505021
4 7598.72 7344.02 -3.3518803
5 7344.02 6180.66 -15.8409155
6 6180.66 6964.39 12.6803610
7 6964.39 7366.94 5.7801186
8 7366.94 7296.11 -0.9614575
9 7296.11 6917.70 -5.1864624
10 6917.70 6763.75 -2.2254507
11 6763.75 6558.33 -3.0370726
12 6558.33 6266.18 -4.4546401
13 6266.18 6933.35 10.6471566
14 6933.35 6738.07 -2.8165317
15 6738.07 7019.81 4.1813160
16 7019.81 7353.11 4.7479918
17 7353.11 7278.49 -1.0148087
18 7278.49 7109.00 -2.3286423
19 7109.00 7004.73 -1.4667323
20 7004.73 7518.47 7.3341870
21 7518.47 7139.20 -5.0445104
22 7139.20 7284.27 2.0320204
23 7284.27 7294.38 0.1387922
24 7294.38 7558.37 3.6190876
25 7558.37 7003.44 -7.3419269
26 7003.44 6958.01 -0.6486812
27 6958.01 7579.61 8.9335888
28 7579.61 7443.83 -1.7913850
29 7443.83 7546.48 1.3789944
30 7546.48 6921.04 -8.2878375
31 6921.04 6709.74 -3.0530094

2.2. Balancing Power Market (BPM)

2.2.1. Hourly Balancing Power Market

Balancing Power Market hourly prices for the minimum, maximum, and average values can be see below.

plot9<-EXIST_raw_df%>% group_by(Hour=lubridate::hour(Date))%>%summarise(hourly_average_MSMP=mean(SMP), hourly_min_SMP=min(SMP), hourly_max_SMP=max(SMP))%>%print(plot)
## # A tibble: 24 x 4
##    Hour hourly_average_MSMP hourly_min_SMP hourly_max_SMP
##   <int>               <dbl>          <dbl>          <dbl>
## 1     0                294.            179           365 
## 2     1                308.            180           361.
## 3     2                297.            180           357.
## 4     3                283.            176           350 
## 5     4                280.            170           347.
## # ... with 19 more rows
plot9 %>% pivot_longer(.,-Hour) %>% ggplot(.,aes(x=Hour,y=value,color=name)) + geom_line()+
      labs(x="Hour", y="SMP (TL/MWh)", 
           title=  "Average, Minimum and Maximum Hourly System Marginal Price(SMP)",
           subtitle=" Energy Exchange Turkey(EXIST), between July 01 and July 31")+theme_test()

2.2.2. Daily Balancing Power Market

Balancing Power Market daily prices for the minimum, maximum, and average values can be see below.

plot10<-EXIST_raw_df%>%group_by(Day=lubridate::day(Date))%>%summarise(daily_average_SMP=mean(SMP), daily_min_SMP=min(SMP), daily_max_SMP=max(SMP))%>%print()
## # A tibble: 31 x 4
##     Day daily_average_SMP daily_min_SMP daily_max_SMP
##   <int>             <dbl>         <dbl>         <dbl>
## 1     1              268.          114.          377.
## 2     2              357.          229.          404.
## 3     3              373.          335.          460 
## 4     4              321.          235           365 
## 5     5              198.          120           266.
## # ... with 26 more rows
plot10%>% pivot_longer(.,-Day) %>% ggplot(.,aes(x=Day,y=value,color=name)) + geom_line()+
      labs(x="Day", y="SMP (TL/MWh)", 
           title=  "Average, Minimum and Maximum Daily System Marginal Price(SMP)",
           subtitle=" Energy Exchange Turkey(EXIST), between July 01 and July 31")+theme_test()

2.2.3. Weekly Balancing Power Market

Balancing Power Market weekly prices for the minimum, maximum, and average values can be see below.Week numbers correspond to the sequence in a year of 52 weeks.

plot11<-EXIST_raw_df%>% group_by(Week=lubridate::week(Date))%>%summarise(weekly_average_SMP=mean(SMP), weekly_min_SMP=min(SMP), weekly_max_SMP=max(SMP))%>%print()
## # A tibble: 5 x 4
##    Week weekly_average_SMP weekly_min_SMP weekly_max_SMP
##   <dbl>              <dbl>          <dbl>          <dbl>
## 1    27               303.           114.           460 
## 2    28               263.           124.           369.
## 3    29               315.           199.           386.
## 4    30               330.           201.           435 
## 5    31               270.            10            365
plot11 %>% pivot_longer(.,-Week) %>% ggplot(.,aes(x=Week,y=value,color=name)) + geom_line()+
       labs(x="Week", y="SMP (TL/MWh)", 
            title=  "Average, Minimum and Maximum Weekly System Marginal Price(SMP)",
            subtitle=" Energy Exchange Turkey(EXIST), between July 01 and July 31")+theme_test()

2.2.4. Day of the Week Balancing Power Market

Balancing Power Market prices according to the days of the week can be seen below. It should be noted that weekday 1 is equal to Sunday.

plot12<-EXIST_raw_df%>%group_by(Week_Day=lubridate::wday(Date))%>%summarise(Weekday_average_SMP=mean(SMP),Weekday_min_SMP=min(SMP),Weekday_max_SMP=max(SMP))%>%print()
## # A tibble: 7 x 4
##   Week_Day Weekday_average_SMP Weekday_min_SMP Weekday_max_SMP
##      <dbl>               <dbl>           <dbl>           <dbl>
## 1        1                289.            120             419.
## 2        2                317.            140.            435 
## 3        3                314.            179             374.
## 4        4                276.            114.            386.
## 5        5                301.            124.            404.
## # ... with 2 more rows
plot12 %>%pivot_longer(.,-Week_Day) %>% ggplot(.,aes(x=Week_Day,y=value,color=name)) + geom_line()+
      labs(x="Week Day", y="SMP (TL/MWh)", 
           title=  "Average, Minimum and Maximum Week Day System Marginal Price(SMP)",
           subtitle=" Energy Exchange Turkey(EXIST), between July 01 and July 31")+theme_test()

2.2.5. Periodic Balancing Power Market

In the electricity energy market reports, the day is generally divided into three periods. The reason for this is to track and compare time periods in which energy useage is similar. The names of these periods are day, night and peak.

plot13<-EXIST_raw_df %>% 
transmute(MCP,SMP,Hour = as.numeric(lubridate::hour(Date)),Period=ifelse(8<=Hour & Hour<=16,"Day Period",ifelse(17<=Hour & Hour<=22,"Peak Period","Night Period")))%>%  group_by(Period)%>% summarise(Period_average_SMP=mean(SMP))%>% print()
## # A tibble: 3 x 2
##   Period       Period_average_SMP
##   <chr>                     <dbl>
## 1 Day Period                 307.
## 2 Night Period               276.
## 3 Peak Period                322.
plot13%>% ggplot(.,aes(x=Period,y=Period_average_SMP, fill=Period)) + geom_bar(stat="identity")+theme_test()+
       labs(x="Periods", y="SMP (TL/MWh)", 
            title=  "Average System Marginal Price(SMP) of different periods",
            subtitle=" Energy Exchange Turkey(EXIST), between July 01 and July 31")

2.2.6. Percentage Change of Daily Total SMP

The percentage change of total SMP according to previous day data can be seen below.

Change2<-EXIST_raw_df %>%select(Date, SMP)%>%group_by(Day = lubridate::day(Date))%>%summarise(Daily_total_SMP = sum(SMP)) %>% ungroup()%>%mutate(Daily_total_SMP_previous=lag(Daily_total_SMP,1))%>%transmute(Day,Daily_total_SMP_previous, Daily_total_SMP, Percentage_change=((Daily_total_SMP-Daily_total_SMP_previous)/Daily_total_SMP_previous)*100)

knitr::kable(Change2, format="markdown")
Day Daily_total_SMP_previous Daily_total_SMP Percentage_change
1 NA 6440.82 NA
2 6440.82 8565.79 32.9922277
3 8565.79 8946.56 4.4452409
4 8946.56 7712.26 -13.7963642
5 7712.26 4746.53 -38.4547461
6 4746.53 7366.88 55.2055923
7 7366.88 7154.84 -2.8782877
8 7154.84 4580.86 -35.9753677
9 4580.86 4532.73 -1.0506761
10 4532.73 7004.96 54.5417442
11 7004.96 7416.11 5.8694125
12 7416.11 6796.45 -8.3555934
13 6796.45 6535.35 -3.8417115
14 6535.35 7241.82 10.8099796
15 7241.82 8099.63 11.8452268
16 8099.63 7485.95 -7.5766424
17 7485.95 6306.91 -15.7500384
18 6306.91 7394.06 17.2374427
19 7394.06 7799.08 5.4776402
20 7799.08 8037.46 3.0565144
21 8037.46 7741.72 -3.6795206
22 7741.72 6872.51 -11.2276083
23 6872.51 7954.40 15.7422834
24 7954.40 8302.66 4.3782058
25 8302.66 7319.23 -11.8447582
26 7319.23 8411.83 14.9277998
27 8411.83 8466.21 0.6464705
28 8466.21 8046.61 -4.9561728
29 8046.61 7098.78 -11.7792462
30 7098.78 7560.19 6.4998493
31 7560.19 4770.82 -36.8955013

2.3. Positive and Negative Imbalance Prices

2.3.1. First Day Positive and Negative Imbalance Price

Negative and Positive imbalance prices(hourly) can be seen below for the first day of the July, 2020.

EXIST_raw_df %>% select(Date, PositiveIP, NegativeIP)%>%group_by(Day = lubridate::day(Date), Hour = lubridate::hour(Date))%>%select(Day,Hour, PositiveIP, NegativeIP)%>%
filter(Day==1)%>%ggplot(aes(Hour, color = "Hour"))+
    geom_line(aes(y=PositiveIP, color = "Positive imbalance Price")) +
    geom_line(aes(y=NegativeIP, color = "Negative imbalance Price")) +
    labs(x = "Hour", y = "TL/MWh",
         title= "Positive and Negative Imbalance Price of the First Day of July",
         subtitle = " Energy Exchange Turkey(EXIST), between July 01 and July 31") +
    theme_test()

2.3.2. Last Day Positive and Negative Imbalance Price

Negative and Positive imbalance prices(hourly) can be seen below for the last day of the July, 2020.

EXIST_raw_df %>% select(Date, PositiveIP, NegativeIP)%>%group_by(Day = lubridate::day(Date), Hour = lubridate::hour(Date))%>%select(Day,Hour, PositiveIP, NegativeIP)%>%
filter(Day==31)%>%ggplot(aes(Hour, color = "Hour"))+
    geom_line(aes(y=PositiveIP, color = "Positive imbalance Price")) +
    geom_line(aes(y=NegativeIP, color = "Negative imbalance Price")) +
    labs(x = "Hour", y = "TL/MWh",
         title= "Positive and Negative Imbalance Price of the Last Day of July",
         subtitle = " Energy Exchange Turkey(EXIST), between July 01 and July 31") +
    theme_test()

2.3.3. Hourly Average Positive and Negative Imbalance Price Difference

Difference<-EXIST_raw_df%>%select(Date, PositiveIP, NegativeIP)%>%group_by(Hour = lubridate::hour(Date))%>%summarise(Average_PositiveIP=mean(PositiveIP), Average_NegativeIP=mean(NegativeIP))%>%select(Hour, Average_PositiveIP, Average_NegativeIP)%>%ungroup()%>%transmute(Hour,Average_PositiveIP, Average_NegativeIP, Difference=Average_NegativeIP-Average_PositiveIP)

knitr::kable(Difference, format="markdown")
Hour Average_PositiveIP Average_NegativeIP Difference
0 269.2268 323.5535 54.32677
1 280.5371 333.8952 53.35806
2 271.2771 325.2674 53.99032
3 256.6313 311.7713 55.14000
4 256.6090 309.3490 52.74000
5 225.7297 270.2316 44.50194
6 196.8674 230.2858 33.41839
7 238.5184 291.3932 52.87484
8 256.5419 316.9471 60.40516
9 261.0352 319.3765 58.34129
10 261.5365 331.7006 70.16419
11 273.0135 340.9371 67.92355
12 265.3561 331.9419 66.58581
13 275.2100 338.6861 63.47613
14 289.9506 352.0458 62.09516
15 288.8561 355.0439 66.18774
16 289.3042 355.4916 66.18742
17 289.2619 351.1732 61.91129
18 288.9545 346.5477 57.59323
19 289.1487 346.7610 57.61226
20 278.8616 352.0777 73.21613
21 288.0726 356.9987 68.92613
22 283.3090 348.8832 65.57419
23 273.2503 339.5332 66.28290

2.4. Energy Imbalance

These are energy deficit, energy surplus, and energy balance due to the relationship between actual demand and predicted demand. In the data we examine, there are energy deficit, surplus and balance states on an hourly basis. This information is given in the column called SMP Direction. As we did with the market prices, we can also make an analysis for these states in order to consider how many deficit, surplus, or balance occured.This may be an important insight regarding the prediction reliability.Before making a more detailed analysis, it would be useful to give the overall state of the mont July of 2020.

plot11<-EXIST_raw_df %>% group_by(SMPDirection)%>%summarise(count = n())%>%print()
## # A tibble: 3 x 2
##   SMPDirection   count
##   <fct>          <int>
## 1 Energy Deficit   528
## 2 Energy Surplus   195
## 3 In Balance        21
plot11%>%ggplot(.,aes(x="", y=count, fill=SMPDirection)) + geom_bar(stat="identity", width=1) + coord_polar("y", start=0)+theme_test()+
      labs( title=  "Energy Imbalance in June 2020",
            subtitle=" Energy Exchange Turkey(EXIST), between July 01 and July 31")

2.4.1. Hourly Energy Deficit, Energy Surplus,and Balance Distribution

Hourly energy deficit, energy surplus, and energy balance bar chart can be seen below.

plot14<-EXIST_raw_df %>% group_by(Hour = lubridate::hour(Date))%>% 
  summarise(Surplus = sum(MCP>SMP), Deficit=sum(MCP<SMP), Balance=sum(MCP==SMP)) %>% ungroup() %>%
  select(Hour, Surplus, Deficit, Balance) 
plot15 <- melt(plot14, id.vars='Hour')
plot15%>%ggplot(.,aes(x=Hour,y=value, fill=variable)) + geom_bar(stat="identity", position="dodge")+theme_test()+
     labs( title=  "Hourly Energy Imbalance",
          subtitle=" Energy Exchange Turkey(EXIST), between July 01 and July 31")

2.4.2. Daily Energy Deficit, Energy Surplus,and Balance Distribution

Daily energy deficit, energy surplus, and energy balance bar chart can be seen below.

plot12<-EXIST_raw_df %>% group_by(Day = lubridate::day(Date))%>% summarise(Surplus = sum(MCP>SMP), Deficit=sum(MCP<SMP), Balance=sum(MCP==SMP)) %>% ungroup() %>%
select(Day, Surplus, Deficit, Balance) 
plot13 <- melt(plot12, id.vars='Day')
plot13%>%ggplot(.,aes(x=Day,y=value, fill=variable)) + geom_bar(stat="identity", position="dodge")+theme_test()+
      labs( title=  "Daily Energy Imbalance",
            subtitle=" Energy Exchange Turkey(EXIST), between July 01 and July 31")

2.4.3. Weekly Energy Deficit, Energy Surplus,and Balance Distribution

Weekly energy deficit, energy surplus, and energy balance bar chart can be seen below.Week numbers correspond to the sequence in a year of 52 weeks.

plot16<-EXIST_raw_df %>% group_by(Week_number = lubridate::week(Date))%>% 
summarise(Surplus = sum(MCP>SMP), Deficit=sum(MCP<SMP), Balance=sum(MCP==SMP)) %>% ungroup() %>%
select(Week_number, Surplus, Deficit, Balance) 
plot17 <- melt(plot16, id.vars='Week_number')
plot17%>%ggplot(.,aes(x=Week_number,y=value, fill=variable)) + geom_bar(stat="identity", position="dodge")+theme_test()+
      labs( title=  "Weekly Energy Imbalance",
            subtitle=" Energy Exchange Turkey(EXIST), between July 01 and July 31")

2.4.4. Day of the Week Energy Deficit, Energy Surplus,and Balance Distribution

Energy deficit, energy surplus, and energy balance bar chart according to the day of the week can be seen below.It should be noted that weekday 1 is equal to Sunday.

plot18<-EXIST_raw_df %>% group_by(Week_day = lubridate::wday(Date))%>% 
  summarise(Surplus = sum(MCP>SMP), Deficit=sum(MCP<SMP), Balance=sum(MCP==SMP)) %>% ungroup() %>%
  select(Week_day, Surplus, Deficit, Balance) 
plot19 <- melt(plot18, id.vars='Week_day')
plot19%>%ggplot(.,aes(x=Week_day,y=value, fill=variable)) + geom_bar(stat="identity", position="dodge")+theme_test()+
      labs(title=  "Day of the Week Energy Imbalance",
           subtitle=" Energy Exchange Turkey(EXIST), between July 01 and July 31")