# My T
myT <- 40:170
# My artifical curve
myAlpha <- c(seq(0.01, 0.02, length.out=40),
dnorm(seq(-3,3,length.out=51))/2+(0:50)/2000+0.02)
myAlpha <- c(myAlpha,
seq(myAlpha[90]-0.001, 0.01, length.out=40))
myAlpha <- myAlpha - min(myAlpha)
myAlpha <- cumsum(dadt <- myAlpha/sum(myAlpha))
# Discrete derivative
mydAlpha <- c(0,diff(myAlpha)); mydAlpha <- matrix(mydAlpha, ncol=length(mydAlpha))
rm(myAlpha) # Throw away myAlpha
# Compute baseline from T and derivative
B <- baseline(mydAlpha, t=myT, method="TAP")
# Plot
plot(B, xlab = "T", ylab = "da/dT")
Run the code above in your browser using DataLab