# NOT RUN {
# for predict the value of a polynomial matrix at a real or complex value
# the used method: predict.polyMatrix()
pm <- polyMgen.d(2,2,ch2pn(c("1","x","x^2","0")))
pm # 1, x^2 \ x, 0
predict(pm,2) # 1, 4 \ 2, 0
# for predict the result of a linear model
# the used method: predict.lm()
x<-1:5;y<-rnorm(5);predict(lm(y~x))
# clean up
# rm(pm, x, y)
# }
Run the code above in your browser using DataLab