lossdiw {DiscreteInverseWeibull} | R Documentation |
Quadratic loss function for the method of moments
lossdiw(x, par, eps = 1e-04, nmax=1000)
x |
a vector of sample values |
par |
a vector of parameters ( |
eps |
a tolerance error for the computation of first order moments |
nmax |
a first maximum value for the computation of first order moments |
the value of the quadratic loss function L(x; q, \beta)=(E(X; q, \beta)-m_1)^2+(E(X^2; q, \beta)-m_2)^2
where m_1
and m_2
are the first and second order sample moments.
n<-100
q<-0.5
beta<-2.5
x<-rdiweibull(n, q, beta)
# loss function computed on the true values
lossdiw(x, c(q, beta))
par<-estdiweibull(x, method="M")
# estimates of the parameters through the method of moments
par
# loss function computed on the estimates derived through
# the method of moments
lossdiw(x, par)
# it should be zero (however, smaller than before...)