[R] ML-Fit for truncated distributions

Peter Dalgaard p.dalgaard at biostat.ku.dk
Tue Feb 1 00:22:03 CET 2005


"Carsten Steinhoff" <carsten.steinhoff at stud.uni-goettingen.de> writes:

> Hello,
> 
>  
> 
> maybe that my Question is a "beginner"-Question, but up to now, my research
> didn't bring any useful result.
> 
>  
> 
> I'm trying to fit a distribution (e.g. lognormal) to a given set of data
> (ML-Estimation). I KNOW about my data that there is a truncation for all
> data below a well known threshold. Is there an R-solution for an
> ML-estimation for this kind of data-problem? As far as I've seen the
> "fitdistr" in package "MASS" doesn't solve this problem.
> 
>  
> 
> Thank you for any information!

Truncated or censored? (i.e. do you know that an observation is below
threshold or is such an observation just never seen?)

If it really is truncated, just use fitdistr on 

function(x,m,s) dlnorm(x, m, s) / plnorm(threshhold, m, s,
          lower.tail=FALSE)

if censored, use fitdistr on

function(x,m,s) ifelse(x > threshold, dlnorm(x, m, s),
                                      plnorm(threshhold, m, s)

[which, for the mathematically inclined, *is* a density w.r.t. the sum
of a continuous measure on a half-line and a point measure at the
threshold]

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)             FAX: (+45) 35327907




More information about the R-help mailing list