similar to: precision matrix for polynomial growth curves

Displaying 20 results from an estimated 5000 matches similar to: "precision matrix for polynomial growth curves"

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) > #
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
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 May 27
1
Recommended package nlme: bug in predict.lme when an independent variable is a polynomial (PR#8905)
Full_Name: Renaud Lancelot Version: Version 2.3.0 (2006-04-24) OS: MS Windows XP Pro SP2 Submission from: (NULL) (82.239.219.108) I think there is a bug in predict.lme, when a polynomial generated by poly() is used as an explanatory variable, and a new data.frame is used for predictions. I guess this is related to * not * using, for predictions, the coefs used in constructing the orthogonal
2003 Jan 16
2
polynomial contrasts in R
In S-Plus, I can obtain polynomial contrasts for an ordered factor with contr.poly(). The function also exists in R, however is limited to factors where the levels are equally spaced. In S-Plus, one can obtain the contrasts for a set of numeric values representing unequally spaced ordered factors. Has anyone implemented this in R? I see that the S-Plus function calls another function (poly.raw())
2010 Jan 18
2
Predict polynomial problem
I have a function that fits polynomial models for the orders in n: lmn <- function(d,n){ models=list() for(i in n){ models[[i]]=lm(y~poly(x,i),data=d) } return(models) } My data is: > d=data.frame(x=1:10,y=runif(10)) So first just do it for a cubic: > mmn = lmn(d,3) > predict(mmn[[3]]) 1 2 3 4 5 6 7 8
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 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
2008 Aug 19
1
Polynomial regression help
I have a simple X, Y data frame that I am trying to run regression analysis on. The linear regression looks great, but when I use lm(formula = y ~ poly(x, degree = 5)) I get the same coeffecients. So for example if I use degree =3 my formula would look like y = 4.2 x^3 + 3.2x^2 + 2.1x + 1.0 and my degree 5 would look like y = 6.5x^5+ 5.4x^4 + 4.2 x^3 + 3.2x^2 + 2.1x + 1.0, which doesn't make
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
2011 Nov 08
2
determine length of bivariate polynomial
Dear R-community, I have a fitted bivariate polynomial, i.e: fit = lm(cbind(x, y)~poly(t, 15)) and I would like to determine the length of the line in the interval t = [a, b]. Obviously, I could use predict and go through all the points, i.e. for (t in a:(b-1)) { length = length + sqrt((x.pred[t] - x.pred[t+1])^2 + (y.pred[t] - y.pred[t+1])^2) } but that would take very long given the amount
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 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
2006 Apr 06
1
polynomial predict with lme
Does lme prediction work correctly with poly() terms? In the following simulated example, the predictions are wildly off. Or am I doing something daft? Milk yield for five cows is measured weekly for 45 weeks. Yield is simulated as cubic function of weekno + random cow effect (on intercept) + residual error. I want to recover an estimate of the fixed curve. ############### library(nlme)
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
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 May 30
0
(PR#8905) Recommended package nlme: bug in predict.lme when an independent variable is a polynomial
Many thanks for your very useful comments and suggestions. Renaud 2006/5/30, Prof Brian Ripley <ripley at stats.ox.ac.uk>: > On Tue, 30 May 2006, Prof Brian Ripley wrote: > > > This is not really a bug. See > > > > http://developer.r-project.org/model-fitting-functions.txt > > > > for how this is handled in other packages. All model-fitting in R used =
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