if (FALSE) {
library(embryogrowth)
# Exemple using the hypothesis of Gaussian distribution
uncertainty.datalogger(sample.rate=30, accuracy=1, resolution=0.5,
method=function(x) {2*qnorm(0.975)*sd(x)})
# Example without hypothesis about distribution, using quantiles
uncertainty.datalogger(sample.rate=30, accuracy=1, resolution=0.5,
method=function(x) {quantile(x, probs=c(0.975))-
quantile(x, probs=c(0.025))})
par(mar=c(4, 4, 1, 1))
plot(x=10:120, uncertainty.datalogger(sample.rate=10:120,
accuracy=0.5,
resolution=1),
las=1, bty="n", type="l",
xlab="Sample rate in minutes",
ylab=expression("Uncertainty in "*degree*"C"),
ylim=c(0, 0.15), xlim=c(0, 120))
lines(x=10:120, uncertainty.datalogger(sample.rate=10:120,
accuracy=1,
resolution=0.5), col="red")
lines(x=10:120, uncertainty.datalogger(sample.rate=10:120,
accuracy=1,
resolution=1), col="blue")
lines(x=10:120, uncertainty.datalogger(sample.rate=10:120,
accuracy=0.5,
resolution=0.5), col="yellow")
legend("topleft", legend=c("Accuracy=0.5, resolution=0.5",
"Accuracy=0.5, resolution=1",
"Accuracy=1, resolution=0.5",
"Accuracy=1, resolution=1"), lty=1,
col=c("yellow", "black", "red", "blue"),
cex=0.6)
}
Run the code above in your browser using DataLab