[R] gnlr3 location parameter

Prof Brian Ripley ripley at stats.ox.ac.uk
Fri Apr 15 10:39:56 CEST 2005


I believe what Jim Lindsey's code does is to directly maximize the 
log-likelihood.  Why not write down the log-likelihood for your problem 
and maximize it? You may be able to use the functions in package stats4 to 
provide a structure, or you can copy examples like fitdistr and polr in 
MASS.

Just be a little careful: you have omitted the ranges on your expressions, 
but is it not y > 0 for (1) and y > u for (2, corrected)?  If so you will 
need to use bound-constrained optimization and worry about having a 
non-standard inference problem.

Prof Lindsey chooses not to submit his code to CRAN (nor even keep it that 
at a stable URL).  As a result, few people here know about his packages 
and you would do better to ask him directly for support.

On Fri, 15 Apr 2005, Arnout Standaert wrote:

> Hi list,
>
> my previous question was obviously too basic to deserve an answer - apologies 
> for that. I'm learning, things can only get better :-)
>
> My current problem is with fitting a generalized gamma distribution with an 
> additional "shift" parameter, that represents a shift of the distribution 
> along the X axis.
>
> The gnlr3 function (in Jim Lindsey's GNLM package) fits this distribution in 
> this form:
>
> f(y) = fy^(f-1)/((m/s)^(fs) Gamma(s)) y^(f(s-1)) exp(-(y s/m)^f)
> (1)
>
> I would like to include a fourth parameter, say u, like this:
>
> f(y) = fy^(f-1)/((m/s)^(fs) Gamma(s)) (y-u)^(f(s-1)) exp(-((y-u) s/m)^f)
> (2)

Is that right?  Did you mean (y-u) near the front?

> My best idea so far is to iteratively fit expression (1), each time shifting 
> the data with an amount u. Plotting the maximum likelihood of the fit against 
> u should give me an idea of where the optimum value for u is. Of course, this 
> procedure will take quite some time, and will not be very straightforward 
> since the generalized gamma shows convergence problems without good initial 
> estimates...
>
> Any suggestions for a better approach?
>
> Thanks in advance,
> Arnout
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>

-- 
Brian D. Ripley,                  ripley at 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 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595




More information about the R-help mailing list