Loss function for the method of moments (type 1 discrete Weibull)
Usage
lossdw(par, x, zero = FALSE, eps = 1e-04, nmax=1000)
Arguments
par
vector of parameters $q$ and $\beta$
x
the vector of sample values
zero
TRUE, if the support contains $0$; FALSE otherwise
eps
error threshold for the numerical computation of the expected value
nmax
maximum value considered for the numerical computation of the expected value
Value
the value of the quadratic loss function
Details
The loss function is given by $L(x;q,\beta)=[m_1-\mathrm{E}(X;q,\beta)]^2+[m_2-\mathrm{E}(X^2;q,\beta)]^2$, where $\mathrm{E}(\cdot)$ denotes the expected value, $m_1$ and $m_2$ are the first and second order sample moments respectively.
x <- c(1,1,1,1,1,2,2,2,3,4)
lossdw(c(0.5, 1), x)
par <- estdweibull(x, "M") # parameter estimates derived by the method of momentspar
lossdw(par, x) # the loss is zero using these estimates