• Tidak ada hasil yang ditemukan

Performance analysis and implementation of an adaptive real-time weather forecasting system

N/A
N/A
Protected

Academic year: 2023

Membagikan "Performance analysis and implementation of an adaptive real-time weather forecasting system"

Copied!
22
0
0

Teks penuh

(1)

ContentslistsavailableatScienceDirect

Internet of Things

journalhomepage:www.elsevier.com/locate/iot

Performance analysis and implementation of an adaptive real-time weather forecasting system

T.P. Fowdur

a

, Y. Beeharry

a,

, V. Hurbungs

b

, V. Bassoo

a

, V. Ramnarain-Seetohul

c

, E. Chan Moo Lun

a

aDepartment of Electrical and Electronic Engineering , Faculty of Engineering, University of Mauritius, Mauritius

bDepartment of Software and Information Systems, Faculty on Information, Communication, and Digital Technologies, University of Mauritius, Mauritius

cDepartment of Information, Communication and Technology, Faculty of Information, Communication, and Digital Technologies, University of Mauritius, Mauritius

a rt i c l e i n f o

Article history:

Received 15 August 2018 Revised 31 August 2018 Accepted 1 September 2018 Available online 6 September 2018 Keywords:

Real-time weather forecasting Internet of things

K-nearest neighbors (K-NN) Multiple linear regression (MLR) Adaptive K-NN

Adaptive MLR

a b s t ra c t

Recently severalreal-timeweatherforecastingsystemsbasedonInternetofThings(IoT) havebeen developedtoprovideshort-termrealtimeforecastsalsoreferredtoas Now- casts.Themainchallengeinthesesystemsistouseappropriatepredictionalgorithmsthat canpredictdifferentweatherparameterswiththehighestpossibleaccuracy.Inthiswork, an IoT basedweather forecastingsystem has been implementedto provide short-term weatherforecastsonaUniversitycampusatintervalsrangingfrom20mintoonehour.

SeveraladaptiveforecastingalgorithmsbasedonvariantsoftheMultiple LinearRegres- siontechniqueaswellasK-NearestNeighbors(K-NN)havebeenexperimented.Moreover, threeadaptiveselectioncriteriaforselectingthemostappropriatepredictionalgorithmfor agivenNowcasthavebeendevelopedandtested.Theparametersanalysedare:tempera- ture,humidity,atmosphericpressure,rainfall,luminosity,wind-speed,andwinddirection.

Thebestadaptiveschemes areabletopredicttheseparameterswithanoverallpercent- ageerrorof6.58%ascomparedtonon-adaptiveoneswhichpredictedwithaworstcase percentageerrorof13.59%.

© 2018 Elsevier B.V. All rights reserved.

1. Introduction

Weather forecastinghasalways beena vital processto ensure thesmooth running ofseveralimportant activities [1]. However,duetodrasticclimaticchanges,weatherpredictionusingthetraditionaltechniquesisbecomingineffective.Many countriesareatriskofflashfloodnowadaysandpredictingsuchweatherconditionswithconventionalforecastingsystems isnotpossiblebecausethesesystemsprovidepredictionsforlargeregionsoverhours. Mauritiushasrecentlyexperienced drasticweatherconditionssuchasflash-floodsthatcausedmajorcollateraldamageandlifeloss.However,nowadays,with theemergence ofInternet ofThings,realtimeornearrealtimeweather predictionispossible.Thereareseveralweather forecastingsystemsbasedonlocalizedsensorsconnectedtocloudcomputingfacilitiesthatcanprovideshort-termforecasts forsmallregions.Theseforecastingsystemsmake useoftechniquessuch asneuralnetworks, Fuzzylogic,time seriesand regressionanalysis.

Corresponding author.

E-mail address: y.beeharry@uom.ac.mu (Y. Beeharry).

https://doi.org/10.1016/j.iot.2018.09.002

2542-6605/© 2018 Elsevier B.V. All rights reserved.

(2)

ListofNotations

T TemperatureindegreesCelsius

H %Humidity

L Lightintensityin

R Rainfallinmm

P AtmosphericpressureinPa.

WD Winddirectionconvertedtoadegreesscale.

WS Windspeedinm/s

W Thetrainingwindowwhichwasfixedto120mininthiswork.

t Thetimeindex.

Pxt denotesanyotherrelatedparameterthatcouldinfluencethevalueofP1t. a0(W),a1(W)anda2(W) are coefficientsdetermined foratrainingwindowofsizeWwhichwaskept

at120min.

p representstheorderofautoregression,

