Displaying 20 results from an estimated 2000 matches similar to: "solving x in a polynomial function"
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 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
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 Jan 05
4
solving cubic/quartic equations non-iteratively
To R-helpers,
R offers the polyroot function for solving mentioned equations
iteratively.
However, Dr Math and Mathworld (and other places) show in detail how to
solve mentioned equations non-iteratively.
Do implementations for R that are non-iterative and that solve mentioned
equations exists?
Regards, Mads Jeppe
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
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
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 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
2012 Apr 18
3
Is there a way to find all roots of a polynomial equation in R?
Is there a way to find all roots of a polynomial equation?
Lets say
x^5+a*x^4+b*x^3+c*x^2+d*x+e=0
how to find its all roots?
[[alternative HTML version deleted]]
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
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
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:
2010 Jan 08
0
solving cubic/quartic equations non-iteratively -- comparisons
Hi,
I'm responding to a post about finding roots of a cubic or quartic equation non-iteratively. One obviously could create functions using the explicit algebraic solutions. One post on the subject noted that the square-roots in those solutions also require iteration, and one post claimed iterative solutions are more accurate than the explicit solutions.
This post, however, is about
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
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
2006 Feb 22
1
Gram-Charlier series
Good day everyone,
I want to use the Gram-Charlier series expansion to model
some data. To do that, I need functions to:
1) Calculate 'n' moments from given data
2) Transform 'n' moments to 'n' central moments, or
3) Transform 'n' moments to 'n' cumulants
4) Calculate a number of Hermite polynomials
Are there R-functions to do any of the above?
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
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>
2005 Aug 19
1
Using lm coefficients in polyroot()
Dear useRs,
I need to compute zero of polynomial function fitted by lm. For example
if I fit cubic equation by fit=lm(y~x+I(x^2)+i(x^3)) I can do it simply
by polyroot(fit$coefficients). But, if I fit polynomial of higher order
and optimize it by stepAIC, I get of course some coefficients removed.
Then, if i have model
y ~ I(x^2) + I(x^4)
i cannot call polyroot in such way, because there is
2001 Jul 16
1
polyroot() (PR#751)
In a bug report from Nov.28 2000, Li Dongfeng writes:
-----
I have found that the polyroot()
function in R-1.1.1(both solaris
and Win32 version) gives totally
incorrect result. Here is the offending
code:
# Polyroot bug report:
# from R-1.1.1
> sort(abs(polyroot(c(1,-2,1,0,0,0,0,0,0,0,0,0,-2,5,-2,0,0,0,0,0,0,0,0,0,1,-2))))
[1] 0.8758259 0.9486499 0.9731015 1.5419189 1.7466214 1.7535362