Re: [R] Using optim function for logistic model simulation

2010-04-26 Thread Charlotte Chang
Great! Thank you for your help! -Charlotte >> >> On Mon, Apr 26, 2010 at 1:12 AM, Tal Galili wrote: >>> >>> mm... >>> I also noticed the function you wrote didn't use parenthesis, mixed b and c >>> and used different names for K. >>> Your code is a great exercise in debugging  (no offense inte

Re: [R] Using optim function for logistic model simulation

2010-04-26 Thread Tal Galili
mm... I also noticed the function you wrote didn't use parenthesis, mixed b and c and used different names for K. Your code is a great exercise in debugging (no offense intended :) ) Try using: bird<-bird.density[0] # I assume this exists eqn<- function(K1, b1 = 1.22, c1 = .55) {

Re: [R] Using optim function for logistic model simulation

2010-04-26 Thread Tal Galili
Hi Charlotte , I can't reproduce your code, but skimming through it - It would appear that: 1) in eqn1<- function(K1, bird) you didn't define "bird" (you did define it before the function, so I'd suggest just removing it from the function call like this: eqn1<- function(K1) 2) you didn't "return"

[R] Using optim function for logistic model simulation

2010-04-25 Thread Charlotte Chang
Hello! I'm a college undergrad desperately trying to finish up my thesis. I have a dataset on the distribution of a grassland bird from the Breeding Bird Survey. I have a very straightforward and simple version of the logistic growth model to describe changes in this bird's abundance over time. Th