q istheorderofmovingaverage(numberofpasterrorterms),

Ø istheslopecoefficient,

Ɵ isthemovingaveragecoefficient,

e istheerrorterm

μ isaconstantterm

K istheneighborhoodsize

yk isthenearestreading

TA Theactualorcurrenttime.

TS Thetimeatwhichthefirstvalueinthetrainingwindowwasrecorded.

TM Themid-timeintervalbetweenTS andTA.

TA+I Thetimeatwhichthevaluesoftheparameteristobepredicted.Thesymbol IrepresentsanintervalinminutesaftertheactualtimeTA.

W Thetrainingwindowsizeinminuteswhichessentiallyrepresentasetofpre- observed values ofthe parameter tobe predictedover thepast W minutes goingbackfromtheactualtimeTAtoT0.

VA TheactualorcurrentvaluesoftheparameterbeingmeasuredattimeTA. VS ThevalueoftheparameterbeingmeasuredattimeTs.

VM ThevalueoftheparameterbeingmeasuredattimeTM.

VˆAx+I ThevalueoftheparameterpredictedwithPx attimeTA+I.

W/2 ItisequivalenttohalfthewindowsizeWandcontainsvaluesoftheparam- eterrecordedfromtimeTM toTA i.e.thevaluesVMtoVA.

VˆMx isavaluepredictedattime TMwithpredictorPx usingavailablevaluesfrom VStoVM1.

VˆMx+1 isavaluepredictedattimeTM+1withpredictorPxusingavailablevaluesfrom VStoVM.

VˆM+x i isavaluepredictedattimeTM+iwithpredictorPxusingavailablevaluesfrom VStoVM+i1.Theindexitakesvaluesfrom1toW/2.

SEMx,SEM+1x ,SExM+2, ..., SEMx+i, ..., SExA represent the squared Euclidean distances between the actual values VM,VM+1,VM+2,….VM+i…..VA and VˆMx,VˆM+1x ,VˆM+2x , ..., VˆMx+i, ..., VˆAx respec- tively.

NumerousIoT basedsolutions havebeenimplemented toobserve weatherconditions atspecificlocations[2–5].Most systemsmonitoredenvironmentalconditionssuch astemperature, precipitation,relativehumidity,light intensityandCO2 level.ThearchitecturesconsistedofaseriesofsensorsconnectedtoamicrocontrollerplatformsuchasArduinoorRaspberry Pi.Thedatacollectedweresent toeitheracomputeroracloud computingplatformforstorageandprocessing. Different methodswere usedto makethe dataavailable tousers ofthesystem. In[2],tweetswere usedto disseminatethe gath- eredinformationandfollowersofthetwitteraccountreceivedinformationregardingdaylight,temperatureandhumidity.In [6–8],flashfloods monitoringsystemwere implementedtoprovidetimelyinformationtothreatenedpopulationandcon- cernedauthoritieswhenthewaterlevelrisesbeyondthepredefinedthresholdvalue.SMSwasusedtosendalertmessages [6,8]. Waterquality classification using Pollution Indexmethod has been performed using linearSVM anddecision tree algorithms in[9] forthe preservation ofthe waterecosystem inmaritime andarchipelagic countries. A flood prediction systemwasalsoimplementedusingwaterlevelandvelocity ofthewater[6].In[10],theauthorsintroducedCloudCast,a mobileapplicationforlocalizedshort-termweatherprediction.CloudCastconsistsofanarchitecturelinkingweatherradars to cloud resources anda Nowcasting algorithm that accurately predicts short termweather conditions.According to the

(3)

authors,CloudCastwasabletoperformaccuratepredictionwithlessthan2mindelaytodeliver15-minNowcastimageto amobileclient.

