How to represent polynomials with numeric vectors in R

后端 未结 3 931
伪装坚强ぢ
伪装坚强ぢ 2020-12-17 14:30

In R how would one represent polynomial expressions and do polynomial math with the numeric vector objects? For example:

x1 <- c(2,1)  # 2 + x
x2 <- c(         


        
3条回答
  •  醉梦人生
    2020-12-17 15:10

    Polynomial multiplication is the convolution of the coefficients

    convolve(c(2,1),rev(c(-1,3)),type="open")
    #[1] -2  5  3
    

提交回复
热议问题