## Not run:
# data(phoneme)
# freq <- 1:150
# classes <- phoneme[,151]
# phoneme <- phoneme[,-151]
# classnames <- c("sh", "iy", "dcl", "aa", "ao")
#
# ## Local linear fit to the mean log-periodogram for each phoneme
# llfit <- mapply(locpoly, y = by(phoneme, classes, colMeans),
# MoreArgs = list(x = freq, bandwidth = 2, degree = 1,
# gridsize = length(freq)))
# llfit.y <- matrix(unlist(llfit["y",]), 150, 5)
# matplot(freq, llfit.y, type = "l", lty = 1, xlab = "Frequency (scaled)",
# ylab = "Log-intensity",
# main = "Local linear estimation\nof the population mean log-periodogram")
# legend("topright", legend = classnames, col = 1:5, lty = 1)
# ## End(Not run)
Run the code above in your browser using DataLab