PolyShift | R Documentation |
If coef
is a vector of coefficients for a polynomial of the
form coef[1] + coef[2]*x + coef[3]*x^2 + coef[4]*x^3
, then
coef_tr <- PolyShift(a, 4) %*% coef
is a vector of coefficients
for the same polynomial centered at a
, i.e.
coef_tr[1] + coef_tr[2]*(x-a) + coef_tr[3]*(x-a)^2 + coef_tr[4]*(x-a)^3
,
PolyShift(a, n)
a |
center for transformed polynomial |
n |
number of coefficients |
coefs <- c(3,2,4)
x <- 3
n <- length(coefs)
a <- 2
sum( coefs * x ^ (0:(n-1)))
sum( PolyShift(a,n)%*%coefs * (x -a)^(0:(n-1)))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.