--- title: "Fitting the the two-parameter Weibull Distribution" # author: "Fatih Kızılaslan" # date: "`r format(Sys.time(), '%B %d, %Y')`" output: rmarkdown::html_vignette vignette: > %\VignetteIndexEntry{Fitting the two-parameter Weibull Distribution} %\VignetteEngine{knitr::rmarkdown} %\VignetteEncoding{UTF-8} --- ```{r setup, include = FALSE} knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.width = 6, fig.height = 4 ) ``` ## Introduction This vignette presents the `fitWD()` function, which is used to estimate the parameters of the two-parameter Weibull Distribution (WD) using several estimation methods, including maximum likelihood (ML), least squares (LS), weighted least squares (WLS), and maximum product of spacings (MPS). A random variable $X$ is said to follow a two-parameter WD its cumulative distribution function (CDF) and probability density function (PDF) are given by $$ F(x) = 1- e^{-a x^b}, $$ and $$ f(x) = a b x^{b-1} e^{-a x^b}, $$ where $x>0$, $a>0$ is the scale parameter and $b > 0$ is a shape parameter. ### Estimation methods Let a random sample from $X \sim WD(a, b)$ are observed as $x_i, \; i=1,\dots, n$. For all estimation methods, optimization is performed using `stats::optim`. - **Maximum Likelihood Estimation (MLE)** The MLEs are obtained by maximizing the log-likelihood function: $$ \ell(a,b; \mathbf{x}) = \sum_{i=1}^{n} \log \big( a b x_i^{b-1} \big) -a \sum_{i=1}^{n} x_i^b. $$ - **Least Squares Estimation (LSE)** The LSE is obtained by minimizing the squared differences between the theoretical and empirical CDF values at the ordered sample points. Let $x_{(1)}