Displaying 20 results from an estimated 22 matches for "linf".
Did you mean:
line
2006 May 24
1
problem-nlme
...ctions,
wich were entered by me.
Unfortunately for no it was arrived at the
convergence, several error messages appeared.
I am going to display the growth functions so as they
were entered and a "nlme" call example:
# differents growth function
#vonBertlalanffy
vonBert<- function(x, Linf, K, t0)
Linf*(1-exp(-K*(x-t0)))
size ~ vonBert(age, Linf, K,t0)
vonBert <-deriv(~ Linf*(1-exp(-K*(x-t0))),
c("Linf","K","t0"),function(x,Linf,K,t0){})
vonBertInit <- function(mCall, LHS, data)
{
xy <- sortedXyData(mCall[["x"]], LHS, data...
2006 Jan 27
1
how calculation degrees freedom
Hi, I' m having a hard time understanding the computation of degrees of freedom when runing nlme() on the following model:
> formula(my data.gd)
dLt ~ Lt | ID
TasavB<- function(Lt, Linf, K) (K*(Linf-Lt))
my model.nlme <- nlme (dLt ~ TasavB(Lt, Linf, K),
data = my data.gd,
fixed = list(Linf ~ 1, K ~ 1),
start = list(fixed = c(70, 0.4)),
na.action= na.include, naPattern = ~!is.na(dLt))
> summary(my model.nlme)
Nonlinear mixed-effects model fit by maximum l...
2001 Sep 07
3
fitting models with gnls
Dear R-list members,
Some months ago I wrote a message on the usage of gnls (nlme library) and here I come again.
Let me give an example:
I have a 10 year length-at-age data set of 10 fishes (see growth.dat at the end of this message) and I want to fit a von Bertalanffy growth model, Li= Linf*(1-exp(-k*(ti-t0))) where Li = length at age i, Linf= asymptotic length, k= curvature parameter, ti= age i, and t0= age of length 0.
I'd solved the problem using nls but the points are not independent. The length-at-age data are correlated for each fish because I'm following the growth his...
2007 Jun 14
1
R programming question
Dear All.,
I've created R-code for which a user will be asked to choose between 2
analyses. I've written one function for each type of analysis. Within
each function, the users is prompted to enter information. An example
is:
cat("Enter value for lower Linf :\n")
L1<-scan(n=1)
cat("Enter value for upper Linf :\n")
L2<-scan(n=1)
cat("Enter Linf interval :\n")
int_L<-scan(n=1)
cat("Enter value for lower K :\n")
K1<-scan(n=1)
cat("Enter value for upper K :\n"...
2012 Sep 10
0
More help need on Von Bertalanffy Growth Curves
...attach(BLG)
names(BLG)
dput(BLG,"")
$ Von Bertalanffy Growth Model$
source("http://www.rforge.net/NCStats/InstallNCStats.R")
source("http://www.rforge.net/FSA/InstallFSA.R")
library(FSA)
library(NCStats)
library(nlstools)
# provide starting values
svCom <- list(Linf=199.8132, K=0.5631745, t0=-1.960147)
svCom <- vbStarts(Length~Age,data=BLG)
# repeat the starting values for each Cohort
svGen <- lapply(svCom, rep, length(unique(Cohort)))
# define a new variable, uniquely numbered for each Cohort
Cohortf <- as.factor(Cohort)
# fit a single model with...
2006 Jan 26
0
degrees freedom in nlme
I'm having hard time understanding the computation of degrees of freedom when runing nlme () on the following model:
> formula(my data.gd)
dLt ~ Lt | ID
TasavB<- function(Lt, Linf, K) (K*(Linf-Lt))
my model.nlme <- nlme (dLt ~ TasavB(Lt, Linf, K),
data = my data.gd,
fixed = list(Linf ~ 1, K ~ 1),
start = list(fixed = c(70, 0.4)),
na.action= na.include, naPattern = ~!is.na(dLt))
> summary(my model.nlme)
Nonlinear mixed-effects model fit by maximum l...
2008 Feb 26
0
NLS -- multiplicative errors and group comparison
...19 obs. of 5 variables:
$ age: num 1.27 2.25 2.25 2.25 2.25 ...
$ tl : num 226 208 226 226 234 ...
$ sex: Factor w/ 2 levels "female","male": 1 1 1 1 1 1 1 1 1 1 ...
$ Gf : num 1 1 1 1 1 1 1 1 1 1 ...
$ Gm : num 0 0 0 0 0 0 0 0 0 0 ...
# starting values
> sLinf <- 405
> sK <- 0.11
> sto <- -5.2
> svb <- list(Linf=sLinf,K=sK,to=sto)
# Fit the additive error structure model to both groups combined
> vbla <- nls(tl~Linf*(1-exp(-K*(age-to))),start=svb,data=fwd)
> summary(vbl1)
Formula: tl ~ Linf * (1 - exp(-K * (age...
2008 Jun 10
3
newbie nls question
I'm tyring to fit a relatively simple nls model to some data, but keep coming up against the same error (code follows):
Oto=nls(Otolith ~ Linf*(1-exp(-k(AGE-to))),
data = ages,
start = list(Linf=1000, k=0.1, to=0.1),
trace = TRUE)
The error message I keep getting is "Error in eval(expr, envir, enclos) : could not find function "k"". I've used this line of code for other nls models (with different...
2008 Aug 01
1
Confidence intervals with nls()
I have data that looks like
O.lengthO.age
176 1
179 1
182 1
...
493 5
494 5
514 5
606 5
462 6
491 6
537 6
553 6
432 7
522 7
625 8
661 8
687 10
704 10
615 12
(truncated)
with a simple VonB growth model from within nls():
plot(O.length~O.age, data=OS)
Oto = nls(O.length~Linf*(1-exp(-k*(O.age-t0))), data=OS,
start=list(Linf=1000, k=0.1, t0=0.1), trace=TRUE)
mod <- seq(0, 12)
mod=seq(1,12, by=0.001)
lines(mod, predict(Oto, list(O.age = mod)))
I'm trying to put 95% confidence intervals...
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, pch=19, xlab="Age (yr)", ylab="Total length (mm)")
#Incorporates the model VonB onto the called scatterplot
mod1a=seq(2, 11, by=0.001)
line...
2010 Sep 29
2
fitting model to resampled data
...growth model
into the three new datasets to estimate growth parameters. Since there are
now three new datasets I want to get three new estimates of the growth
parameters, essentially one from each new dataset.
I am using the von Bertalanffy growth model. Here is my code:
par<-list(Linf=700, K=0.20, to=-0.1)
#these are the starting values for parameters
vb<-nls(Length~Linf*(1-exp(-K*(Age-to))), start=par, data=???) #this is
the growth model with the parameters estimated with non linear least
squares (nls)
I tried placing my resampling function the data part of the...
2001 Jun 01
1
nls works but not gnls
This works fine:
fit42<-nls(Vfs~SSlogis(Months,Asym.Int+Asym.Group*Groupdum,xmid,scal),
data=df,
start=c(Asym.Int=22,Asym.Group=5,xmid=2,scal=6),
na.action=na.omit)
But this, identical except using gnls, doesn't converge:
fit43<-gnls(Vfs~SSlogis(Months,Asym.Int+Asym.Group*Groupdum,xmid,scal),
data=df,
start=c(Asym.Int=22,Asym.Group=5,xmid=2,scal=6),
na.action=na.omit)
Error in gnls(Vfs
2003 Jun 20
1
Power Law Exponents
...rstly:
> barplot(rev(sort(table(lin))))
which gives me a Pareto chart which I think is related to the power law
distribution.
However, I specifically want a log-log chart of the in-degree against
frequency with a fitted line whose slope is the exponent.
Thus, I devised the following:
> linf <- as.data.frame.table((table(lin)),mode="numeric")
> linx = as.vector(linf$lin, mode="numeric")
> liny = as.vector(linf$Freq, mode="numeric")
> plot(linx, liny, pch=3, log="xy",main="Log-log", xlab="Indegree",
ylab="Frequ...
2006 Feb 02
1
Significance of degrees of freedom in nlme
Dear Dr. Bates,
Thank you very much for your response. I had consulted
the algorithm described in Pinheiro and Bates.
However, what I don't understand (among other things)
is why my two parameters appear to be estimated at
different grouping levels (based on the DF values).
Affect this different values of DF at the estimates
parameters? The estimates fixed effects were get at
the same level of
2003 Jun 02
1
Help - Curvature measures of nonlinearity
Dear colleagues,
Von Bertalanffy model is commonly adjust to data on fish length (TL) and age (AGE)
TL= Linf*(1-exp(-K*(AGE-t0)). Linf, K and t0 are parameters of the model.
One main goal of the growth study is the comparison of growth parameter estimates between sexes of the same species, or estimates from different populations.
The realibility statistical tests normally applied are highly dependent on...
2010 Sep 30
1
getting the output after bootstraping
...model to it. Thanks for all your help.
Everything worked out well, but I am having a difficult time getting the new
parameter values. I bootstrapped the data 300 times and I want to get the
300 sets of parameter estimates and plot them in Excel.
Here is my code:
par<-list(Linf=700, K=0.3, to=-0.1) #starting
values for parameter estimates
vb<-nls(length~Linf*(1-exp(-K*(age-to))), start=par, data=small) #von
Bertalanffy growth mode
boo<- nlsBoot(vb, niter=300) #This
bootstraps my data 300 times and...
2012 Sep 04
3
Comparing Von Bertalanffy Growth Curves
..., class = "data.frame", row.names = c(NA, -37L))
?
In case it's helpful here is all my code before this point:
str(LMB)
MMi=as.integer(MM)
Yearf=as.factor(Year)
Agei=as.integer(Age)
( svCom <- vbStarts(MMi~Agei,data=LMB))
( svGen <- lapply(svCom,rep,2) )
vbGen <- MMi~Linf[Yearf]*(1-exp(-K[Yearf]*(Age-t0[Yearf]))+error)
fitGen <- nls(vbGen,data=LMB,start=svGen)
?
Thank you, April
2012 Mar 10
1
Draw values from multiple data sets as inputs to a Monte-Carlo function; then apply across entire matrix
...bles
I read in above.
For example, 3.5 would be cell (i,j) in the Poultry MEAN density table;
0.108 would be cell (i,j) in the Poultry STDEV table; and 47 the single
estimate for cell (i,j) of the Wild bird density table.
Poultry <- mcstoc(rnorm, type="U", 3.5, 0.108, rtrunc=TRUE, linf=0)
Wild <- mcstoc(rtriang, type="U", min=0, mode=47, max=75)
Risk <- Poultry * Wild #this is the risk function the MC is applied
to
Questions:
1) How can I edit the Poultry and Wild variables above to read the data
values directly from the 3 input tables (i.e., replacing 3...
2004 Jul 27
1
Integration with "adapt"
Hi all,
I need to calculate a multidimensional integration on R. I am using the
command "adapt" (from library adapt), although sometimes I get the
following error message:
Ifail=2, lenwrk was too small. -- fix adapt() !
Check the returned relerr! in: adapt(3, linf, lsup, functn = Integrando1)
I guess it happens because the domain of integration is too small,
although I tried a change of variables to avoid this problem and it didn?t
help. The command adapt calls a fortran routine, but I don?t know fortran
enough to fix the problem.
Can someone help me?
Thank...
2009 Sep 14
1
Error: C stack usage is too close to the limit
R-help,
I 'm trying to optimize a model to data using log-likelihoods
but I encounter the following error message:
> l= c(49.4, 57.7,64.8,70.9,78.7,86.6,88.3,91.6,99,115)
> t=3:12
> fn <- function(params, l=l, t=t) {
Linf <- params[1]
k <- params[2]
t0 <- params[3]
sigma <- params[4]
lhat <- params[1]*(1-exp(-params[2]*(t-params[3])))
logL <- -sum(dnorm(log(l),log(lhat),sqrt(sigma),TRUE))
return(logL)...