On Mon, 13 May 2002, Lauren Keim wrote:
> I'm hoping that someone here can solve a problem that none of the S-plus
> wizards in my lab can solve. I'm investigating gecko distribution at
> suburban/forest edges - the data I have consists of the presence/absence
> of geckos and distance from edge. Using likelihood methods, I am trying
> to fit a number of different models to the distribution of the geckos,
> one of which is a threshold model that takes this form:
>
> p = Z if x < (or equal to) T
> p = 0.05 if x>T
>
> p = probability that geckos are present.
> x = distance from the edge
> T= threshold distance
> Z = a constant value of p for distances less than the threshold distance
> (T)
>
> The value I am trying to find is the threshold distance (T) which gives
> me the smallest min neg log likelihood to be compared with the min neg
> log likelihood of other models (eg. GLMs). I've tried to find a way of
> doing this with the linear model function but couldn't get anything to
> work. I know that it is possible to fit a threshold model using the
Not surprisingly: it's not a linear model. You can write a function to
compute the - log likelihood and minimize it over T. (It's not clear to me
if Z is a parameter, but if it is, its MLE is simple given T so you can use
a profile likelihood.) However, the - log likelihood is not going to be a
smooth function of T (as I understand it it will be a piecewise-constant
function of T), so optimize() may have problems. I suggest you just plot
the function against T.
> 'solver' function in Excel so it seems very strange that it would not be
> possible in S-plus! If anyone has any ideas on how to do this (using
> s-plus 2000) I'd be very grateful if you could let me know (however I am
> very much an s-plus novice, so please keep your answers as simple as
> possible).
>
> Thanks,
>
> Lauren Keim
> Department of Zoology and Entomology
> University of Queensland
>
>
>
> --------------------------------------------------------------------
> This message was distributed by s-news@lists.biostat.wustl.edu. To
> unsubscribe send e-mail to s-news-request@lists.biostat.wustl.edu with
> the BODY of the message: unsubscribe s-news
>
--
Brian D. Ripley, ripley@stats.ox.ac.uk
Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel: +44 1865 272861 (self)
1 South Parks Road, +44 1865 272860 (secr)
Oxford OX1 3TG, UK Fax: +44 1865 272595
|