Calculate the value of a characteristic polynomial for a polyMatrix argument
The ‘polynom::predict.polynomial()’ method works by real coefficients
only but it works for real or complex and matrix argument also.
But in the case of matrix argument uses the elementwise product.
The ‘polyMatrix::predict’ method evaluate the polynom by
the usual matrix product definition.
## S3 method for class 'charpn' predict(object,pM,...)
object |
a ‘charpn’ class object |
pM |
a ‘polyMatrix’ class object |
... |
additional arguments |
value |
A ‘polynomial’ class object |
pm <- polyMgen.d(2,2,rawData=ch2pn(c("1","x^2","x","0")))
pm # 1, z^2\\ z, 0
predict(pm,2) # matrix(c(1,4,2,0),2)
# predict the result of a linear model
x <- 1:5;y <- rnorm(5);predict(lm(y~x)) # the used method: predict.lm()
# clean up
# rm(pm, x, y)Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.