1
$\begingroup$

I have a data set of tree diameters that do not include any measurements below a 7.5 due to the difficulty in identifying species when they are small. I want to run a Weibull regression that returns the parameters Shape & Scale that correspond to the forest stand rather than my truncated sample. For illustration purposes I have created a mock dataset in R with known parameters.

control <- rweibull(10000, shape = 1, scale = 10) #10000 Random Samples From A Weibull Dist W/ Shape =1 Scale =10
cutoff <- control[control > 7.5]  #Removing All Samples Less Than 7.5 to Mimic My Data

Using the function fitdistr from the package MASS for Maximum-likelihood fitting of univariate distributions yields undesirable parameters for the truncated data.

library(MASS)
fit_control <- fitdistr(control, "weibull")
fit_cutoff <- fitdistr(cutoff, "weibull")

Histograms

The regression worked well for the control data set, Shape ~ 1 and Scale ~ 10. However, things are obviously different with the truncated data set. I understand why but I am looking for a method to get similar values for the parameters from the truncated to describe the forest stand.

I attempted to create a truncated distribution of the Weibull for R to fit the data to by subtracting the cumulative distribution up to 7.5 from the density function.

Trunc_Weibull <- function(x, shape, scale, log = FALSE){
  dweibull(x, shape, scale, log)-pweibull(7.5, shape, scale, lower=FALSE) 
}
fit_truncated <- fitdistr(cutoff, Trunc_Weibull, start = list(shape=0.5, scale=0.5))

This yields closer results but still not the desired output. Shown below is the cutoff and control histograms with the results from the truncated regression of the cutoff dataset. Truncated

The desired output would be: Shape ~ 1 and Scale ~ 10.

$\endgroup$
0
$\begingroup$

The likelihood for the dataset will be $\mathcal{L} \left( \alpha , \beta \right) = \left( F_{\alpha \beta} \left( 7.5 \right)\right)^{i} \prod_{j=i+1}^{n} f_{\alpha \beta}\left( x_{j} \right) $ where $i$ of your $n$ data points are left censored and $F$ is the cumulative distribution function and $f$ the probability density function.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.