similar to: piecewise regression using nlme function

Displaying 20 results from an estimated 10000 matches similar to: "piecewise regression using nlme function"

2001 Nov 10
1
piecewise linear regression
We sent questionnaires to lots of folks. The questionnaires differed in word count (wc). For each questionnaire, I know wc and whether the questionnaire was returned or not (status). It looks like there is a fixed rate of return when wc is below a break point, and the rate of return falls off linearly after that. I want to do a piecewise linear regression with two pieces meeting at a common
2007 Jul 29
1
Piecewise Regression with a known slope
Hey, all. I'm working on a data set with a broken stick linear regression where I know one of the two slopes. It is a negative linear function until the line intersects with the x-axis, at which point it becomes 0. It is not a nonlinear asymptotic function, and, indeed, using negative exponential or logistic types of fits as an approximation has tended to lead to an under or
2009 Mar 25
1
Piecewise
Hi, I am a biologist (relatively new to R) analyzing data which we predict to fit a power function. I was wondering if anyone knew a way to model piecewise functions in R, where across a range of values (0-x) the data is modeled as a power function, and across another range (x-inf) it is a linear function. This would be predicted by one of our hypotheses, and we would like to find the AICs
2009 Mar 07
2
piecewise linear regression
Hi - I'd like to construct and plot the percents by year in a small data set (d) that has values between 1988 and 2007. I'd like to have a breakpoint (buy no discontinuity) at 1996. Is there a better way to do this than in the code below? > d year percent se 1 1988 30.6 0.32 2 1989 31.5 0.31 3 1990 30.9 0.30 4 1991 30.6 0.28 5 1992 29.3 0.25 6 1994 30.3
2010 Jan 04
2
Piecewise regression in lmer
Dear all, I'm attempting to use a piecewise regression to model the trajectory of reproductive traits with age in a longitudinal data set using a mixed model framework. The aim is to find three slopes and two points- the slope from low performance in early age to a point of high performance in middle age, the slope (may be 0) of the plateau from the start of high performance to the
2010 Feb 09
1
question about nlme...
I am looking for R code to be able to fit a linear-linear piecewise model with person-specific changepoint. I have searched the web, but have not been able to locate any code. Below is my attempt at some code: chgpt = function(a1,a2,a3,gam,wave){ yht=numeric(10) y1=(wave <= gam)*(a1+(a2*wave)) y2=(wave > gam)*((a1+(a2-a3)*gam)+a3*wave) yhat=y1+y2 return(yht) } nl.dat <- nlme(y ~
2009 Nov 05
1
Simulate data for spline/piecewise regression model
Dear All, I am trying to simulate data for a spline/piecewise regression model. I am missing something fundamental in my simulation procedure because when I try to fit my simulated data using the Gauss-Newton method in SAS, I am getting some wacky parameter estimates. Can anyone please check my simulation code and tell me what mistake I am making in generating data for spline model? Thank you
2005 Jun 10
0
Replies of the question about robustness of segmented regression
I appreciate to Roger Koenker, Achim Zeileis and Vito Muggeo for their informative answers. Listed below is unedited replies I got followed by the question I posted. Kyong 1. Roger Koenker: You might try rqss() in the quantreg package. It gives piecewise linear fits for a nonparametric form of median regression using total variation of the derivative of the fitted function as a penalty
2005 Mar 05
1
S-code for piecewise regression
Dear R-helpers, a S-code for piecewise regressions was provided by Toms & Lesperance (2003) Ecology, 84, 2034-2041 (paper can be found on the web).The code is quite complete with different types of transitions around breakpoints and model selection fonctions. It doesn't work directly under R due to some "translation" problems I guess. However I reckon that it would be a
2010 Apr 16
2
piecewise nls?
I am looking into fitting a so-called double von Bertalanffy function to fish length-at-age data. Attempting to simplify the situation, the model looks like this ... Y ~ f(X; a,b,c) if x < Z Y ~ g(X; a,d,e) if x >= Z where * f and g are non-linear functions (the "traditional" "single" von Bertalanffy growth function), * Y (length) and X (age) are observed variables,
2005 May 30
3
Piecewise Linear Regression
Hi, I need to fit a piecewise linear regression. x = c(6.25,6.25,12.50,12.50,18.75,25.00,25.00,25.00,31.25,31.25,37.50,37.50,50.00,50.00,62.50,62.50,75.00,75.00,75.00,100.00,100.00) y = c(0.328,0.395,0.321,0.239,0.282,0.230,0.273,0.347,0.211,0.210,0.259,0.186,0.301,0.270,0.252,0.247,0.277,0.229,0.225,0.168,0.202) there are two change points. so the fitted curve should look like \ \ /\
2012 Jun 05
1
Piecewise Lasso Regression
Hi All, I am trying to fit a piecewise lasso regression, but package Segmented does not work with Lars objects. Does any know of any package or implementation of piecewise lasso regression? Thanks, Lucas
2010 Apr 19
3
nls for piecewise linear regression not converging to least square
Hi R experts, I'm trying to use nls() for a piecewise linear regression with the first slope constrained to 0. There are 10 data points and when it does converge the second slope is almost always over estimated for some reason. I have many sets of these 10-point datasets that I need to do. The following segment of code is an example, and sorry for the overly precise numbers, they are just
2010 Jul 21
0
Piecewise regression using lme()
Hi everyone, I'm trying to fit a of piecewise regression model on a time series. The idea is to divide the series into segments and then to apply linear regression models on each segment but in a "global way" and considering heteroskedasticity between the segments. For example, I build a time series y with 3 segments: segment1=1:20+rnorm(20,0,2) segment2=20-2*1:30+rnorm(30,0,5)
2010 May 19
0
Piecewise nls w/ boundary as a fitting parameter
Hello, Fitting a piecewise smooth curve to a set of points (and a piecewise linear function in particular) seems to be a recurring question on this list. Nevertheless, I was not able to find an answer to a question that bothers me. Suppose I have the following data set, and would want to fit it with a piecewise smooth curve, In this model data, one curve is valid for up to 3 and another one for
2012 Mar 25
2
Simple question regarding domain restrictions/piecewise functions in R
I am a novice R user. I would like to be able to graph some simple piecewise functions/functions with domain restrictions in R, but I'm having trouble defining such functions. For example, I would like to define the following function: f(x)={x^2 if -1<x<x; 1 if 2<x<3} Notably, the function is undefined outside of domain (-1,1)U(2,3). My best attempt in R is something like
2007 May 08
1
Piecewise cubic Hermite interpolation
Which function implements the piecewise cubic Hermite interpolation? I am looking for equivalent of matlab's interp1 with the method = 'pchip' Here is the reference http://www.mathworks.com/access/helpdesk/help/techdoc/index.html?/access/helpdesk/help/techdoc/ref/interp1.html& -- View this message in context:
2007 Nov 14
0
Piecewise Linear Regression
Hi, Let me pick up this old thread. How does one extract the locations of the knots (ends of the segments) from the fit object below? Thanks, Vadim >From : roger koenker < roger_at_ysidro.econ.uiuc.edu > Date : Tue 31 May 2005 - 10:23:19 EST It is conventional to fit piecewise linear models by assuming Gaussian error and using least squares methods, but one can argue that
2011 Jul 06
0
Piecewise distribution function estimation with Generalized Pareto for tail
Hello all, I am trying to estimate the cumulative distribution function for a single stock return time series. A piecewise estimation is composed of three parts: parametric generalized Pareto (GP) for the lower tail (10% of the observation), non-parametric kernel-smoothed interior (80% of the observations), and GP for the upper tail (10%). I wonder if anyone has clue about this in R. The
2008 Mar 24
0
What is the correct model formula for the results of piecewise linear function?
Dear friends, I used the B-spline (degree=1) method to fit the piecewise linear function and the results are listed below. m.glm<-glm(mark~x+poly(elevation,2)+bs(distance,degree=1,knots=c(16.13,24)) +bs(y,degree=1,knots=c(-0.4357,-0.3202 )),family=binomial(logit),data=point) summary(m.glm) Coefficients: Estimate Std.