Displaying 20 results from an estimated 9000 matches similar to: "Fitting Data with errors to non-polynomial Linear Model"
2024 Oct 10
0
Discriminant of a cubic polynomial
Dear Thomas,
Unfortunately, I do not know if any packages implement this functionality. Though, it is a topic that interests me.
Unlike the "classic discriminant", I prefer to work with the reduced polynomial. This "discriminant" is generalizable to a superset of Chebysev polynomials (which I called Cardano-polynomials).
x^3 - 3*c*x - 2*d = 0
x^5 - 5*c*x^3 + 5*c^2*x - 2*d =
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
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 +
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
2009 Nov 11
1
Polynomial fitting
Dear R helpers
Suppose I have a following data
y <- c(9.21, 9.51, 9.73, 9.88, 10.12. 10.21)
t <- c(0, 0.25, 1, 3, 6, 12)
I want to find out the polynomial which fits y in terms of t i.e. y = f(t) some function of t.
e.g. y = bo + b1*t + (b2 * t^2) + (b3 * t^3) + ...... and so on.
In Excel I have defined y as independent variable, then defined t, t^2 and t^3 and using
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 <-
2004 Feb 16
0
how to solve a linear equation system with polynomial factors?
I'm looking for a way to solve a linear equation system where the factors are polynomials:
Here is a simplified example (To solve my problem, I have to deal with dimensions larger than 2):
( s + 2) x1 + (s - 3) x2 = 2
( s^2 + 2s - 1) x1 - 2 x2 = 1
Theoretically the solution is easy: By performing polynomial multiplications, divisions and sums.
I found out, that R is able to
2012 Feb 08
1
Fitting polynomial (power greater than 2)
Hey all, first time poster here. I'm new to R and working on my first real
programming and forecasting asignment. I'm using unemployment data from
1948-2012. I successfully completed part a and the linear fit for part b,
but i am really struggling fitting a polynomial with a power greater than 2
to my forecast. I'll upload my R code at the bottom. Any help is very much
appreciated!
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
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
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
2010 Jun 18
1
Fitting a polynomial using lrm from the Design library
Hi all,
I am looking to fit a logistic regression using the lrm function from the Design library. I am interested in this function because I would like to obtain "pseudo-R2" values (see http://tolstoy.newcastle.edu.au/R/help/02b/1011.html).
Can anyone help me with the syntax?
If I fit the model using the stats library, the code looks like this:
model <- glm(x$trait ~ x$PC1 +
2009 Apr 18
0
igraph 0.5.2
igraph is a package for graphs/networks. It has a C core and
uses a simple and fast graph representation allowing millions
of vertices and edges.
LINKS
Release notes for the 0.5.2 version:
http://igraph.sourceforge.net/relnotes-0.5.2.html
Release notes for the 0.5.1 version:
http://igraph.sourceforge.net/relnotes-0.5.1.html
Complete list of changes:
http://igraph.sourceforge.net/news.html
The
2009 Apr 18
0
igraph 0.5.2
igraph is a package for graphs/networks. It has a C core and
uses a simple and fast graph representation allowing millions
of vertices and edges.
LINKS
Release notes for the 0.5.2 version:
http://igraph.sourceforge.net/relnotes-0.5.2.html
Release notes for the 0.5.1 version:
http://igraph.sourceforge.net/relnotes-0.5.1.html
Complete list of changes:
http://igraph.sourceforge.net/news.html
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
2009 Dec 03
0
smoothing or curve-fit a time series using lowess, polynomial or whatever I can get working
I was looking for suggestions as to how to smooth a timeseries and, having accomplished that, how to find the fitted curve values for intermediate points.
?
I've tried numerous examples of possible approaches in R that I've found on the web, but when applied to my simple data, R returns an error message in numerous cases.
?
The main problem seems to be that I have monthly data, starting
2009 Mar 19
0
Testing loess fit versus linear fit.
I would like to experiment with testing the fit of a loess model against
the fit from an ordinary linear regression. The 1988 JASA paper by
Cleveland and Devlin *appears* to indicate that this can be done, at
least ``approximately''. They, as I read it, advocate the use of an
ANOVA type test with degree of freedom chosen to make the ``F ratio''
have an approximate F distribution
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:
>
2012 Jun 13
3
How to plot linear, cubic and quadratic fitting curve in a figure?
Hi R experts,
Could you please help me to fit a linear, cubic and quadratic curve in a figure? I was trying to show all these three fitting curves with different colour in one figure.
I spent substantial time to figure it out, but I could not.
I have given here a example and what I did for linear, but no idea for cubic and quadratic fitting curve
> dput(test)
structure(list(sp = c(4L, 5L,
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