| mean.BDataSplines | R Documentation |
This function simply averages the spline coefficients and returns a correponding spline.
## S3 method for class 'BDataSplines'
mean(x, ..., method = c("classical", "mcd", "mve"))
## S3 method for class 'BDataDensities'
mean(x, ..., method = c("functions", "classical", "mcd", "mve"))
## S3 method for class 'BDataPDFs'
mean(x, ..., method = c("functions", "classical", "mcd", "mve"))
## S3 method for class 'BDataLogPDFs'
mean(x, ..., method = c("functions", "classical", "mcd", "mve"))
## S3 method for class 'BDataLogDensities'
mean(x, ..., method = c("functions", "classical", "mcd", "mve"))
x |
the BDataSplines object over which to average |
... |
unused arguments required for generic use |
method |
the method to be chosen (as in [cov.rob]), functions does operates according to BayesSpace formulas directly on the densities, classical uses the spline representation, mcd and mve apply these robust methods on the spline coefficients. |
a BDataSplines with a single observation representing the mean
mean(BDataDensities): method for full densities
mean(BDataPDFs): method for full PDFs
mean(BDataLogPDFs): method for full logPDFs
mean(BDataLogDensities): method for full logDensities
data(DTD)
Xpdf = BDataPDFs(DTD$shapePDF,basis=B2Unif01Basis5)
Xspline = as.BDataSplines(Xpdf)
plot(Xspline,col=2:12)
meanXspline = mean(Xspline)
plot(meanXspline,col=1,lwd=3,add=TRUE)
plot(Xspline,as="PDF")
plot(meanXspline,col="red",lwd=3,add=TRUE,as="PDF")
Xdensities = as.BDataDensities(Xpdf)
plot(Xdensities)
meanXdensities = clo(mean(Xdensities))
plot(meanXdensities,col="green",lwd=7,add=TRUE)
plot(meanXspline,col="red",lwd=3,add=TRUE,as="density")
plot(Xpdf)
meanXpdf = mean(Xpdf)
plot(clo(meanXpdf),col="green",lwd=7,add=TRUE)
plot(meanXspline,col="red",lwd=3,add=TRUE,as="PDF",close=TRUE)
plot(as.BDataPDFs(meanXdensities),col="blue",lwd=3,add=TRUE,close=TRUE)
plot(as.BDataPDFs(mean(as.BDataLogPDFs(Xpdf))),col="orange",lwd=3,add=TRUE,close=TRUE)
plot(as.BDataPDFs(mean(as.BDataLogDensities(Xpdf))),col="magenta",lwd=3,add=TRUE,close=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.