similar to: Non-linear Regression best-fit line

Displaying 20 results from an estimated 200 matches similar to: "Non-linear Regression best-fit line"

2008 Aug 18
1
"nested" getInitial calls; variable scoping problems
Hi All, Another nls related problem (for background, I'm migrating a complicated modelling package from S-plus to R). Below I've reduced this to the minimum necessary to demonstrate my problem (I think); the real situation is more complicated. Two similar selfStart functions, ssA and ssB. The 'initial' function for ssB modifies its arguments a little and then calls getInital
2005 Oct 26
1
help with a self-starting function in nonlinear least squares regression.
Hello. I am having a problem setting up a self-starting function for use in nonlinear regression (and eventually in the mixed model version). The function is a non-rectangular hyperbola - called "NRhyperbola" - which is used for fitting leaf photosynthetic rate to light intensity. It has one independent variable (Irr) and four parameters (theta, Am, alpha and Rd). I have created this
2002 May 02
2
a question
Hi, I have a program written in R which is good on the version 1.2, but for the fallowing versions of R, an error always is at the same place. That is at the level of the fallowing line: Sur<- getInitial(res2[m:M,2]~SSasymp(res2[m:M,1],Asymp,resp0,lrc),data=res2) Error in eval(expr,envir,enclos):numeric envir arg not of length one I don't know at all this langage for the instant.
2009 Jun 09
1
Non-linear regression/Quantile regression
Hi, I'm relatively new to R and need to do a quantile regression. Linear quantile regression works, but for my data I need some quadratic function. So I guess, I have to use a nonlinear quantile regression. I tried the example on the help page for nlrq with my data and it worked. But the example there was with a SSlogis model. Trying to write dat.nlrq <- nlrq(BM ~ I(Regen100^2),
2009 Oct 17
1
custom selfStart model works with getInitial but not nls
Hello, I'm having problems creating and using a selfStart model with nlme. Briefly, I've defined the model, a selfStart object, and then combined them to make a selfStart.default model. If I apply getInitial to the selfStart model, I get results. However, if I try usint it with nls or nlsList, these routines complain about a lack of initial conditions. If someone could point out
2009 Oct 22
1
Automatization of non-linear regression
Hi everybody, I'm using the method described here to make a linear regression: http://www.apsnet.org/education/advancedplantpath/topics/Rmodules/Doc1/05_Nonlinear_regression.html > ## Input the data that include the variables time, plant ID, and severity > time <- c(seq(0,10),seq(0,10),seq(0,10)) > plant <- c(rep(1,11),rep(2,11),rep(3,11)) > > ## Severity
2005 Sep 01
1
making self-starting function for nls
Hello. Following pages 342-347 of Pinheiro & Bates, I am trying to write a self-starting nonlinear function (a non-rectagular hyperbola) to be used in nonlinear least squares regression (and eventually for a mixed model). When I use the getInitial function for my self-starting function I get the following error message: > getInitial(photo~NRhyperbola(Irr,theta,Am,alpha,Rd),dat) Error
2005 Apr 23
1
start values for nls() that don't yield singular gradients?
I'm trying to fit a Gompertz sigmoid as follows: x <- c(15, 16, 17, 18, 19) # arbitrary example data here; y <- c(0.1, 1.8, 2.2, 2.6, 2.9) # actual data is similar gm <- nls(y ~ a+b*exp(-exp(-c*(x-d))), start=c(a=?, b=?, c=?, d=?)) I have been unable to properly set the starting value '?'s. All of my guesses yield either a "singular gradient" error if they
2008 Aug 29
1
nls() fails on a simple exponential fit, when lm() gets it right?
Dear R-help, Here's a simple example of nonlinear curve fitting where nls seems to get the answer wrong on a very simple exponential fit (my R version 2.7.2). Look at this code below for a very basic curve fit using nls to fit to (a) a logarithmic and (b) an exponential curve. I did the fits using self-start functions and I compared the results with a more simple fit using a straight lm()
2009 Jul 30
1
Continue to finish for loop even there is an error in one of rounds.
I am trying to fit a logistic model to my 10 year data (1999-2008) by year. Codes like below: Year <- c(1999: 2008) for(y in 1:length(year)) { file.input <- paste("C:\\", year[y], "\\data.csv", sep="") table <- read.csv(file=fileinput, header=TRUE, as.is=TRUE, na.strings=c("")) initial <- getInitial(percent ~ SSlogis(age, Asym,
2009 Jul 23
1
Network from package functions
Dear R-helpers, does anyone know of some package/function that can build a network from the functions that are implemented in a package, i.e. visualize the cross-references from one function to another in the same or some dependent package? An example would be a function like 'nls' on top of the hierarchy and then a network of nodes from the functions that are called within 'nls'
2006 Nov 10
1
help with nlme function
Hello. I am trying to fit a nonlinear mixed model involving 3 parameters. I have successfully made a self-starting function. getInitial() correctly outputs the initial estimates. I can also use the nlsList with this function to get the separate nonlinear fits by group. However, I get an error message when using the nlme function. Here is the relevent code:
2009 Oct 30
0
Interpreting gnls() output in comparison to nls()
Hi, I've been trying to work with the gnls() function in the "nlme" package. My decision to use gnls() was so that I could fit varPower and such to some of the data. However, in working with a small dataset, I've found that the results given by gnls() don't seem to make any sense and they differ substantially from those produced by nls(). I suspect that I am just
2008 Sep 26
0
The 'data' argument and scoping in nls
Hi Everyone, I seek guidance to avoid wasting a lot of time and doing things badly. Several times I've solved my problems, only to find that my solutions were clumsy and not robust. (see "nested" getInitial calls; variable scoping problems: Solved?? http://finzi.psych.upenn.edu/R/Rhelp02a/archive/139943.html for one truly horrible approach). I'm sure that I'm not the
2009 Nov 12
0
writing selfStart models that can deal with treatment effects
Hello, I'm trying to do some non-linear regression with 2 cell types and 4 tissue type treatments using selfStart models Following Ritz and Streibig (2009), I wrote the following routines: ##Selfstart expDecayAndConstantInflowModel <- function(Tb0, time, aL, aN, T0){ exp(-time*aL)*(T0*aL+(-1+exp(time * aL))*Tb0 * aN)/aL } expDecayAndConstantInflowModelInit <- function(mCall, LHS,
2008 Aug 04
0
Unexpected nls behaviour: Solved
Hi Everyone, I'd omitted the non-optional 'parameters' argument to selfStart. Making this change to SSbatch gives the same (successful) result from the two calls to nls. SSbatch<-selfStart( model=function(Batch, Coeffs) { Coeffs[Batch] } ,initial=function(mCall, data, LHS) { # Estimate coefficients as mean of each batch xy <- sortedXyData(mCall[["Batch"]],
2008 Aug 01
0
Unexpected nls behaviour
Hi everyone, I thought that for a selfStart function, these two should be exactly equivalent > nls(Aform, DF) > nls(Aform, DF, start=getInitial(Aform, DF)) but in this example that is not the case in R (although it is in S-plus V6.2) ------------------------------ SSbatch<-selfStart( model=function(Batch, Coeffs) { Coeffs[Batch] } ,initial=function(mCall, data, LHS) { # Estimate
2015 May 18
2
[LLVMdev] copy value of a global's data field to another global
getInitializer returns the complete initializer of the global. My globals are complex nested structs, from which I want to extract e.g. one double datafield. Example: >From a struct Stuct having double,array(3xint),float fields, I could extract the second int value using the index sequence 0,1,1 with getGetElementPtr. This gives me a constantPointer, but I would need to get a constInt...
2015 May 27
2
[LLVMdev] convert GetElemtPtr result to pointer on element?
Hi Tim, I forgot to say that I try to do all this in the LLVM API, not IR. I read in a bc'ed program and try to edit it using the API. Alex Tim Northover wrote: >> But I can not succeed in using the getGetElementPtr result in >> constructing an initalizer for another global value (which expects a >> ConstantFP* and not a ConstantExpr*). > > The result of a
2015 May 17
2
[LLVMdev] copy value of a global's data field to another global
Hi all, I can get access to the data stored in globals as follows: GlobalVariable* pGvarAct=_set_a_valid_global_; const_ptr_indicesVec=_the_indexes_ llvm::Constant* pConst; pConst=ConstantExpr::getGetElementPtr(pGvarAct, const_ptr_indicesVec); and e.g. use this to repalece an argumrnt of an instruction like: I->setOperand(someArgumentIndex,pConst); However, getGetElementPtr returns a