Learn R Programming

polyMatrix (version 0.3.1)

predict.polyMatrix: Calculate the value of a polynomial matrix for real or complex values

Description

Calculate the value of the polynom elements of the ‘polyMatrix’ class object for real and complex argument also.

Usage

# S3 method for polyMatrix
predict(object,M,…)

Arguments

object

a ‘polyMatrix’ class object

M

a real or complex argument

additional arguments

Value

A matrix the just the same size as the input, filled by the values of the polynom elements, at the given argument.

See Also

predict.polynomial, predict.charpn

Examples

Run this code
# 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