similar to: coefficient of polynomial expansion

Displaying 20 results from an estimated 11000 matches similar to: "coefficient of polynomial expansion"

2004 Dec 03
5
how can I get the coefficients of x^0, x^1, x^2, . , x^6 from expansion of (1+x+x^2)^3
Hi, I would like to get the coefficients of x^0, x^1, x^2, . , x^6 from expansion of (1+x+x^2)^3. The result should be 1, 3, 6, 7, 6, 3, 1; How can I calculate in R? You help will be greatly appreciated. Peter [[alternative HTML version deleted]]
2010 Oct 14
1
Fw: Problem to create a matrix polynomial
Awaiting some suggestion. Was my question not very understandable? Please let me know how can I offer more elaborate clarification. Additionally, I would like to solve the determinant of "p1" for the values of "z" (I am working with some multivariate time series modelling). When I use det() function, it am getting error that, that function is not for objects with class
2006 Oct 09
1
Coefficients of a factorized polynomial
Hi all, starting from a vector "v[1:n]" I would like to compute the coefficients of the polynomial (1+x^v[1])*(1+x^v[2])*...*(1+x^v[n]). The following code works but is extremely slow for a large "n" due to, I believe, the polynomial being factorized. I wanted to try the package "polynom" command "unclass" but I could not figure out how to input a
2006 Nov 13
1
wishlist: xlim in lines.polynomial (PR#9362)
Full_Name: Tamas K Papp Version: 2.4.0 OS: linux Submission from: (NULL) (140.180.166.160) I was using the lines.polynomial method for plotting piecewise polynomials (parts of splines). I needed a feature to limit the range of plotting using a parameter given to the function (as opposed to par("usr")). I think that the following changes would be a nice addition: lines.polynomial
2010 Oct 05
2
Using as.polynomial() over a matrix
Hello All First - a warning. I'm not very R or programming savvy. I am trying to do something without much luck, and have scoured help-pages, but nothing has come up. Here it is: I have a matrix (m) of approx 40,000 rows and 3 columns, filled with numbers. I would like to convert the contents of this matrix into another matrix (m_p), where the numbers of (m) have been coerced into a
2002 Oct 09
5
polynomial
Any better (more efficient, built-in) ideas for computing coef[1]+coef[2]*x+coef[3]*x^2+ ... than polynom <- function(coef,x) { n <- length(coef) sum(coef*apply(matrix(c(rep(x,n),seq(0,n-1)),ncol=2),1,function(z)z[1]^z[2])) } ? Ben -- 318 Carr Hall bolker at zoo.ufl.edu Zoology Department, University of Florida http://www.zoo.ufl.edu/bolker
2013 Mar 01
2
solving x in a polynomial function
Hi there, Does anyone know how I solve for x from a given y in a polynomial function? Here's some example code: ##example file a<-1:10 b<-c(1,2,2.5,3,3.5,4,6,7,7.5,8) po.lm<-lm(a~b+I(b^2)+I(b^3)+I(b^4)); summary(po.lm) (please ignore that the model is severely overfit- that's not the point). Let's say I want to solve for the value b where a = 5.5. Any thoughts? I did
2004 Dec 03
3
Computing the minimal polynomial or, at least, its degree
Hi, I would like to know whether there exist algorithms to compute the coefficients or, at least, the degree of the minimal polynomial of a square matrix A (over the field of complex numbers)? I don't know whether this would require symbolic computation. If not, has any of the algorithms been implemented in R? Thanks very much, Ravi. P.S. Just for the sake of completeness, a
2007 Nov 06
1
How to find the zero (only the real solution) with the package polynom ?
Hello, I have 3 columns : a, b and a*b I would like to find the pair (a,b) so that a*b is the minimum but not from the points I measured but from the fit of the curve (I have more points that the ones given below but I fit only on this part because I know that the minimum a*b is in this interval). I thought doing it this way : - to fit a*b=f(a) abfit<-lm(ab ~ poly(a,8,raw=T)) - to use the
2008 Oct 15
4
a really simple question on polynomial multiplication
Dear R people: Is there a way to perform simple polynomial multiplication; that is, something like (x - 3) * (x + 3) = x^2 - 9, please? I looked in poly and polyroot and expression. There used to be a package that had this, maybe? thanks, Erin -- Erin Hodgess Associate Professor Department of Computer and Mathematical Sciences University of Houston - Downtown mailto: erinm.hodgess at
2009 May 14
1
automated polynomial regression
Dear all - We perform some measurements with a machine that needs to be recalibrated. The best calibration we get with polynomial regression. The data might look like follows: > true_y <- c(1:50)*.8 > # the real values > m_y <- c((1:21)*1.1, 21.1, 22.2, 23.3 ,c(25:50)*.9)/0.3-5.2 > # the measured data > x <- c(1:50) > # and the x-axes > > # Now I do the following:
2004 Jun 25
4
Bug in parse(text = <long polynom>) (PR#7022)
Merci beaucoup, Jean, for the bug report -- which I'm no "completeing" to R-bugs >>>>> "Jean" == Jean Coursol <coursol@cristal.math.u-psud.fr> >>>>> on Thu, 24 Jun 2004 15:22:37 +0200 (CEST) writes: Jean> I was exploring the polynom library with students: <and found a segmentation fault from parsing a long expression>
2007 Nov 07
3
Can I replace NA by 0 (if yes, how) ?
Hello, I'm trying to fit some points with a 8-degrees polynom (result of lm is stored in pfit). In most of the case, it is ok but for some others, some coefficients are "NA". I don't really understand the meaning of these "NA". And the problem is that I can't perform a derivation (pderiv<-as.function((deriv(polynomial(pfit$coefficients))))) on pfit due to the
2009 Jan 11
4
How to get solution of following polynomial?
Hi, I want find all roots for the following polynomial : a <- c(-0.07, 0.17); b <- c(1, -4); cc <- matrix(c(0.24, 0.00, -0.08, -0.31), 2); d <- matrix(c(0, 0, -0.13, -0.37), 2); e <- matrix(c(0.2, 0, -0.06, -0.34), 2) A1 <- diag(2) + a %*% t(b) + cc; A2 <- -cc + d; A3 <- -d + e; A4 <- -e fn <- function(z) { y <- diag(2) - A1*z - A2*z^2 - A3*z^3 - A4*z^4
2004 Aug 09
1
returns the value of a polynomial of degree n evaluated at x.
> Background: > OS: Linux Mandrake 9.1 > release: R 1.9.0 > editor: Xemacs 21.4 > frontend: ESS 5.1.23 > --------------------------------- > > Colleagues > Is there a function in R that is similar to polyval in matlab? (y = polyval(p,x) returns the value of a polynomial of degree n evaluated at x. The input argument p is a vector of length n+1 whose elements are the
2010 Jun 07
1
fit data with y = x^-1
Dear list, I am getting weired with fitting data with a 1/x-polynomial. Suggest I have the following data: x <- c(1,2,3,4,5,6,7) y <- c(100,20,4,2,1,.3,.1) I may fit this with a linear model fit1 = lm(y ~ I(x)) Getting plot out of this model I applied library(polynom) pol1 = polynomial(fit1$coefficients) f1 = as.function(pol1) plot(x,y) lines(x, f1(x), col = 2) Clearly, this model
2001 Jul 09
1
polynomial regression and poly
When doing polynomial regression I believe it is a good idea to use the poly function to generate orthogonal polynomials. When doing this in Splus there is a handy function (transform.poly I think) to convert the coefficients produced by regression with the poly function back to the original scale. Has somebody written something similar for R ? Robert
2009 Jun 03
0
fitting polynomial, for integration.
Hello, I have a question regarding fitting a polynomial to a data set, then constructing a polynom from the coefficients so that I can integrate it. I first use lm to fit the polynomial setting the coefficients to raw=TRUE - this appears to work fine. I plot the model and it is a true representation of the data. I then take the coefficients vector and construct a polynom from the
2008 Mar 07
5
Puzzling coefficients for linear fitting to polynom
Hi, I can not comprehend the linear fitting results of polynoms. For example, given the following data (representing y = x^2): > x <- 1:3 > y <- c(1, 4, 9) performing a linear fit > f <- lm(y ~ poly(x, 2)) gives weird coefficients: > coefficients(f) (Intercept) poly(x, 2)1 poly(x, 2)2 4.6666667 5.6568542 0.8164966 However the fitted() result makes sense: >
2006 Jul 01
1
polynomial expansion in R
Hi: I have two vectors of data, x and y and I want to get the "polynomial" expansion of (x+y)^p with any integer power p in R. Suppose p=2, then I want a matrix of five vectors, namely, x y x^2 y^2 x*y. The coefficient of the polynomial is not needed. I can write it manully if p is small. But I want it in the case of p=10 or even bigger, is there any function in R can do that