Displaying 20 results from an estimated 5000 matches similar to: "Plot 2-d Polynomial without solving it"
2013 Apr 08
1
fitting a hyperbola to data points
Hi,
I am new to R, and I suspect I am missing something simple.
I have a data set that performance data that correlates request
rate to response times
http://pastebin.com/Xhg0RaUp
There is some jitter in the data, but mostly it looks like a hockey
puck curve. It does not get converted into a straight line when I tried
log conversions, so it does not seem to be a
2010 Sep 29
1
Fitting a half-ellipse curve
Dear mailing list,
I have following array:
X2 Y2
[1,] 422.7900 6.0
[2,] 469.8007 10.5
[3,] 483.9428 11.0
[4,] 532.4917 25.5
[5,] 596.1942 33.5
[6,] 630.8496 40.5
[7,] 733.2996 45.0
[8,] 946.4779 32.0
[9,] 996.8068 35.5
[10,] 1074.3310 23.0
I do afterwards the following:
plot.new()
plot.window(xlim=c(min(X1)-50,max(X1)+50),
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
2003 Nov 03
1
svm in e1071 package: polynomial vs linear kernel
I am trying to understand what is the difference between linear and
polynomial kernel:
linear: u'*v
polynomial: (gamma*u'*v + coef0)^degree
It would seem that polynomial kernel with gamma = 1; coef0 = 0 and degree
= 1
should be identical to linear kernel, however it gives me significantly
different results for very simple
data set, with linear kernel
2007 Aug 15
1
Polynomial fitting
Hi everybody!
I'm looking some way to do in R a polynomial fit, say like polyfit
function of Octave/MATLAB.
For who don't know, c = polyfit(x,y,m) finds the coefficients of a
polynomial p(x) of degree m that fits the data, p(x[i]) to y[i], in a
least squares sense. The result c is a vector of length m+1 containing
the polynomial coefficients in descending powers:
p(x) = c[1]*x^n +
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 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 Jul 07
1
Polynomial fitting
Hello,
i'm fairly familiar with R and use it every now and then for math related
tasks.
I have a simple non polynomial function that i would like to approximate
with a polynomial. I already looked into poly, but was unable to understand
what to do with it. So my problem is this. I can generate virtually any
number of datapoints and would like to find the coeffs a1, a2, ... up to a
given
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
2003 Apr 29
1
polynomial fitting
I'm trying to find a way to fit a polynomial of degree n in x and y to
a set of x, y, and z data that I have and obtain the coefficients for
the terms of the fitted polynomial. However, when I try to use the
surf.ls function I'm getting odd results.
> x <- seq(0, 10, length=50)
> y <- x
> f <- function (x, y) {x^2 + y}
> library(spatial)
> test <-
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
2012 Apr 19
1
How to find a root for a polynomial between [-inf, -3]?
Hi all,
I have a polynomial (a big one) and I would like to find a root of it
between [-inf, -3] (it's known there is one root in this interval)...
How to find that root?
In using "uniroot" I need to supply the bounds....
In using "polyroot" I need to write it in the strict sens polynomial
format... but I cannot... i.e. the polynomial is implicit...
Thank you!
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
2009 Sep 28
2
Polynomial Fitting
Hello All,
This might seem elementary to everyone, but please bear with me. I've
just spent some time fitting poly functions to time series data in R
using lm() and predict(). I want to analyze the functions once I've
fit them to the various data I'm studying. However, after pulling the
first function into Octave (just by plotting the polynomial function
using fplot() over
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
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
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
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
2008 Jan 07
3
Polynomial fitting
I wonder how one in R can fit a 3rd degree polynomial to some data?
Say the data is:
y <- c(15.51, 12.44, 31.5, 21.5, 17.89, 27.09, 15.02, 13.43, 18.18, 11.32)
x <- seq(3.75, 6, 0.25)
And resulting degrees of polynomial are:
5.8007 -91.6339 472.1726 -774.2584
THanks in advance!
--
Jonas Malmros
Stockholm University
Stockholm, Sweden
2010 May 17
2
best polynomial approximation
Dear R-users,
I learned today that there exists an interesting topic in numerical
analysis names "best polynomial approximation" (BSA). Given a function
f the BSA of degree k, say pk, is the polynomial such that
pk=arginf sup(|f-pk|)
Although given some regularity condition of f, pk is unique, pk IS NOT
calculated with least square. A quick google tour show a rich field of
research