Severalalgorithms havebeenusedforweatherforecasting.Datacollectedfromsensorsarefed intoalgorithmstomake predictions.Thealgorithmsusedincluderegression–basedpredictionwherein[11]datawasgatheredlocallyatPantnagar Stationandprocessedtoobtainstatisticalmeasuresofthehiddeninformation.Furthermore,in[12]forecastingofseasonal andannualrainfallwasdonebyusinganonlinearmodelingwithGammaTest(GT)innorthofIran.Rainfallwasalsopre- dictedusingmodifiedlinearregressionindifferentregionsofSouthernIndiain[13].Also,Hadoop-basedARIMAalgorithm hasbeenusedtoforecastthedataofthecomingfortnightbytakingdatacollectedoverthepastdecadein[14].TheARIMA model wasalsoused toforecast wind speed foraperiod of7days inLatvia [15]andto forecastweather conditions for the AbadehregionofIran [15]. TheSeasonal ARIMAmodelwasused forforecastingofmonthlyrainfall andtemperature formonthlyintervalsforaregionofIndiain[16].In[17]theARIMAmodelwasappliedforweatherpredictioninHeipang airport- Jos Plateau, Nigeria where variables used forthe studywere temperature, rainfall and wind speed. The ARIMA modelwasalso studiedin [18]andacomparisonwasmadebetweenARIMA andtheArtificial NeuralNetwork(ANN) to predict rainfallin Mauritius.In [19]a comparativestudyof themostrecent computationalintelligence techniqueswhich havebeenappliedformeteorologicaltime seriespredictionpurposewasmade. AmodifiedversionoftheK-NNapproach wasappliedtopredictweather datasuchassolarradiation,maximumandminimumtemperature,andrainfallin[20].In [21]amodelforthepredictionofweather andsolarunitsbasedontheK-NNalgorithmwasused.In[22],K-NNwasused withanapproachofdataminingfortheimplementationofthepredictionsystem. In[20]thepredictionofdailyweather data for climate forecastsusing the non-parametric nearest-neighbor re-samplingtechnique was applied. A comparative studyofMovingAverageonRainfallTimeSeriesData forRainfallForecastingBasedonEvolvingNeuralNetworkClassifier wasutilizedin[23].Also,theArtificial NeuralNetworkwasappliedforweather forecastingin[24–26].In[27],prediction oftheDutchweather wasdone usingrecurrentneuralnetworks. In[28],theneuralnetwork trainingmodelwasusedfor weatherforecastingusingfireworksalgorithm.

Inthispaper,an IoT basedshort-term weather predictionarchitectureis implemented.Themain noveltyofthepaper isthe formulationofthree variantsoftheMultipleLinear Regression(MLR) algorithmwhichare obtainedexperimentally to determine thecombinationof parameters yielding the bestperformance. Moreover, adaptive versionsof theMLR and K-NN algorithms were developed by the use ofa time-varying trainingwindow. Finally, three adaptiveselection criteria wereintegratedinthesystemtoselectthemostappropriatepredictionalgorithmtobeusedforeachreal-timeforecast.The systemwasusedtocaptureweatherparameters suchastemperature,humidity,atmosphericpressure,rainfall,luminosity, wind-speed,andwinddirectionforaperiodofeightdaysonthecampusoftheUniversityofMauritius.Thebestadaptive schemesareabletopredicttheseparameterswithan overallpercentageerrorof6.58%ascomparedtonon-adaptiveones whichpredictedwithaworstcasepercentageerrorof13.59%.

The rest of the paper is organized as follows: Section 2 presents a detailed explanation of the system architecture.

Section 3 provides an overviewof forecastingalgorithms. Section 4 presentsthe results accompanied by comprehensive analysisandfinallytheworkisconcludedinSection5.

2. Systemarchitecture

ThissectiondescribestheHardwareSet-up,configurationofthemicro-controllersandthedatabaseserver.

2.1. Hardwareset-up

TheblockdiagramoftheproposedweatherforecastingsystemisshowninFig.1.

Theweatherforecastingsystemconsistsofoneweather-monitoringnode.Thenodeiscapableofmeasuringtemperature, atmosphericpressure,luminosity,humidity,winddirection,windspeedandrainthroughtheweather meterandthetem- peratureandhumiditysensor.Thesensorsareconnectedtotheweathershield,whichisinturnstackedontotheArduino micro-controller.TheXBeeShieldandWi-FimodulesallowtheArduinomicro-controllerstobeconnectedtotheRaspberry Pi3wirelessly.

TheRaspberryPi3isapowerfulmicrocontrollerwhichisusedtoaggregatethedatafromtheweather-monitoringnode and actsas a gateway to the local databaseserver. The Raspberry Pi 3 also functionsas an edge IoT device which can performvariousprocessingtasksatanearlystagesoastooffloadtheprocessingburdenfromtheapplicationserveralone.

AstraightforwardintegrationofaJavaprogramcanberunontheRaspberryPi3toperformdatanormalization,dataerror detection,missingdatadetectionandaggregationofdatafromseveralnodestransmittingdatainparallel.TheRaspberryPi 3isconnectedto thedatabaseserverthroughan InternetRouter.The applicationserver allowstheuserofthesystemto querythedatabaseorreceivealerts.Typically,theuserqueriesthedatabaseusingamobilephone.

