# load package "numOSL"
library(numOSL)
# Calculating equivalent doses using data from Duller (2007a)
data(Curvedata)
Res<-matrix(nrow=4,ncol=3)
par(mfrow=c(2,2))
for (i in 1:4) {
model<-ifelse(any(i==c(1,2)),"exp","line")
Simple<-calED(Curvedata[[i]][[1]],Curvedata[[i]][[2]],
model=model,ErrorMethod="sp",plot=FALSE)
MonteCarlo<-calED(Curvedata[[i]][[1]],Curvedata[[i]][[2]],
model=model,ErrorMethod="mc",plot=TRUE)
Res[i,1:2]<-Simple$ED
Res[i,3]<-MonteCarlo$ED[2]
} # end for
colnames(Res)<-c("ED","Simp.Error","MC.Error")
rownames(Res)<-c("Exponential","Exponential","linear","linear")
print(Res)
par(mfrow=c(1,1))
Run the code above in your browser using DataLab