TargetDiagram: Statistical analysis of a PV system with the Target Diagram

Description Usage Arguments Value Author(s) References Examples

View source: R/TargetDiagram.R

Description

In a PV plant, the individual systems are theoretically identical and their performance along the time should be the same. Due to their practical differences –power tolerance, dispersion losses, dust–, the individual performance of each system will deviate from the average behaviour. However, when a system is performing correctly, these deviations are constrained inside a range and should not be regarded as sign of malfunctioning.

If these common deviations are assumed as a random process, a statistical analysis of the performance of the whole set of systems can identify a faulty system as the one that departs significantly from the mean behaviour.

These functions compare the daily performance of each system with a reference (for example, the median of the whole set) during a time period of N days preceding the current day. They calculate a set of statistics of the performance of the PV plant as a whole, and another set of the comparison with the reference. This statistical analysis can be summarised with a graphical tool named "Target Diagram", which plots together the root mean square difference, the average difference and the standard deviation of the difference. Besides, this diagram includes the sign of the difference of the standard deviations of the system and the reference.

Usage

1
2
analyzeData(x, ref=NULL)
TargetDiagram(x, end, ndays, ref=NULL, color=NULL, cex=0.8,...)

Arguments

x

A zoo object with several columns. This object represent the time evolution of a set of units (e.g. PV generators of a large system) which are supposed to show a similar behaviour.

ref

A zoo object to be used as the reference unit. If ref=NULL (default), the reference is the median of the set.

end

A Date or POSIXct object (same class as the index of x). It defines the last day of the window to be included in the analysis.

ndays

A numeric vector, where each element is the number of days to be included in each analysis.

color

If color=NULL (default) the plot is black and white and each analysis is contained in different areas.

cex

Size of the labels.

...

Arguments to be read by xyplot.

Value

The result of TargetDiagram is a list with two components:

plot:

a trellis object with the plot.

stat:

a zoo object with err component of the result of analyzeData.

The result of analyzeData is a list with two components:

stat:

a zoo object with the time evolution of several statistics (mean, median, standard deviation, median absolute deviation and interquantile range) of the set as a whole.

err:

a data.frame with the same number of rows as the number of columns of the x object. It contains several columns with the statistics of the diference between each unit and the reference (see the references for details.)

Author(s)

Oscar Perpiñán Lamigueiro.

References

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
library(lattice)
library(latticeExtra)

data(prodEx)

prodStat<-analyzeData(prodEx)
xyplot(prodStat$stat)
dif<-prodEx-prodStat$stat$Median;

day=as.Date('2008-8-29')

horizonplot(window(dif, start=day-90, end=day),
            origin=0, layout=c(1, 22), colorkey=TRUE, colorkey.digits=1,
            scales=list(y=list(relation="same")))

###With a external reference
ref1=apply(prodEx, 1, median, na.rm=1)
prodStat1=analyzeData(prodEx, ref=ref1)
identical(prodStat, prodStat1)

###Target Diagram

ndays=c(5, 10, 15, 20)

#Color
if (require(RColorBrewer)){
    palette=brewer.pal(n=length(ndays), name='Set1')

    TDColor<-TargetDiagram(prodEx, end=day, ndays=ndays,
                           color=palette)
}

#B&W
TDbw<-TargetDiagram(prodEx, end=day, ndays=ndays)

solaR documentation built on May 2, 2019, 6:07 p.m.

Related to TargetDiagram in solaR...