The valuesrecordedby the sensorsofthe weather monitoringnode are temperature, humidity,atmosphericpressure, luminosity,windspeed,winddirection, andrainfall.Fig.2illustrateshowthesensorvaluesarerecordedandtransmitted.

ThesensorvaluesobtainedfromthenodeisstoredinJSONformatwhichisastandardwayofstoringvariablenamesand theircorresponding valuesinkey-valuepairs,andtransmittedthroughthewirelesslinktotheRaspberryPiforprocessing andstorage.

(4)

Fig. 1. Block diagram of the proposed weather forecasting system.

Fig. 2. Sensor values recorded.

Fig. 3. XBee Shield setup with Arduino Uno and Weather Shield.

Fig.3showshowthe XBeeshieldhasbeen usedintheproject.The XBeeshieldis mountedon theArduinoUnoand the weather shield is mounted onto the latter. The Xbee Shield allows data from the weather shield and meters to be transmittedtotheRaspberryPi3usingWi-Fi.

TheXBeeandweather shieldsare mounteddirectlyonto theArduino.Since bothshields usepins 2and3bydefault;

theXBeeshieldusesthemforcommunicationwhereastheweathershieldusesthemtocollectthedatafromthewindand rainsensors.Therefore,are-wiringtoovercomethisoverlapwasrequired.Theunusedpins4and5onthemicro-controller wereusedfortheXBeeshieldtoperformthetransceiveroperationsandthedefaultpinswereusedwiththeweathershield.

There-wiringperformedisshowninFig.4.

(5)

Fig. 4. Re-wiring between XBee Shield, Arduino Uno and Weather Shield.

2.2. Micro-controllerconfigurationandprogramming

TheprocessesinvolvedintheconfigurationsoftheArduinomicro-controllerandtheRaspberryPi-3areexplainedinthe followingsub-sections.

2.2.1. Arduinoconfigurationandprogramming

TheArduinoisprogrammedusingtheC/C++programminglanguagewherebyconfigurationshavebeenmadeto:

- Readdatafromthedifferentweathersensors,

- CombineallsensorvariablesandcorrespondingsensorvaluesinaJSONstring,

- TransmitthesensordatainJSONformatthroughtheXBeeWi-Fimoduleonaspecificsocketconnectiontobereceived bytheRaspberryPi-3.

2.2.2. RaspberryPi-3configurationandprogramming

TheRaspberry Pi-3hasaLinux-basedoperatingsystem(RaspbianJessy)mountedonit andfilesare amendedto con- figurethedeviceasawireless router.Javaprogramsarealsorunfortheinterceptionofthedataonthesocketconnection throughthewirelessinterfaceandinsertingittoaspecifictableinadatabaseserverthroughtheEthernetinterface.

2.3. Webserverarchitectureandfordatastorageandacquisition

The MySQLdatabasewhichcomes alongthe XAMPPsoftwareisused extensivelyinthiswork forthelocalstorageof recordedsensordata.ThesevaluesarethenaccessedbytheJavaapplicationforperformingpredictiveanalyticsandcompute forecastedweatherdata.Thelatteristhen insertedintoatableinthesameMySQLdatabase.The predictedvaluescanbe queriedusinganapplicationrunningonamobilephone.ThewholeprocessworksisasshowninFig.5.

2.3.1. Databasearchitecture

Twotablesareimplementedinasingledatabasefortheproposed system.Onetableisusedforstoringtheaggregated sensorvaluesandthesecondoneisusedtosavepredictedvalueswhichareaccessedbythemobileapplication.

The fields for“id” and “time” are automatically generated andadded when newsets of sensorvalues are written to the table in the database. The “time” field refers to the timestamp atwhich the data wascollectedand inserted inthe database.Thefields“windGustmph”,“windGustdir”,“humidity”,“temperature”,“rainIn”,“pressure”,and“lightLevel” referto the sensorvaluesof wind speed,wind direction, humidity,temperature, rain level,atmosphericpressure, andluminosity respectively.AsampleofthevaluesrecordedinthetableisasdepictedinFig.6.

The MySQL databaseused forthis work is a low complexitydatabase asit involves simpler configurations or setup.

However,anupgradetoNoSQLdatabases(CassandraorMongoDB) wouldbemoreappropriatewhendeployingthesystem onalargerscale.TheadvantageofNoSQLinthiscasewouldbepresentedduetolargevolumesofdatabeingdealtwith.

