similar to: Fw: Problem to create a matrix polynomial

Displaying 20 results from an estimated 1300 matches similar to: "Fw: Problem to create a matrix polynomial"

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
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 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
2005 Aug 08
2
coefficient of polynomial expansion
Hi, I would like to get the coefficient of polynomial expansion. For example, (1+ x)^2 = 1 + 2x + x^2, and the coefficients are 1, 2 and 1. (1 + x + x^2)^3 = 1 + 3*x + 6*x^2 + 7*x^3 + 6*x^4 + 3*x^5 + x^6, and the coefficients are 1, 3, 6, 7, 6, 3, and 1. I know that we can use polynom library. Is there any other way to do it without loading a library. Thanks a lot for your help. Peter
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
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
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
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
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:
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
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
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>
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 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
2004 Aug 09
0
returns the value of a polynomial of degree n evaluated a t x.
Try something like: install.packages("polynom") library(polynom) predict(polynomial(rev(p)), x) HTH, Andy > From: McClatchie, Sam (PIRSA-SARDI) > > > Background: > > OS: Linux Mandrake 9.1 > > release: R 1.9.0 > > editor: Xemacs 21.4 > > frontend: ESS 5.1.23 > > --------------------------------- > > > > Colleagues > >
2011 Jun 14
1
functions for polynomial and rational interplation?
Are there implementations of, e.g. Neville's algorithm, for interpolating polynomials through some data points? Nevilles' is an improvement on Lagrange interpolation. And how about interpolating rational functions? I could not find anything at rseek.org or at crantastic.org. thanks -- View this message in context:
2009 Dec 28
1
Matrix to list object
let consider following matrix : mat <- matrix(rnorm(45), 15) Now I want to convert it to a list object "mat_list", which will have 15 elements and each element will again be a matrix with 3 rows and 3 columns. How can I do that? Thanks, -- View this message in context: http://n4.nabble.com/Matrix-to-list-object-tp989738p989738.html Sent from the R help mailing list archive at
2010 Mar 22
1
Replacing elements of list
Dear all, I have following two list object, both are basically collection of matrices : dat1 <- matrix(rnorm(25*6), ncol=6) dat1 <- split(dat1, seq(5,25,by=5)) dat1 <- lapply(dat1, matrix, ncol=6) dat2 <- matrix(rnorm(25*4), ncol=4) dat2 <- split(dat2, seq(5,25,by=5)) dat2 <- lapply(dat2, matrix, ncol=4) Now I want to replace last 4 columns of each matrix at "dat1"
2002 May 10
1
updata.packages()
Something strange is happening with update.packages on my machine (Win2000, R-1.5.0 installed from binaries). Some of the packages (see below) keep getting updated every time. When I issue update.packages() I get this every time for the last few days (I think since I installed 1.5 and the packages but I am not sure). This happens with CRAN shown below and also with CRAN set to
2000 Aug 31
1
Install polynom pack
Dear R people: I am trying to download the package polynom to R version 1.0.1.1. on Windows. Here are my commands and output: > install.packages("polynom",lib="c:\rw1011\library",CRAN="http://www.r-project.org/src/contrib/") Error in start[k]:(start[k + 1] - 1) : NA/NaN argument In addition: Warning message: Download had nonzero exit status in: