##### Octane Data Example #####
data(gasoline)
Y = gasoline$octane
funcs = gasoline$NIR
wavelengths = 2*450:850
# fit the model using pfr
fit = pfr(Y=Y, funcs=funcs, kz=50, kb=50)
# plot the estimated coefficient function
matplot(wavelengths, cbind(fit$betaHat, fit$Bound), type='l', lwd=c(2,1,1),
lty=c(1,2,2), xlab = "Wavelengths", ylab = "Coefficient Function", col=1)
Run the code above in your browser using DataLab