Datafromsensorsaresentinreal-timetothedatabase.Thesystemwillobtainonlytheparametersfortheforecasting algorithmanddataforawindowcorrespondingtothelast120mintoperformtheforecasting.Assuch,theburdenonthe systemisconstantanddeterminedbythewindowsizesetandnotallthedatafoundinthedatabase.Hence,itwillnotbe anissuetodeployinlargerareas.Moreover,tomovetoawiderarea,wewillneedadditionalsensornodestoofferawider coverage.

(6)

Fig. 5. Architecture for data acquisition and query from mobile device.

Fig. 6. Sample of Recorded Sensor values.

3. Forecastingalgorithmsandsoftwaredesign

Thissectiongivesanoverviewoftheforecastingalgorithmsthatwereinvestigatedinthiswork.

3.1. Forecastingalgorithms

Inthissectionthefollowinggeneralsymbolshavebeenusedtodescribethedifferentvariablesintheequations:

T temperatureindegreesCelcius

H %Humidity

L Lightintensityin R Rainfallinmm

P AtmosphericpressureinPa.

WD Winddirectionconvertedtoadegreesscale.

WS Windspeedinm/s

W Thetrainingwindowwhichwasfixedto120minsinthiswork.

t Thetimeindex.

3.1.1. Multiplelinearregression

Inthiswork,withmultiple linearregression,equationsinvolvingageneralparameter P1 tobe predictedattimet+1 withrespecttothepreviouslyrecordedvalueofP1attimetandanotherrelatedparameterPxwereformulatedasperthe followinggenericcombination:

P1t+1=a0

(

W

)

+a1

(

W

)

P1t+a2

(

W

)

Pxt (1)

where,

PxtdenotesanyotherrelatedparameterthatcouldinfluencethevalueofP1t.

a0(W),a1(W)anda2(W)arecoefficientsdeterminedforatrainingwindowofsizeWwhichwaskeptat120min.

(7)

Thesecoefficientswererecomputedafterevery120mintoadjustthemodeltothenewlyrecordedvaluesobtainedfrom theweathersensors.

Three different combinations of multiple linear regression equations denoted as MLR, MLR1 and MLR2 were derived experimentallyforthesevenweatherparameters.Thesecombinationsaredescribedasfollows:

MLR. Withthismodel,thefollowingcombinationofequationswereused:

Tt+1=a0

(

W

)

+a1

(

W

)

Tt+a2

(

W

)

Ht (2)

InEq.(2),thevalueofthe temperatureforthenext timeinterval, i.e.Tt+1 ispredictedfromtheprevious temperature value Tt andprevious humidity valueHt.The constantsa0(W), a1(W),anda2(W) areobtainedfromthe regressionmodel foratrainingwindowofsizeW.Thedetailsoftheequations(3)–22)followthesameconventionasforEq.(2)withtheir respectiveparameters.

Ht+1=a0

(

W

)

+a1

(

W

)

Ht+a2

(

W

)

Tt (3) Lt+1=a0

(

W

)

+a1

(

W

)

Lt+a2

(

W

)

Tt (4) Pt+1=a0

(

W

)

+a1

(

W

)

Pt+a2

(

W

)

Tt (5) Rt+1=a0

(

W

)

+a1

(

W

)

Rt+a2

(

W

)

Tt (6) WSt+1=a0

(

W

)

+a1

(

W

)

WSt+a2

(

W

)

Tt (7)

WDt+1=a0

(

W

)

+a1

(

W

)

WDt+a2

(

W

)

Tt (8)

MLR1.

Tt+1=a0

(

W

)

+a1

(

W

)

Tt+a2

(

W

)

Lt (9) Ht+1=a0

(

W

)

+a1

(

W

)

Ht+a2

(

W

)

Lt (10) Lt+1=a0

(

W

)

+a1

(

W

)

Lt+a2

(

W

)

Ht (11) Pt+1=a0

(

W

)

+a1

(

W

)

Pt+a2

(

W

)

Ht (12) Rt+1=a0

(

W

)

+a1

(

W

)

Rt+a2

(

W

)

Ht (13) WSt+1=a0

(

W

)

+a1

(

W

)

WSt+a2

(

W

)

Ht (14)

WDt+1=a0

(

W

)

+a1

(

W

)

WDt+a2

(

W

)

Ht (15)

MLR2.

Tt+1=a0

(

W

)

+a1

(

W

)

Tt+a2

(

W

)

Pt (16) Ht+1=a0

(

W

)

+a1

(

W

)

Ht+a2

(

W

)

Pt (17) Lt+1=a0

(

W

)

+a1

(

W

)

Lt+a2

(

W

)

Pt (18) Pt+1=a0

(

W

)

+a1

(

W

)

Pt+a2

(

W

)

Lt (19) Rt+1=a0

