Displaying 20 results from an estimated 10000 matches similar to: "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
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 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
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
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
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
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:
>
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
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 Sep 17
1
Problems with the commands FUNCTION and DERIV to build a polynomial
Hi all,
I need to automate a process in order to prepare a a big loop in the future
but I have a problem with the *command function*
First I fit a model with lm
>
model1<-lm(data2[,2]~data2[,1]+I(data2[,1]^2)+I(data2[,1]^3)+I(data2[,1]^4))
I extract the coefficients to build the polynomial.
coef<-as.matrix(model1$coefficients)
In the next step I need to define the polynomial to
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
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:
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?
2006 May 19
1
UseMethod infelicity
If I do
> example(lm)
...
> mycoef <- function(object, ...) UseMethod("coef", object)
> mycoef(lm.D9)
Error in mycoef(lm.D9) : no applicable method for "coef"
which is pretty surprising, as coef has a default method.
After a bit of digging, this comes from do_usemethod having
defenv = environment where the generic was defined */
defenv =
2004 May 06
5
Orthogonal Polynomial Regression Parameter Estimation
Dear all,
Can any one tell me how can i perform Orthogonal
Polynomial Regression parameter estimation in R?
--------------------------------------------
Here is an "Orthogonal Polynomial" Regression problem
collected from Draper, Smith(1981), page 269. Note
that only value of alpha0 (intercept term) and signs
of each estimate match with the result obtained from
coef(orth.fit). What
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>
2009 Apr 27
1
Plotting polynomial fit
Hi.
Is there an analog to abline() that can be used to plot a polynomial fit?
For example, I can draw the straight-line fit
fit <- lm(y ~ x)
via
abline(coef=fit$coef)
but I'm not sure how to draw the polynomial fit
fit <- lm(y ~ poly(x,2))
I do see the function curve(), but not how to prepare an expr for
curve() based on the coefficients returned by the polynomial