(* Content-type: application/vnd.wolfram.mathematica *) (*** Wolfram Notebook File ***) (* http://www.wolfram.com/nb *) (* CreatedBy='Mathematica 13.0' *) (*CacheID: 234*) (* Internal cache information: NotebookFileLineBreakTest NotebookFileLineBreakTest NotebookDataPosition[ 158, 7] NotebookDataLength[ 37356, 861] NotebookOptionsPosition[ 35189, 826] NotebookOutlinePosition[ 35660, 844] CellTagsIndexPosition[ 35617, 841] WindowFrame->Normal*) (* Beginning of Notebook Content *) Notebook[{ Cell[BoxData[{ RowBox[{ RowBox[{"Quiet", "@", RowBox[{"Remove", "[", "\"\\"", "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"SetDirectory", "[", RowBox[{"NotebookDirectory", "[", "]"}], "]"}], ";"}]}], "Input", CellChangeTimes->{{3.876136233380721*^9, 3.876136332922374*^9}, { 3.876136382083767*^9, 3.8761364735949364`*^9}, {3.8761382928698516`*^9, 3.876138309133936*^9}, {3.8761393480875797`*^9, 3.8761393496271715`*^9}, { 3.8761399080271606`*^9, 3.8761399152175803`*^9}, {3.876140152655674*^9, 3.8761401944435263`*^9}, {3.8768822881217785`*^9, 3.8768823062110996`*^9}, 3.876887136958232*^9, {3.88709384384293*^9, 3.8870939023889246`*^9}, 3.8870939621478434`*^9, {3.8870941302556715`*^9, 3.8870942489514575`*^9}, { 3.8870943330884933`*^9, 3.8870943532437243`*^9}, {3.887094496667581*^9, 3.8870944980688043`*^9}, 3.8870945291849747`*^9, {3.887094567933261*^9, 3.887094598324176*^9}, {3.887094629188441*^9, 3.8870946308951225`*^9}, { 3.887095023728532*^9, 3.887095032014219*^9}, {3.8870950796670904`*^9, 3.8870950799818916`*^9}, {3.8870951463546815`*^9, 3.8870951474814243`*^9}, {3.8870952043915057`*^9, 3.887095209975727*^9}, { 3.88710773540365*^9, 3.887107735801388*^9}, 3.888294220021392*^9, { 3.8882949525361013`*^9, 3.8882949532310925`*^9}, {3.8889804602041554`*^9, 3.888980460218959*^9}, {3.888980568033196*^9, 3.888980570813286*^9}, { 3.889166992830758*^9, 3.8891670074725933`*^9}, {3.889192469812383*^9, 3.8891924715125895`*^9}, 3.8891925546291265`*^9, 3.89045158430868*^9, 3.8904516211587553`*^9, 3.890457297169201*^9, {3.8906267296612525`*^9, 3.8906267510663347`*^9}, 3.8906269033961325`*^9, 3.8906532636656113`*^9, 3.8907029412619762`*^9, 3.890724185453334*^9, {3.890724455608946*^9, 3.890724455759853*^9}, 3.8907247253072376`*^9, {3.8912346498145876`*^9, 3.89123466077256*^9}, {3.8912557749953475`*^9, 3.8912557767266235`*^9}, { 3.891255833333596*^9, 3.8912558450101967`*^9}, {3.891314989708617*^9, 3.891314991289711*^9}, {3.8913166313762217`*^9, 3.89131664058609*^9}, { 3.891581942653346*^9, 3.8915819452740545`*^9}, {3.8915820427036877`*^9, 3.891582044157175*^9}, {3.8953169583725176`*^9, 3.8953169718085394`*^9}, { 3.895317037621552*^9, 3.8953170613608217`*^9}, {3.895373636307861*^9, 3.8953736366008525`*^9}, 3.8954769817539186`*^9}, CellLabel->"In[14]:=",ExpressionUUID->"bd32a76d-c6bc-4c55-9df2-68b326674dda"], Cell[BoxData[{ RowBox[{ RowBox[{"data2019", "=", RowBox[{"Import", "[", RowBox[{"\"\\"", ",", RowBox[{"{", RowBox[{"\"\\"", ",", "5"}], "}"}]}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"data2020", "=", RowBox[{"Import", "[", RowBox[{"\"\\"", ",", RowBox[{"{", RowBox[{"\"\\"", ",", "6"}], "}"}]}], "]"}]}], ";"}]}], "Input", CellChangeTimes->{{3.876136233380721*^9, 3.876136332922374*^9}, { 3.876136382083767*^9, 3.8761364735949364`*^9}, {3.8761382928698516`*^9, 3.876138309133936*^9}, {3.8761393480875797`*^9, 3.8761393496271715`*^9}, { 3.8761399080271606`*^9, 3.8761399152175803`*^9}, {3.876140152655674*^9, 3.8761401944435263`*^9}, {3.8768822881217785`*^9, 3.8768823062110996`*^9}, 3.876887136958232*^9, {3.88709384384293*^9, 3.8870939023889246`*^9}, 3.8870939621478434`*^9, {3.8870941302556715`*^9, 3.8870942489514575`*^9}, { 3.8870943330884933`*^9, 3.8870943532437243`*^9}, {3.887094496667581*^9, 3.8870944980688043`*^9}, 3.8870945291849747`*^9, {3.887094567933261*^9, 3.887094598324176*^9}, {3.887094629188441*^9, 3.8870946308951225`*^9}, { 3.887095023728532*^9, 3.887095032014219*^9}, {3.8870950796670904`*^9, 3.8870950799818916`*^9}, {3.8870951463546815`*^9, 3.8870951474814243`*^9}, {3.8870952043915057`*^9, 3.887095209975727*^9}, { 3.88710773540365*^9, 3.887107735801388*^9}, 3.888294220021392*^9, { 3.8882949525361013`*^9, 3.8882949532310925`*^9}, {3.8889804602041554`*^9, 3.888980460218959*^9}, {3.888980568033196*^9, 3.888980570813286*^9}, { 3.889166992830758*^9, 3.8891670074725933`*^9}, {3.889192469812383*^9, 3.8891924715125895`*^9}, 3.8891925546291265`*^9, 3.89045158430868*^9, 3.8904516211587553`*^9, 3.890457297169201*^9, {3.8906267296612525`*^9, 3.8906267510663347`*^9}, 3.8906269033961325`*^9, 3.8906532636656113`*^9, 3.8907029412619762`*^9, 3.890724185453334*^9, {3.890724455608946*^9, 3.890724455759853*^9}, 3.8907247253072376`*^9, {3.8912346498145876`*^9, 3.89123466077256*^9}, {3.8912557749953475`*^9, 3.8912557767266235`*^9}, { 3.891255833333596*^9, 3.8912558450101967`*^9}, {3.891314989708617*^9, 3.891314991289711*^9}, {3.8913166313762217`*^9, 3.89131664058609*^9}, { 3.891581942653346*^9, 3.8915819452740545`*^9}, {3.8915820427036877`*^9, 3.891582044157175*^9}, {3.8953169583725176`*^9, 3.8953169718085394`*^9}, { 3.895317037621552*^9, 3.8953170613608217`*^9}, {3.895373636307861*^9, 3.8953736366008525`*^9}, 3.8954769817539186`*^9}, CellLabel->"In[16]:=",ExpressionUUID->"d81d47ef-1d86-4964-895f-a132092d623f"], Cell[BoxData[{ RowBox[{ RowBox[{"time2019", "=", RowBox[{"data2019", "[", RowBox[{"[", RowBox[{"All", ",", "1"}], "]"}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"time2020", "=", RowBox[{"data2020", "[", RowBox[{"[", RowBox[{"All", ",", "1"}], "]"}], "]"}]}], ";"}]}], "Input", CellChangeTimes->{{3.8870946537908373`*^9, 3.8870946752038507`*^9}, { 3.88709471791178*^9, 3.8870947518574743`*^9}, {3.8870948365469937`*^9, 3.88709483706838*^9}, {3.8870949718926387`*^9, 3.8870949747745295`*^9}, { 3.8870954091854386`*^9, 3.887095590535078*^9}, {3.8870959832072997`*^9, 3.887096048739237*^9}, {3.8870960964714518`*^9, 3.887096130072853*^9}, { 3.8870962473186216`*^9, 3.8870962616586804`*^9}, 3.887096905455411*^9, { 3.8870969549269824`*^9, 3.887097058852585*^9}, {3.887097142881671*^9, 3.8870971526267405`*^9}, {3.887097266961115*^9, 3.8870973227566223`*^9}, { 3.887097539497896*^9, 3.8870976429113145`*^9}, {3.8870976905808496`*^9, 3.8870976940022044`*^9}, {3.887097725721055*^9, 3.8870977264117827`*^9}, { 3.8871075980222435`*^9, 3.887107598322671*^9}, {3.887107845826832*^9, 3.8871080515091443`*^9}, {3.8871081614386654`*^9, 3.8871082115672693`*^9}, {3.887164272814642*^9, 3.8871642767374425`*^9}, { 3.8873572459713964`*^9, 3.887357285374618*^9}, {3.887539750207399*^9, 3.8875397504459887`*^9}, {3.8889804602407475`*^9, 3.8889804602483964`*^9}, {3.8891658099070225`*^9, 3.8891658131088734`*^9}, {3.8891669329624395`*^9, 3.889166933102519*^9}, { 3.889166981481282*^9, 3.8891669822147655`*^9}, {3.889167086698965*^9, 3.889167088988637*^9}, {3.8891768594436417`*^9, 3.88917686111512*^9}, { 3.88919133014223*^9, 3.8891913543045235`*^9}, {3.890724222226696*^9, 3.890724223860038*^9}, {3.891255965422971*^9, 3.891255966527738*^9}, { 3.891256374043618*^9, 3.891256392651716*^9}, {3.8913152784978347`*^9, 3.891315311133216*^9}, {3.891316662004531*^9, 3.891316666165722*^9}, 3.8915748134603124`*^9, {3.8946154235196767`*^9, 3.8946154332048683`*^9}, { 3.8946766208286753`*^9, 3.8946766228672843`*^9}, {3.8946768079011803`*^9, 3.8946768380182934`*^9}, {3.907146960241872*^9, 3.907146966657197*^9}},ExpressionUUID->"c478f55f-de6c-4c16-bc73-\ 14aa3617401a"], Cell[BoxData[ RowBox[{ RowBox[{ RowBox[{"polishData", "[", RowBox[{"data_", ",", "time_"}], "]"}], ":=", RowBox[{"Module", "[", RowBox[{ RowBox[{"{", RowBox[{ "withTime", ",", "dropTitle", ",", "deNULL", ",", "polishedData", ",", "startState", ",", "endState", ",", "deAnom", ",", "spotreby", ",", "title", ",", "mu", ",", "sigma", ",", "zScore", ",", "zScoreFilter", ",", "DataOMHeader", ",", "OMseries", ",", "timeDifference", ",", "rocniSpotreba"}], "}"}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"withTime", "=", RowBox[{"Transpose", "[", RowBox[{"{", RowBox[{"time", ",", "data"}], "}"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"title", "=", RowBox[{ RowBox[{"Take", "[", "withTime", "]"}], "[", RowBox[{"[", RowBox[{"1", ",", "2"}], "]"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"dropTitle", "=", RowBox[{"Drop", "[", RowBox[{"withTime", ",", RowBox[{"{", RowBox[{"1", ",", "1"}], "}"}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"deNULL", "=", RowBox[{"DeleteCases", "[", RowBox[{ RowBox[{"dropTitle", "/.", " ", RowBox[{"\"\<\>\"", "->", "x"}]}], ",", RowBox[{"{", RowBox[{"_", ",", "x"}], "}"}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"startState", "=", RowBox[{"deNULL", "[", RowBox[{"[", RowBox[{"1", ",", "2"}], "]"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"endState", "=", RowBox[{"deNULL", "[", RowBox[{"[", RowBox[{ RowBox[{"-", "1"}], ",", "2"}], "]"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"deAnom", "=", RowBox[{"DeleteCases", "[", RowBox[{"deNULL", ",", RowBox[{ RowBox[{"{", RowBox[{"_", ",", "x_"}], "}"}], "/;", RowBox[{ RowBox[{"x", ">", "endState"}], "||", RowBox[{"x", "<", "startState"}]}]}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"rocniSpotreba", "=", RowBox[{"endState", "-", "startState"}]}], ";", "\[IndentingNewLine]", RowBox[{"spotreby", "=", RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{"title", ",", RowBox[{"Round", "[", RowBox[{"24", "*", "60", "*", RowBox[{"deAnom", "[", RowBox[{"[", RowBox[{"i", ",", "1"}], "]"}], "]"}]}], "]"}], ",", FractionBox[ RowBox[{ RowBox[{"deAnom", "[", RowBox[{"[", RowBox[{ RowBox[{"i", "+", "1"}], ",", "2"}], "]"}], "]"}], "-", RowBox[{"deAnom", "[", RowBox[{"[", RowBox[{"i", ",", "2"}], "]"}], "]"}]}], RowBox[{"24", "*", RowBox[{"(", RowBox[{ RowBox[{"deAnom", "[", RowBox[{"[", RowBox[{ RowBox[{"i", "+", "1"}], ",", "1"}], "]"}], "]"}], "-", RowBox[{"deAnom", "[", RowBox[{"[", RowBox[{"i", ",", "1"}], "]"}], "]"}]}], ")"}]}]]}], "}"}], ",", RowBox[{"{", RowBox[{"i", ",", "1", ",", RowBox[{ RowBox[{"Length", "[", "deAnom", "]"}], "-", "1"}]}], "}"}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"mu", "=", RowBox[{"Mean", "[", RowBox[{"spotreby", "[", RowBox[{"[", RowBox[{"All", ",", "3"}], "]"}], "]"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"sigma", "=", RowBox[{"StandardDeviation", "[", RowBox[{"spotreby", "[", RowBox[{"[", RowBox[{"All", ",", "3"}], "]"}], "]"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"zScore", "=", RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{"title", ",", RowBox[{"spotreby", "[", RowBox[{"[", RowBox[{"i", ",", "2"}], "]"}], "]"}], ",", RowBox[{"spotreby", "[", RowBox[{"[", RowBox[{"i", ",", "3"}], "]"}], "]"}], ",", RowBox[{"If", "[", RowBox[{ RowBox[{"sigma", "==", "0"}], ",", "Null", ",", FractionBox[ RowBox[{ RowBox[{"spotreby", "[", RowBox[{"[", RowBox[{"i", ",", "3"}], "]"}], "]"}], "-", "mu"}], "sigma"]}], "]"}], ",", "mu", ",", "sigma", ",", "rocniSpotreba"}], "}"}], ",", RowBox[{"{", RowBox[{"i", ",", "1", ",", RowBox[{"Length", "[", "spotreby", "]"}]}], "}"}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"zScoreFilter", "=", RowBox[{"DeleteCases", "[", RowBox[{"zScore", ",", RowBox[{ RowBox[{"{", RowBox[{"_", ",", "_", ",", "_", ",", "x_"}], "}"}], "/;", RowBox[{"x", "==", "Null"}]}]}], "]"}]}]}]}], "\[IndentingNewLine]", "\[IndentingNewLine]", "]"}]}], ";"}]], "Input", CellChangeTimes->{{3.8871636772515574`*^9, 3.887163904546315*^9}, { 3.8871639359047585`*^9, 3.8871641567753134`*^9}, {3.887164267524316*^9, 3.887164268840949*^9}, {3.8873572959418783`*^9, 3.887357304724453*^9}, { 3.887539744307891*^9, 3.8875397456921864`*^9}, 3.889010039680447*^9, { 3.889165666295373*^9, 3.889165666657035*^9}, {3.88916716001483*^9, 3.88916718153193*^9}, {3.889167349419216*^9, 3.8891673770164127`*^9}, { 3.889183564726572*^9, 3.889183612137253*^9}, {3.8891839811132493`*^9, 3.889184002280277*^9}, {3.8891909251233735`*^9, 3.889190929153138*^9}, { 3.889190959259795*^9, 3.8891910042368135`*^9}, {3.8891912802336407`*^9, 3.889191320369973*^9}, 3.8891913635199485`*^9, {3.8904510207721815`*^9, 3.8904510612035937`*^9}, {3.890456668167841*^9, 3.8904566745602818`*^9}, { 3.8906515052754664`*^9, 3.8906516306645517`*^9}, 3.890651889740119*^9, { 3.890651982177468*^9, 3.8906519871361856`*^9}, {3.8906523671688943`*^9, 3.8906524501512156`*^9}, {3.890652545476711*^9, 3.8906525741095595`*^9}, { 3.890652604204748*^9, 3.8906526060132256`*^9}, {3.890652642602843*^9, 3.8906526441138964`*^9}, {3.8906527087799625`*^9, 3.890652710900835*^9}, 3.8906528073573103`*^9, {3.8907025236194754`*^9, 3.8907025469876842`*^9}, { 3.8912566200135775`*^9, 3.8912566232305994`*^9}, {3.8912570788914804`*^9, 3.8912570805204773`*^9}, {3.8912571461680994`*^9, 3.8912572166373835`*^9}, {3.891258704368604*^9, 3.89125878462251*^9}, { 3.891258821251622*^9, 3.8912588255879965`*^9}, {3.891259147531091*^9, 3.891259183545024*^9}, {3.8913154093823624`*^9, 3.8913154774997845`*^9}, { 3.8944576403411283`*^9, 3.8944576689826703`*^9}, {3.8944593493411055`*^9, 3.894459377731149*^9}, {3.8944595312460814`*^9, 3.894459537071869*^9}, { 3.8956547136937246`*^9, 3.8956547392130566`*^9}, {3.8956547797722464`*^9, 3.895654854290131*^9}, {3.9071469839896183`*^9, 3.907146991839261*^9}, { 3.907147110266862*^9, 3.9071471109002285`*^9}},ExpressionUUID->"97c6c365-7a84-492d-9b54-\ debfa2fa4cd7"], Cell[BoxData[{ RowBox[{ RowBox[{"NumOfPoints2019", "=", RowBox[{"Length", "[", RowBox[{"data2019", "[", RowBox[{"[", RowBox[{"1", ",", "All"}], "]"}], "]"}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"NumOfPoints2020", "=", RowBox[{"Length", "[", RowBox[{"data2020", "[", RowBox[{"[", RowBox[{"1", ",", "All"}], "]"}], "]"}], "]"}]}], ";"}]}], "Input", CellChangeTimes->{{3.887348630133071*^9, 3.88734865050319*^9}, { 3.8873487687687254`*^9, 3.8873488440915165`*^9}, 3.8873488851592216`*^9, { 3.8873489247412148`*^9, 3.8873489249729576`*^9}, {3.8873489570535975`*^9, 3.887349073885619*^9}, {3.8873491583919387`*^9, 3.887349240388854*^9}, { 3.8873504781051903`*^9, 3.8873506007601023`*^9}, {3.8875397556188*^9, 3.8875397566355877`*^9}, {3.888295273130382*^9, 3.8882952757847705`*^9}, { 3.8889804602646785`*^9, 3.8889804602709165`*^9}, {3.8890100553261657`*^9, 3.8890100751405354`*^9}, {3.8891764308044567`*^9, 3.889176437332396*^9}, { 3.8891767351809306`*^9, 3.889176736664892*^9}, {3.889176789154283*^9, 3.8891768231083317`*^9}, {3.889183629211507*^9, 3.889183629523918*^9}, { 3.8907243639727755`*^9, 3.8907243687150755`*^9}, {3.8912559797798567`*^9, 3.891255981604188*^9}, 3.8912567628008327`*^9, {3.8915827515128145`*^9, 3.891582756853403*^9}, {3.8915828243289747`*^9, 3.891582824813808*^9}, { 3.891582855043124*^9, 3.891582884952141*^9}, {3.907147000422268*^9, 3.9071470033885202`*^9}},ExpressionUUID->"e73968d3-1895-42cf-a586-\ 32d2e5bc15b3"], Cell[BoxData[{ RowBox[{ RowBox[{"tableMuSigma2019", "=", RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{ RowBox[{"polishData", "[", RowBox[{ RowBox[{"data2019", "[", RowBox[{"[", RowBox[{"All", ",", "i"}], "]"}], "]"}], ",", "time2019"}], "]"}], "[", RowBox[{"[", RowBox[{"2", ",", "1"}], "]"}], "]"}], ",", RowBox[{ RowBox[{"polishData", "[", RowBox[{ RowBox[{"data2019", "[", RowBox[{"[", RowBox[{"All", ",", "i"}], "]"}], "]"}], ",", "time2019"}], "]"}], "[", RowBox[{"[", RowBox[{"2", ",", "5"}], "]"}], "]"}], ",", RowBox[{ RowBox[{"polishData", "[", RowBox[{ RowBox[{"data2019", "[", RowBox[{"[", RowBox[{"All", ",", "i"}], "]"}], "]"}], ",", "time2019"}], "]"}], "[", RowBox[{"[", RowBox[{"2", ",", "6"}], "]"}], "]"}]}], "}"}], ",", RowBox[{"{", RowBox[{"i", ",", "2", ",", "NumOfPoints2019"}], "}"}]}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"tableMuSigma2020", "=", RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{ RowBox[{"polishData", "[", RowBox[{ RowBox[{"data2020", "[", RowBox[{"[", RowBox[{"All", ",", "i"}], "]"}], "]"}], ",", "time2020"}], "]"}], "[", RowBox[{"[", RowBox[{"2", ",", "1"}], "]"}], "]"}], ",", RowBox[{ RowBox[{"polishData", "[", RowBox[{ RowBox[{"data2020", "[", RowBox[{"[", RowBox[{"All", ",", "i"}], "]"}], "]"}], ",", "time2020"}], "]"}], "[", RowBox[{"[", RowBox[{"2", ",", "5"}], "]"}], "]"}], ",", RowBox[{ RowBox[{"polishData", "[", RowBox[{ RowBox[{"data2020", "[", RowBox[{"[", RowBox[{"All", ",", "i"}], "]"}], "]"}], ",", "time2020"}], "]"}], "[", RowBox[{"[", RowBox[{"2", ",", "6"}], "]"}], "]"}]}], "}"}], ",", RowBox[{"{", RowBox[{"i", ",", "2", ",", "NumOfPoints2020"}], "}"}]}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"Export", "[", RowBox[{"\"\\"", ",", "tableMuSigma2019"}], "]"}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"Export", "[", RowBox[{"\"\\"", ",", "tableMuSigma2020"}], "]"}], ";"}]}], "Input", CellChangeTimes->{{3.887354012209017*^9, 3.887354031894601*^9}, { 3.887354251173416*^9, 3.887354291716077*^9}, {3.8873544168446956`*^9, 3.8873544433254576`*^9}, {3.887354615840969*^9, 3.887354724628834*^9}, { 3.887354765629608*^9, 3.887354765960603*^9}, {3.8873553132967196`*^9, 3.887355382089465*^9}, {3.887355497935622*^9, 3.8873555182798557`*^9}, { 3.887355733770753*^9, 3.8873557898304133`*^9}, {3.887355949981742*^9, 3.887356026247944*^9}, {3.887356132649012*^9, 3.887356260401367*^9}, { 3.8873563194377546`*^9, 3.8873564884181957`*^9}, {3.887356554025402*^9, 3.8873566468267097`*^9}, {3.887356773476372*^9, 3.887356829271142*^9}, 3.887356881751216*^9, 3.8873569146600776`*^9, 3.887356969925171*^9, { 3.8873570211178627`*^9, 3.887357140749813*^9}, {3.8873572374331455`*^9, 3.887357256860545*^9}, {3.887357314845665*^9, 3.887357317664304*^9}, 3.888980460321022*^9, {3.8891837974997396`*^9, 3.8891837993742948`*^9}, { 3.8891840308515263`*^9, 3.8891840327477355`*^9}, {3.889184076050056*^9, 3.8891841584778996`*^9}, 3.8891843800924387`*^9, {3.8891907865475073`*^9, 3.8891908475926867`*^9}, 3.8907029516677055`*^9, 3.8912559849877872`*^9, { 3.891257241369102*^9, 3.891257274962639*^9}, {3.8912576509767995`*^9, 3.8912578063266106`*^9}, {3.8912578384167304`*^9, 3.8912578694342275`*^9}, {3.8912587942027807`*^9, 3.8912587970394278`*^9}, {3.8912588524187775`*^9, 3.891258887862522*^9}, 3.891259574682616*^9, {3.8913153547867374`*^9, 3.8913153694093666`*^9}, { 3.8913154902603393`*^9, 3.8913154961789875`*^9}, {3.891574921256297*^9, 3.891574922220545*^9}, {3.891582554897416*^9, 3.891582577754654*^9}, { 3.8915826185484695`*^9, 3.891582643938773*^9}, {3.8915826881011763`*^9, 3.891582725986044*^9}, {3.891582828241954*^9, 3.8915828792399254`*^9}, { 3.8915832901699743`*^9, 3.8915833117210913`*^9}, {3.8915834090341063`*^9, 3.8915835018089027`*^9}}, CellLabel->"In[76]:=",ExpressionUUID->"5dbbb556-c835-4c07-83c5-9426b5cb7ddd"], Cell[BoxData[{ RowBox[{"test2019", "=", RowBox[{"polishData", "[", RowBox[{ RowBox[{"data2019", "[", RowBox[{"[", RowBox[{"All", ",", "3"}], "]"}], "]"}], ",", "time2019"}], "]"}]}], "\[IndentingNewLine]", RowBox[{"test2020", "=", RowBox[{"polishData", "[", RowBox[{ RowBox[{"data2020", "[", RowBox[{"[", RowBox[{"All", ",", "3"}], "]"}], "]"}], ",", "time2020"}], "]"}]}]}], "Input", CellChangeTimes->{{3.887354012209017*^9, 3.887354031894601*^9}, { 3.887354251173416*^9, 3.887354291716077*^9}, {3.8873544168446956`*^9, 3.8873544433254576`*^9}, {3.887354615840969*^9, 3.887354724628834*^9}, { 3.887354765629608*^9, 3.887354765960603*^9}, {3.8873553132967196`*^9, 3.887355382089465*^9}, {3.887355497935622*^9, 3.8873555182798557`*^9}, { 3.887355733770753*^9, 3.8873557898304133`*^9}, {3.887355949981742*^9, 3.887356026247944*^9}, {3.887356132649012*^9, 3.887356260401367*^9}, { 3.8873563194377546`*^9, 3.8873564884181957`*^9}, {3.887356554025402*^9, 3.8873566468267097`*^9}, {3.887356773476372*^9, 3.887356829271142*^9}, 3.887356881751216*^9, 3.8873569146600776`*^9, 3.887356969925171*^9, { 3.8873570211178627`*^9, 3.887357140749813*^9}, {3.8873572374331455`*^9, 3.887357256860545*^9}, {3.887357314845665*^9, 3.887357317664304*^9}, 3.888980460321022*^9, {3.8891837974997396`*^9, 3.8891837993742948`*^9}, { 3.8891840308515263`*^9, 3.8891840327477355`*^9}, {3.889184076050056*^9, 3.8891841584778996`*^9}, 3.8891843800924387`*^9, {3.8891907865475073`*^9, 3.8891908475926867`*^9}, 3.8907029516677055`*^9, 3.8912559849877872`*^9, { 3.891257241369102*^9, 3.891257274962639*^9}, {3.8912576509767995`*^9, 3.8912578063266106`*^9}, {3.8912578384167304`*^9, 3.8912578694342275`*^9}, {3.8912587942027807`*^9, 3.8912587970394278`*^9}, {3.8912588524187775`*^9, 3.891258887862522*^9}, 3.891259574682616*^9, {3.8913153547867374`*^9, 3.8913153694093666`*^9}, { 3.8913154902603393`*^9, 3.8913154961789875`*^9}, {3.891574921256297*^9, 3.891574922220545*^9}, {3.891582554897416*^9, 3.891582560032787*^9}, { 3.89158266040425*^9, 3.8915826827953815`*^9}, {3.891582729925084*^9, 3.891582734172574*^9}, {3.8944562450442266`*^9, 3.8944562465400248`*^9}, 3.89445761678364*^9, 3.8944582144984436`*^9, 3.9071470182215*^9},ExpressionUUID->"2a63ff8d-8a04-42ab-9cd1-41ff801cf939"], Cell[BoxData[{ RowBox[{ RowBox[{"Export", "[", RowBox[{"\"\\"", ",", "test2019"}], "]"}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"Export", "[", RowBox[{"\"\\"", ",", "test2020"}], "]"}], ";"}]}], "Input", CellChangeTimes->{{3.8913167711142664`*^9, 3.8913168075140514`*^9}}, CellLabel->"In[41]:=",ExpressionUUID->"e7652ecb-d6cc-45f8-9dff-677e39e5b024"], Cell[BoxData[{ RowBox[{ RowBox[{"tableOfData2020", "=", RowBox[{"Table", "[", RowBox[{ RowBox[{"polishData", "[", RowBox[{ RowBox[{"data2020", "[", RowBox[{"[", RowBox[{"All", ",", "i"}], "]"}], "]"}], ",", "time2020"}], "]"}], ",", RowBox[{"{", RowBox[{"i", ",", "2", ",", "NumOfPoints2020"}], "}"}]}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"tableOfData2019", "=", RowBox[{"Table", "[", RowBox[{ RowBox[{"polishData", "[", RowBox[{ RowBox[{"data2019", "[", RowBox[{"[", RowBox[{"All", ",", "i"}], "]"}], "]"}], ",", "time2019"}], "]"}], ",", RowBox[{"{", RowBox[{"i", ",", "2", ",", "NumOfPoints2019"}], "}"}]}], "]"}]}], ";"}]}], "Input", CellChangeTimes->{{3.894455498833538*^9, 3.894455504610651*^9}, 3.8944556656307707`*^9, {3.894458973626624*^9, 3.894459028548279*^9}}, CellLabel->"In[82]:=",ExpressionUUID->"b2aad80b-52ef-4192-adec-e036fd8b6cd6"], Cell[BoxData[{ RowBox[{ RowBox[{"DataOMHeader", "=", RowBox[{"{", RowBox[{ "\"\\"", ",", "\"\\"", ",", " ", "\"\\"", ",", "\"\\"", ",", "\"\\"", ",", "\"\\""}], "}"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"export2019", "=", RowBox[{"Prepend", "[", RowBox[{ RowBox[{"Flatten", "[", RowBox[{"tableOfData2019", ",", "1"}], "]"}], ",", RowBox[{"Flatten", "[", RowBox[{"DataOMHeader", ",", "2"}], "]"}]}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"export2020", "=", RowBox[{"Prepend", "[", RowBox[{ RowBox[{"Flatten", "[", RowBox[{"tableOfData2020", ",", "1"}], "]"}], ",", RowBox[{"Flatten", "[", RowBox[{"DataOMHeader", ",", "2"}], "]"}]}], "]"}]}], ";"}]}], "Input", CellChangeTimes->{{3.894455498833538*^9, 3.8944555157091045`*^9}, 3.8944556628844395`*^9, 3.8944599669588814`*^9, {3.8944601690973425`*^9, 3.8944601763755875`*^9}, {3.894460238138915*^9, 3.8944602385361757`*^9}, { 3.894460294303774*^9, 3.894460305609171*^9}, {3.8944604268425884`*^9, 3.89446044346474*^9}, {3.894461086170206*^9, 3.8944611760853357`*^9}, 3.907147037653284*^9},ExpressionUUID->"95a08cbf-7d38-4640-84f2-\ 455b1f4fca5e"], Cell[BoxData[{ RowBox[{ RowBox[{"Export", "[", RowBox[{"\"\\"", ",", "export2019"}], "]"}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"Export", "[", RowBox[{"\"\\"", ",", "export2020"}], "]"}], ";"}]}], "Input", CellChangeTimes->{{3.894455498833538*^9, 3.8944555157091045`*^9}, 3.8944556628844395`*^9, 3.8944599669588814`*^9, {3.8944601690973425`*^9, 3.8944601763755875`*^9}, {3.894460238138915*^9, 3.8944602385361757`*^9}, { 3.894460294303774*^9, 3.894460305609171*^9}, {3.8944604268425884`*^9, 3.89446044346474*^9}}, CellLabel->"In[79]:=",ExpressionUUID->"de8eadea-1e23-47de-b3cd-0586c95ab3ca"], Cell[BoxData[ RowBox[{ RowBox[{"tableSpotreba2019", "=", RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{ RowBox[{"polishData", "[", RowBox[{ RowBox[{"data2019", "[", RowBox[{"[", RowBox[{"All", ",", "i"}], "]"}], "]"}], ",", "time2019"}], "]"}], "[", RowBox[{"[", RowBox[{"2", ",", "1"}], "]"}], "]"}], ",", RowBox[{ RowBox[{"polishData", "[", RowBox[{ RowBox[{"data2019", "[", RowBox[{"[", RowBox[{"All", ",", "i"}], "]"}], "]"}], ",", "time2019"}], "]"}], "[", RowBox[{"[", RowBox[{"2", ",", "7"}], "]"}], "]"}]}], "}"}], ",", RowBox[{"{", RowBox[{"i", ",", "2", ",", "NumOfPoints2019"}], "}"}]}], "]"}]}], ";"}]], "Input", CellChangeTimes->{{3.8956548885050516`*^9, 3.89565491285306*^9}, 3.895655224977068*^9, 3.895655455019477*^9},ExpressionUUID->"a26ab113-3a87-45c6-8af6-\ 1d8d46346d5e"], Cell[BoxData[ RowBox[{ RowBox[{"tableSpotreba2020", "=", RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{ RowBox[{"polishData", "[", RowBox[{ RowBox[{"data2020", "[", RowBox[{"[", RowBox[{"All", ",", "i"}], "]"}], "]"}], ",", "time2020"}], "]"}], "[", RowBox[{"[", RowBox[{"2", ",", "1"}], "]"}], "]"}], ",", RowBox[{ RowBox[{"polishData", "[", RowBox[{ RowBox[{"data2020", "[", RowBox[{"[", RowBox[{"All", ",", "i"}], "]"}], "]"}], ",", "time2020"}], "]"}], "[", RowBox[{"[", RowBox[{"2", ",", "7"}], "]"}], "]"}]}], "}"}], ",", RowBox[{"{", RowBox[{"i", ",", "2", ",", "NumOfPoints2020"}], "}"}]}], "]"}]}], ";"}]], "Input", CellChangeTimes->{{3.8956553043883815`*^9, 3.8956553224126015`*^9}, { 3.89565545683247*^9, 3.8956554590884843`*^9}, 3.907147039319795*^9},ExpressionUUID->"f3b094d6-e97c-4377-ad9d-\ a0e2604eaff4"], Cell[BoxData[{ RowBox[{ RowBox[{"Export", "[", RowBox[{"\"\\"", ",", "tableSpotreba2019"}], "]"}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"Export", "[", RowBox[{"\"\\"", ",", "tableSpotreba2020"}], "]"}], ";"}]}], "Input", CellChangeTimes->{{3.8956554695485725`*^9, 3.8956554784690123`*^9}}, CellLabel->"In[31]:=",ExpressionUUID->"8af107df-d1bf-462b-871f-f549f5008423"], Cell["", "PageBreak", PageBreakBelow->True,ExpressionUUID->"1f6bac5b-352d-4914-8e59-3973f2fa81be"], Cell[BoxData[{ RowBox[{ RowBox[{"Quiet", "@", RowBox[{"Remove", "[", "\"\\"", "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"SetDirectory", "[", RowBox[{"NotebookDirectory", "[", "]"}], "]"}], ";"}]}], "Input",Expression\ UUID->"39862093-1682-4757-9c11-23426625c2e9"], Cell[BoxData[{ RowBox[{ RowBox[{"registr1VT", "=", RowBox[{"Import", "[", RowBox[{"\"\\"", ",", RowBox[{"{", RowBox[{"\"\\"", ",", "1"}], "}"}]}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"registr2NT", "=", RowBox[{"Import", "[", RowBox[{"\"\\"", ",", RowBox[{"{", RowBox[{"\"\\"", ",", "2"}], "}"}]}], "]"}]}], ";"}]}], "Input",E\ xpressionUUID->"f2460d30-8048-4ece-9f35-4fc92ac82685"], Cell[BoxData[{ RowBox[{ RowBox[{"time", "=", RowBox[{"registr1VT", "[", RowBox[{"[", RowBox[{"All", ",", "1"}], "]"}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"ident", "=", RowBox[{"Drop", "[", RowBox[{ RowBox[{"registr1VT", "[", RowBox[{"[", RowBox[{"1", ",", "All"}], "]"}], "]"}], ",", "1"}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"calcConsumpt", "[", RowBox[{"data_", ",", "time_"}], "]"}], ":=", RowBox[{"Module", "[", RowBox[{ RowBox[{"{", RowBox[{ "withTime", ",", "dropTitle", ",", "deNULL", ",", "sorted", ",", "dif", ",", "nonZeroDif", ",", "totalConsumpt", ",", "timePeriod", ",", "avgConsumptYear"}], "}"}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"withTime", "=", RowBox[{"Transpose", "[", RowBox[{"{", RowBox[{"time", ",", "data"}], "}"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"dropTitle", "=", RowBox[{"Drop", "[", RowBox[{"withTime", ",", RowBox[{"{", RowBox[{"1", ",", "1"}], "}"}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"deNULL", "=", RowBox[{"DeleteCases", "[", RowBox[{ RowBox[{"dropTitle", "/.", " ", RowBox[{"\"\<\>\"", "->", "x"}]}], ",", RowBox[{"{", RowBox[{"_", ",", "x"}], "}"}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"sorted", "=", RowBox[{"Sort", "[", RowBox[{"deNULL", ",", RowBox[{ RowBox[{ RowBox[{"#1", "[", RowBox[{"[", "1", "]"}], "]"}], "<", RowBox[{"#2", "[", RowBox[{"[", "1", "]"}], "]"}]}], "&"}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"dif", "=", RowBox[{"Differences", "[", "sorted", "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"nonZeroDif", "=", RowBox[{"Select", "[", RowBox[{ RowBox[{"dif", "[", RowBox[{"[", RowBox[{"All", ",", "2"}], "]"}], "]"}], ",", RowBox[{ RowBox[{"#", ">", "0"}], "&"}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"totalConsumpt", "=", RowBox[{"Total", "[", "nonZeroDif", "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"timePeriod", "=", RowBox[{ RowBox[{"deNULL", "[", RowBox[{"[", RowBox[{ RowBox[{"-", "1"}], ",", "1"}], "]"}], "]"}], "-", RowBox[{"deNULL", "[", RowBox[{"[", RowBox[{"1", ",", "1"}], "]"}], "]"}]}]}], ";", "\[IndentingNewLine]", RowBox[{"avgConsumptYear", "=", RowBox[{ FractionBox["totalConsumpt", "timePeriod"], "*", "365.25"}]}]}]}], "\[IndentingNewLine]", "]"}]}]}], "Input",ExpressionUUID->"f36cd263-006a-\ 4667-9860-2b2b3e050e4e"], Cell[BoxData[{ RowBox[{ RowBox[{ RowBox[{"makeADataPoint", "[", "OMnum_", "]"}], ":=", RowBox[{"{", RowBox[{ RowBox[{"ident", "[", RowBox[{"[", RowBox[{"OMnum", "-", "1"}], "]"}], "]"}], ",", RowBox[{"calcConsumpt", "[", RowBox[{ RowBox[{"registr1VT", "[", RowBox[{"[", RowBox[{"All", ",", "OMnum"}], "]"}], "]"}], ",", "time"}], "]"}], ",", RowBox[{"calcConsumpt", "[", RowBox[{ RowBox[{"registr2NT", "[", RowBox[{"[", RowBox[{"All", ",", "OMnum"}], "]"}], "]"}], ",", "time"}], "]"}]}], "}"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"dataSpotreby", "=", RowBox[{"Table", "[", RowBox[{ RowBox[{"makeADataPoint", "[", "i", "]"}], ",", RowBox[{"{", RowBox[{"i", ",", "2", ",", RowBox[{"Length", "[", "ident", "]"}]}], "}"}]}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"dataSHlavickou", "=", RowBox[{"Insert", "[", RowBox[{"dataSpotreby", ",", RowBox[{"{", RowBox[{ "\"\\"", ",", " ", "\"\\"", ",", "\"\\""}], "}"}], ",", "1"}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"Export", "[", RowBox[{"\"\\"", ",", "dataSHlavickou"}], "]"}], ";"}]}], "Input",ExpressionUUID->"02378ab9-0732-4db2-b184-\ 8cddad21ac25"] }, WindowSize->{949, 467}, WindowMargins->{{0, Automatic}, {Automatic, 0}}, TaggingRules-><|"TryRealOnly" -> False|>, Magnification:>0.8 Inherited, FrontEndVersion->"13.2 for Microsoft Windows (64-bit) (January 30, 2023)", StyleDefinitions->"Default.nb", ExpressionUUID->"dc61f304-8fa7-4739-8f14-ea34b1cb8089" ] (* End of Notebook Content *) (* Internal cache information *) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[558, 20, 2469, 37, 38, "Input",ExpressionUUID->"bd32a76d-c6bc-4c55-9df2-68b326674dda"], Cell[3030, 59, 2660, 43, 38, "Input",ExpressionUUID->"d81d47ef-1d86-4964-895f-a132092d623f"], Cell[5693, 104, 2288, 38, 38, "Input",ExpressionUUID->"c478f55f-de6c-4c16-bc73-14aa3617401a"], Cell[7984, 144, 7375, 169, 337, "Input",ExpressionUUID->"97c6c365-7a84-492d-9b54-debfa2fa4cd7"], Cell[15362, 315, 1564, 29, 38, "Input",ExpressionUUID->"e73968d3-1895-42cf-a586-32d2e5bc15b3"], Cell[16929, 346, 4630, 108, 99, "Input",ExpressionUUID->"5dbbb556-c835-4c07-83c5-9426b5cb7ddd"], Cell[21562, 456, 2404, 41, 38, "Input",ExpressionUUID->"2a63ff8d-8a04-42ab-9cd1-41ff801cf939"], Cell[23969, 499, 409, 9, 38, "Input",ExpressionUUID->"e7652ecb-d6cc-45f8-9dff-677e39e5b024"], Cell[24381, 510, 1022, 29, 38, "Input",ExpressionUUID->"b2aad80b-52ef-4192-adec-e036fd8b6cd6"], Cell[25406, 541, 1302, 31, 54, "Input",ExpressionUUID->"95a08cbf-7d38-4640-84f2-455b1f4fca5e"], Cell[26711, 574, 673, 14, 38, "Input",ExpressionUUID->"de8eadea-1e23-47de-b3cd-0586c95ab3ca"], Cell[27387, 590, 1032, 31, 22, "Input",ExpressionUUID->"a26ab113-3a87-45c6-8af6-1d8d46346d5e"], Cell[28422, 623, 1060, 31, 22, "Input",ExpressionUUID->"f3b094d6-e97c-4377-ad9d-a0e2604eaff4"], Cell[29485, 656, 448, 10, 38, "Input",ExpressionUUID->"8af107df-d1bf-462b-871f-f549f5008423"], Cell[29936, 668, 99, 1, 3, "PageBreak",ExpressionUUID->"1f6bac5b-352d-4914-8e59-3973f2fa81be", PageBreakBelow->True], Cell[30038, 671, 306, 8, 38, "Input",ExpressionUUID->"39862093-1682-4757-9c11-23426625c2e9"], Cell[30347, 681, 517, 14, 38, "Input",ExpressionUUID->"f2460d30-8048-4ece-9f35-4fc92ac82685"], Cell[30867, 697, 2854, 82, 237, "Input",ExpressionUUID->"f36cd263-006a-4667-9860-2b2b3e050e4e"], Cell[33724, 781, 1461, 43, 69, "Input",ExpressionUUID->"02378ab9-0732-4db2-b184-8cddad21ac25"] } ] *)