(

W

)

+a1

(

W

)

Rt+a2

(

W

)

Lt (20) WSt+1=a0

(

W

)

+a1

(

W

)

WSt+a2

(

W

)

Lt (21) WDt+1=a0

(

W

)

+a1

(

W

)

WDt+a2

(

W

)

Lt (22)

(8)

3.1.2. Autoregressiveintegratedmovingaverage(ARIMA)[29]

ARIMAisastochastictimeseriesmodelfirstpopularizedbyBoxandJenkins[30].AnARIMAmodelisageneralizationof anAutoregressiveMovingAverage(ARMA)modelthatisusedtopredictavalueintimeseriesdataasalinearcombination ofitspastvaluesandpasterrors.Themodelisusedontimeseriesdatawhichcanbemadestationarybydifferencing[31]. ThegeneralexpressionofARIMAforecastingisgivenbelow:

Yi+1=

μ

+

φ

1Yi1+· · · +

φ

pYip+

θ

1ei1+· · · +

θ

qeiq (23) where,

prepresentstheorderofauto-regression

qistheorderofmovingaverage(numberofpasterrorterms)

φ

istheslopecoefficient

θ

isthemovingaveragecoefficient

eistheerrorterm

μ

isaconstantterm

3.1.3. K-nearestneighbors(K-NN)[29]

TheK-NNalgorithmdependsonlyonthegivendatasetandauser-definedconstantparameternamelyK.Thefollowing proceduresexplaintheK-NNalgorithm:

1.Withadistancefunction,theKreadingsnearesttothepredictionpoint(nextinterval)isretrieved.

2.TheforecastedoutputiscomputedasthemeanoftheKnearestreadingsgiveninthefollowingequation:

Yi+1= 1 K

K

i=1

yi (24)

where,

Kistheneighborhoodsize.

yiisthenearestreading.

3.1.4. AdaptivemultiplelinearregressionandK-NN

InordertomaketheMLR, MLR1andMLR2algorithmsadaptive,thetrainingwindowW,usedtocomputetheir coeffi- cientsa0,a1 anda2shouldbeupdatedeachtimeanewparameterisreadfromthesensors.Inotherwordseverytseconds anothersetofcoefficientsarecomputedfortheMLRmodel.Themainmodificationisthatthecoefficientsarenowafunc- tionofWt i.e.a trainingwindow ofsizeW whichischanged everyt secondsinsteadofa fixed trainingwindow W.The modifiedequationsareasfollows:

AdaptiveMLR. Withthismodel,thefollowingcombinationofequationswereused:

Tt+1=a0

(

Wt

)

+a1

(

Wt

)

Tt+a2

(

Wt

)

Ht (25)

Ht+1=a0

(

Wt

)

+a1

(

Wt

)

Ht+a2

(

Wt

)

Tt (26)

Lt+1=a0

(

Wt

)

+a1

(

Wt

)

Lt+a2

(

Wt

)

Tt (27)

Pt+1=a0

(

Wt

)

+a1

(

Wt

)

Pt+a2

(

Wt

)

Tt (28)

Rt+1=a0

(

Wt

)

+a1

(

Wt

)

Rt+a2

(

Wt

)

Tt (29)

WSt+1=a0

(

Wt

)

+a1

(

Wt

)

WSt+a2

(

Wt

)

Tt (30)

WDt+1=a0

(

Wt

)

+a1

(

Wt

)

WDt+a2

(

Wt

)

Tt (31)

(9)

AdaptiveMLR1

Tt+1=a0

(

Wt

)

+a1

(

Wt

)

Tt+a2

(

Wt

)

Lt (32) Ht+1=a0

(

Wt

)

+a1

(

Wt

)

Ht+a2

(

Wt

)

Lt (33) Lt+1=a0

(

Wt

)

+a1

(

Wt

)

Lt+a2

(

Wt

)

Ht (34) Pt+1=a0

(

Wt

)

+a1

(

Wt

)

Pt+a2

(

Wt

)

Ht (35) Rt+1=a0

(

Wt

)

+a1

(

Wt

)

Rt+a2

(

Wt

)

Ht (36) WSt+1=a0

(

Wt

)

+a1

(

Wt

)

WSt+a2

(

Wt

)

Ht (38)

WDt+1=a0

(

Wt

)

+a1

(

Wt

)

WDt+a2

(

Wt

)

Ht (39) AdaptiveMLR2

Tt+1=a0

(

Wt

)

+a1

(

Wt

)

Tt+a2

(

Wt

)

Pt (40) Ht+1=a0

(

Wt

)

