Skip to main content
. 2019 Nov 28;19(23):5236. doi: 10.3390/s19235236
Algorithm 4 Energy estimation penalty (EEPenalty)
Input:
GT={g1,g2gt} is the ground truth of appliance m
PT={p1,p2pt} is the predicted values of appliance m
CState is the clustered operational state data of appliance m
GSlice is a vector of all IR
PSlice is a vector of all IR
Output:
i=1TEEi(m) is the total Energy estimation Penalty for appliance m
  •   1:

    Init k,l=1

  •   2:

    fort=1toTdo

  •   3:

      Obtain data point gt and pt

  •   4:

      if gt>0 and pt>0 then

  •   5:

        Compute Cg= closestCluster (CState,gt)

  •   6:

        Compute Cp= closestCluster (CState,pt)

  •   7:

        Obtain Cg_CRate and Cp_CRate

  •   8:

        Set k=t and l=t

  •   9:

        while ((|gt+1gt|gt<Cg_CRate) and (|pt+1pt|pt<Cp_CRate)) do

  • 10:

          Add data point gt to GSlice

  • 11:

          Add data point pt to PSlice

  • 12:

          Increment l

  • 13:

        end while

  • 14:

        Set t=l+1

  • 15:

        Pjw= Call ComputePenalty(GSlice,PSlice)

  • 16:

        Call AssignPenalty(GT,PT,Pjw)

  • 17:

      end if

  • 18:

    end for

  • 19:

    returni=1TEEi(M)

  • 20:

     

  • 21:

    Procedure ComputePenalty (GSlice,PSlice)

  • 22:

    Compute Jw(GSlice,PSlice)=imin(gi,pi)imax(gi,pi)

  • 23:

    Compute Pjw=(1Jw(GSlice,PSlice))

  • 24:

    EndProcedure

  • 25:

     

  • 26:

    Procedure AssignPenalty (GT,PT,Pjw)

  • 27:

    fori=ktoldo

  • 28:

      if (gi>0)and(pi>0)and(|pigi|gi>Cg_CThres) then

  • 29:

        Assign penalty EEi(m)=Pjw

  • 30:

      else

  • 31:

        Assign penalty EEi(m)=0

  • 32:

      end if

  • 33:

    end for

  • 34:

    EndProcedure