similar to: Coefficients of a factorized polynomial

Displaying 20 results from an estimated 4000 matches similar to: "Coefficients of a factorized polynomial"

2006 Oct 27
3
How to best divide table by table
Hi all, how can I divide two tables of the same dimension so that all names are preserved, ie do not become NA? I have "tab1" and "tab2", each having names in the first column. I want "tab3" with the same names and values "tab1/tab2". Thanks, Serguei
2005 Nov 22
4
the matrix of rows with specific row sums
I am just starting with R and have the following problem: given a matrix of ones and zeroes, say mdim=4 m<-matrix(round(runif(mdim^mdim)),mdim,mdim) how to construct the matrix of those rows of m, whose elements sum to 2. Contrary to the random matrix above, the actual matrix always has at least one such row. Serguei Kaniovski
2006 Mar 03
3
Two quick questions
Hi all, 1. How to construct a date from three variables year, month, and day, where all three are integers? 2. I have a dataframe by date and sector. I would like to add-up all entries for all variable with identical date and sector, replacing the original entries, i.e. emulate the STATA command "collapse (sum) var1 var2 var3, by(date sector)". Thank you, Serguei Kaniovski
2005 Dec 05
5
What is wrong with this FOR-loop?
Hi, I have a more complex example, but the problem boils down to this FOR-loop not filling in the res-matrix run_rows<-seq(0,1,0.05) run_cols<-seq(0.3,0.6,0.05) res<-matrix(NA,length(run_rows),length(run_cols)) for(i in run_rows) { for(j in run_cols) { res[i,j]=i+j #niether the above, nor res[[i,j]]=i+j work, why? } } Thank you, Serguei
2005 Nov 23
2
vector of permutated products
Given an x-vector with, say, 3 elements, I would like to compute the following vector of permutated products (1-x1)*(1-x2)*(1-x3) (1-x1)*(1-x2)*x3 (1-x1)*x2*(1-x3) x1*(1-x2)*(1-x3) (1-x1)*x2*x3 x1*(1-x2)*x3 x1*x2*(1-x3) x1*x2*x3 Now, I already have the correctly sorted matrix of permutations! So, the input looks something like: #input x<-c(0.3,0.1,0.2) Nx<-length(x) Ncomb<-2^Nx
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
2005 Dec 03
1
Correlation matrix from a vector of pairwise correlations
I've a vector of pairwise correlations in the order low-index element precedes the high-index element, say: corr(1,2)=0.1, corr(1,3)=0.2, corr(2,3)=0.3, corr(3,4)=0.4 How can I construct the corresponding correlation matrix? I tried using the "combn"-function in "combinat" package: library(combinat) combn(c(0.1,0.2,0.3,0.4),2) , but to no avail... Thank you for your
2005 Nov 29
1
Constraints in Quadprog
I'm having difficulty figuring out how to implement the following set of constraints in Quadprog: 1). x1+x2+x3+x4=a1 2). x1+x2+x5+x6=a2 3). x1+x3+x5+x7=a3 4). x1+x2=b1 5). x1+x3=b2 6). x1+x5=b3 for the problem: MIN (x1-c1)2+(x2-c2)2+...+(x8-c8)2. As far a I understand, "solve.QP(Dmat, dvec, Amat, bvec, meq=0, factorized=FALSE)" reads contraints using an element-by-element
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
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
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
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
2011 Feb 02
2
unequally spaced factor levels orthogonal polynomial contrasts coefficients trend analysis
Hello [R]-help I am trying to find > a package where you can do ANOVA based trend analysis on grouped data > using orthogonal polynomial contrasts coefficients, for unequally > spaced factor levels. The closest hit I've had is from this web site: >(http://webcache.googleusercontent.com/search?q=cache:xN4K_KGuYGcJ:www.datavis.ca/sasmac/orpoly.html+Orthogonal+polynomial >l but I
2013 Apr 27
2
Polynomial Regression and NA coefficients in R
Hey all, I'm performing polynomial regression. I'm simulating x values using runif() and y values using a deterministic function of x and rnorm(). When I perform polynomial regression like this: fit_poly <- lm(y ~ poly(x,11,raw = TRUE)) I get some NA coefficients. I think this is due to the high correlation between say x and x^2 if x is distributed uniformly on the unit interval
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
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 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
2005 Jun 14
2
ordinary polynomial coefficients from orthogonal polynomials?
How can ordinary polynomial coefficients be calculated from an orthogonal polynomial fit? I'm trying to do something like find a,b,c,d from lm(billions ~ a+b*decade+c*decade^2+d*decade^3) but that gives: "Error in eval(expr, envir, enclos) : Object "a" not found" > decade <- c(1950, 1960, 1970, 1980, 1990) > billions <- c(3.5, 5, 7.5, 13, 40) > #
2009 Dec 08
1
coefficients of each local polynomial from locfit
Hi list, This was asked a couple of years ago but I can't find a resolution. Is there any way to get the coefficients from one of the local polynomial fits in locfit. I realize that locfit only constructs polynomials at a handful of intelligently selected points and uses interpolation to predict any other points. I would like to know the terms of the polynomials at these points. It seems
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