+a1

(

Wt

)

Ht+a2

(

Wt

)

Pt (41) Lt+1=a0

(

Wt

)

+a1

(

Wt

)

Lt+a2

(

Wt

)

Pt (42) Pt+1=a0

(

Wt

)

+a1

(

Wt

)

Pt+a2

(

Wt

)

Lt (43) Rt+1=a0

(

Wt

)

+a1

(

Wt

)

Rt+a2

(

Wt

)

Lt (44) WSt+1=a0

(

Wt

)

+a1

(

Wt

)

WSt+a2

(

Wt

)

Lt (45)

WDt+1=a0

(

Wt

)

+a1

(

Wt

)

WDt+a2

(

Wt

)

Lt (46)

Adaptive K-NN. Foradaptive K-NNalsothe trainingwindow ischanged every t secondsandthe modifiedequation is as follows:

Yt+1= 1 K

K t=1

Yt f orK

Wt (47)

3.1.5. Proposedadaptiveselectionalgorithms

Threeadaptive selectionalgorithms,denoted asA1,A2andA3respectivelyhavebeendeveloped.Therationale behind theseadaptivealgorithmsistoselectthebestpredictionalgorithmforpredictingagivenparameterbasedonthepredictor thatachievedthebestperformanceforthepreviousprediction.Thefollowingselectedpredictionalgorithmswereincluded inthesetofpredictionalgorithmstobeusedfortheadaptiveselectionalgorithms:

1. ARIMA.

2. AdaptiveK-NN.

3. AdaptiveMultiLinearregression.

4. AdaptiveMultiLinearregression1.

5. AdaptiveMultiLinearregression2.

LetPx denoteanyoneoftheabovepredictorswherex=1,2,3,4,5inthiscaseandP1representsArima,P2 K-NNandso on.

ConsiderFig.7andnotationsthatwillbeusedinformulatingthepredictionalgorithms:

Theparametersintheabovefigurearedefinedasfollows:

TA Theactualorcurrenttime.

TS Thetimeatwhichthefirstvalueinthetrainingwindowwasrecorded.

TM Themid-timeintervalbetweenTS andTA.

(10)

Fig. 7. Timing diagram for Algorithm A1.

Fig. 8. Timing diagram for Algorithm A2.

TA+I Thetime atwhichthevaluesoftheparameteristobepredicted.ThesymbolIrepresentsanintervalinminutes aftertheactualtimeTA.

W Thetrainingwindowsizeinminuteswhichessentiallyrepresentasetofpre-observedvaluesoftheparameterto bepredictedoverthepastWminutesgoingbackfromtheactualtimeTA toTS.

VA TheactualorcurrentvaluesoftheparameterbeingmeasuredattimeTA. VS ThevalueoftheparameterbeingmeasuredattimeTs.

VM ThevalueoftheparameterbeingmeasuredattimeTM. VˆAx+I ThevalueoftheparameterpredictedwithPx attimeTA+I.

AlgorithmA1isformulatedasfollows:

1.UsingthetrainingsetvaluesrecordedfromtimeTStoTA1 i.e.thevaluesVS toVA1,predictthevalueattimeTAwith eachpredictorPx asfollows:

VˆAx=Px

(

VS,VA1

)

(48)

where,VˆAx isthe value ofthe parameter predictedattimeTA withagivenpredictorPxthatusesvaluesfromVS toVA1 toperformtheprediction.

Moreexplicitlyforthefivepredictorsusedinthisspecificcase,therewillbefivepredictionsobtainedforthevaluesat timeTAasfollows:

VˆA1=P1

(

VS,VA1

)

; VˆA2=P2

(

VS,VA1

)

;VˆA3=P3

(

VS,VA1

)

; VˆA4=P4

(

VS,VA1

)

; VˆA5=P5

(

VS,VA1

)

(50)

2.ComputethesquaredEuclideandistance,betweentheactualvalue oftheparameterVA observedtime TA andthepre- dictedvalueVˆAx obtainedwitheachpredictorPxasfollows:

SEAx=

VAVˆAx

2

(51) InthiscasetherewillbefivevaluesoftheMSEobtainedasfollows:

SEA1=

VAVˆA1

2

; SEA2=

VAVˆA2

2

; SEA3=

VAVˆA3

2

; SEA4=

VAVˆA4

2

; SEA5=

VAVˆA5

2 (52)

3.PredictthevalueattimeTA+Iwiththepredictor,Px,givingthelowestMSEforthepredictedvalueattimeTA: VˆAx+1=Px

(

VS,VA

)

