Displaying 20 results from an estimated 5000 matches similar to: "piecewise nls?"
2010 Sep 19
3
Repeating values in a list
I have a list that looks like this ...
> have <- list(a=7,b=3,c=1)
> have
$a
[1] 7
$b
[1] 3
$c
[1] 1
and I want to have a simple way to change it to the following without re-typing the values ...
> desire <- list(a=c(7,7),b=c(3,3),c=c(1,1))
> desire
$a
[1] 7 7
$b
[1] 3 3
$c
[1] 1 1
In other words, I need to create the list in desire from the list in have.
In my
2009 May 08
1
Citing R/Packages Question
I used R and the quantreg package in a manuscript that is currently in
the proofs stage. I cited both R and quantreg as suggested by
citation() and noted the version of R and quantreg that I used in the
main text as
"All tests were computed with the R v2.9.0 statistical programming
language (R Development Core 2008). Quantile regressions were conducted
with the quantreg v4.27 package
2009 Apr 20
2
plotCI (plotrix) problem
I am attempting to create a plot with intervals "stretched" in the
x-direction using plotCI() in the plotrix package. The same data
provides an appropriate set of intervals when "stretched" in the
y-direction but I only get a lower interval when "stretched" in the
x-direction.
The data are as follows
mns <-
2009 Jan 23
3
Table Modification
I am trying to construct a two-way table where, instead of printing the
two-way frequencies in the table, I would like to print the values of a
third variable that correspond to the frequencies.
For example, the following is easily constructed in R
> fact1 <- factor(sample(LETTERS[1:3],10,replace=TRUE))
> fact2 <- factor(sample(LETTERS[25:26],10,replace=TRUE))
> fact3
2010 Aug 10
4
Function to Define a Function
I am trying to define a general R function that has a function as the output that depends on the user's input arguments (this may make more sense by looking at the toy example below). My real use for this type of code is to allow a user to choose from many parameterizations of the same general model.
My "issue" is that when I compile a package with this type of code in it I get a
2009 Apr 04
2
help with formula and data= argument
Sorry for posting this twice, but I still have not solved this problem
and am hoping for some assistance.
I am attempting to write a function that is flexible enough to respond
to the user providing a formula (with a data= argument) or not (similar
to plot(x,y) versus plot(y~x,data=data)). I have found a method to work
with this in a simple case but am having trouble determining how to
2010 Jun 26
4
optim() not finding optimal values
I am trying to use optim() to minimize a sum-of-squared deviations function based upon four parameters. The basic function is defined as ...
SPsse <- function(par,B,CPE,SSE.only=TRUE) {
n <- length(B) # get number of years of data
B0 <- par["B0"] # isolate B0 parameter
K <- par["K"]
2009 Apr 29
1
RweaveHTML (R2HTML) Help
I have found Sweave() to be great for producing PDF documents. I have
been experimenting with RweaveHTML (from the R2HTML) package and have
had moderate success. My main issue has been that I simply want the R
output to be shown verbatim in the HTML document but RweaveHTML tends to
convert most output to a table, for example. So, is there a way to
force the RweaveHTML driver to simply provide
2011 Feb 08
4
Interactions in a nls model
I am interested in testing two similar nls models to determine if the
lines are statistically different when fitted with two different data
sets; one corn, another soybean. I know I can do this in linear models
by testing for interactions. See Introductory Statistics with R by
Dallgaard p212-218 for an example. I have two different data sets I am
comparing to lai. ci.re should have very
2008 Sep 02
2
nls.control()
All -
I have data:
TL age
388 4
418 4
438 4
428 5
539 10
432 4
444 7
421 4
438 4
419 4
463 6
423 4
...
[truncated]
and I'm trying to fit a simple Von Bertalanffy growth curve with program:
#Creates a Von Bertalanffy growth model
VonB=nls(TL~Linf*(1-exp(-k*(age-t0))), data=box5.4,
start=list(Linf=1000, k=0.1, t0=0.1), trace=TRUE)
#Scatterplot of the data
plot(TL~age, data=box5.4,
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
2007 Sep 27
5
New R website: R-Cookbook.com
R Community,
I've put together a website that I thought this mailing list might be
interested in: http://www.r-cookbook.com
It's a (free) community-driven content management system for R
"recipes", or working examples. Some of the features of the site are
code highlighting, recipe ratings, recipe comments, personal "recipe
boxes" to save your favorite
2003 May 08
1
nls, restrict parameter values
Hi,
I posted a question (bellow) a few weeks ago and had a reply (thanks
Christian) that partly solves the problem, but I still would like to be able
to restrict some of the independent variables in a nls model to be always
>0, (is there a way to do it)??
Thanks,
Angel
>From: "Christian Ritz" <ritz at dina.kvl.dk>
>To: "Angel -" <angel_lul at
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 Feb 16
1
nls.lm & AIC
Hi there,
I'm a PhD student investigating growth patterns in fish. I've been using the minpack.lm package to fit extended von Bertalanffy growth models that include explanatory covariates (temperature and density). I found the nls.lm comand a powerful tool to fit models with a lot of parameters. However, in order to select the best model over the possible candidates (without covariates,
2010 Sep 29
2
fitting model to resampled data
I apologize if this comes across as confusing. I will try to explain my
situation as best I can.
I have R bootstrapping my growth data for fish. It's resampling my database
of age and length data and then produces several new datasets for me. In
this case, it's resampling my data to create three new datasets of age and
length data. Here is my code with my original data called
2011 Mar 20
1
Finding Imported Packages
Is there a function similar to pkgDepends() that returns the packages that a particular package imports or imports from? I believe I can get this information from the matrix returned from installed.packages() but something like pkgDepends() would be more convenient.
I did not find anything useful in my search of the R-help archives (my search string may have been poorly chosen), my use of
2011 Apr 20
1
How can I 'predict' from an nls model with a fit specified for separate groups?
Following an example on p 111 in 'Nonlinear Regression with R' by Ritz &
Streibig, I have been fitting nls models using square brackets with the
grouping variable inside. In their book is this example, in which
'state' is a factor indicating whether a treatment has been used or not:
> Puromycin.m1 <- nls(rate ~ Vm[state] *
+ conc/(K[state] + conc), data = Puromycin,
2009 Feb 03
3
non linear regression with nls
Hello,
I'm a beginner with R and it's the first time I'm using the R-help list... I hope I'm in the right place, if not:
Sorry!!
I need to do non linear regressions on a data set which columns are:
"river.name" "Portata" "PTG.P" "PO4.P" "NT.N" "NH4.N" "NO3.N" "BOD5" "SiO2"
2005 Jan 27
3
weighting in nls
I'm fitting nonlinear functions to some growth data but I'm getting radically different results in R to another program (Prism). Furthermore the values from the other program give a better fit and seem more realistic. I think there is a problem with the results from the r nls function. The differences only occur with weighted data so I think I'm making a mistake in the weighting.