x=Index

min[SExA]

=Index

min

SEA1,SEA2,SEA3,SEA4,SEA5

(53)

AlgorithmA2isformulatedasfollows:

ConsiderFig.8whichisthetimingdiagramforalgorithmA2.

Thefollowingadditionaltermsaredefinedfortheabovediagram:

(11)

W/2:ItisequivalenttohalfthewindowsizeWandcontainsvaluesoftheparameterrecordedfromtime TMto TA i.e.

thevaluesVMtoVA. V

x

M isavaluepredictedattimeTMwithpredictorPx usingavailablevaluesfromVStoVM−1. VˆMx+1 isavaluepredictedattimeTM+1withpredictorPx usingavailablevaluesfromVStoVM.

VˆMx+iisavaluepredictedattimeTM+iwithpredictorPxusingavailablevaluesfromVStoVM+i1.Theindexitakesvalues from1toW/2.

SEMx,SExM+1,SEMx+2,...SExM+i...SEAx represent the squared Euclidean distances between the actual values VM,VM+1,VM+2,….VM+i…..VA andVxM,VxM+1,VxM+2,...VxM+i...VxA respectively.

Thealgorithmproceedsasfollows:

1. Predictthevaluesfromtime TM toTA i.e.V

x M,V

x M+1,V

x M+2,...V

x M+i...V

x

A ataoneminuteintervalswitheachpredictorPx asfollows:

VˆMx =Px

(

VS,VM−1

)

(54)

Moreexplicitly:

VˆM1=P1

(

VS,VM1

)

; VˆM2=P2

(

VS,VM1

)

; VˆM3=P3

(

VS,VM1

)

;VˆA4=P4

(

VS,VM1

)

;VˆA5=P5

(

VS,VM1

)

(55)

Ingeneral:

VˆM+x i=Px(VS,VM+i−1)and:

VˆM1+i=P1

(

VS,VM+i1

)

; VˆM2+i=P2

(

VS,VM+i1

)

; VˆM3+i=P3

(

VS,VM+i1

)

;

VˆM4+i=P4

(

VS,VM+i1

)

; VˆM5+i=P5

(

VS,VM+i1

)

(56)

2. Compute the squared Euclidean distances SEMx,SExM+1,SEMx+2,...,SEMx+i,...,SEAx between the actual values VM,VM+1,VM+2,….VM+i…..VA andVˆMx,VˆMx+1,VˆMx+2,..., VˆMx+i,...,VˆAx respectivelyforeachalgorithmasfollows:

SEMx =

VMVˆMx

2

(57) Moreexplicitly:

SEM1 =

VMVˆM1

2

; SEM2 =

VMVˆM2

2

; SEM3 =

VMVˆM3

2

; SEM4 =

VMVˆM4

2

; SEM5 =

VMVˆM5

2

(58) Ingeneral:

SEMx+i=(VM+iVˆMx+i)2and more explicitly:

SEM+1 i=

VM+iVˆM+1 i

2

; SE2M+i=

VM+iVˆM+2 i

2

; SE3M+i=

VM+iVˆM3+i

2

; SEM+4 i=

VM+iVˆM+4 i

2

; SE5M+i=

VM+iVˆM+5 i

2

(59) 3. Compute the mean squared error for each predictor for all predictions made from TM to TA of the values

VˆMx,VˆMx+1,VˆMx+2, ..., VˆMx+i, ..., VˆAx.ForagivenpredictorPxtakingifrom1toW/2,weobtaintheMSEasfollows:

MSEx= 2 W

W/2

i=1

SEMx+1i (60)

Moreexplicitly:

(

MSE

)

1= 2 W

(W/2) (i=1)

SE(1M+1i);

(

MSE

)

2= 2 W

(W/2) (i=1)

SE2(M+1i);

(

MSE

)

3= 2 W

(W/2) (i=1)

SE(3M+1i);

(

MSE

)

4= W2 (

W/2) (i=1)

SE(4M+1i);

(

MSE

)

5=W2 (

W/2) (i=1)

SE5(M+1i) (62)

4. PredictthevalueattimeTA+Iwiththepredictor,Px,givingthelowestMSEforthepredictedvaluesbetweenTMandTA: VˆAx+1=Px

(

VS,VA

)

x=Index

min

MSEx

=Index

min

MSE1,MSE2,MSE3,MSE4,MSEx

(63)

AlgorithmA3isformulatedasfollows:

Referensi

Dokumen terkait

The reviewers should notify the journal immediately if they come across any irregularities, have concerns about ethical aspects of the work, are aware of substantial