Description Usage Arguments Value See Also Examples
Quadratic loss function for the method of moments
1 |
x |
a vector of sample values |
par |
a vector of parameters (q and β) |
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, β)=(E(X; q, β)-m_1)^2+(E(X^2; q, β)-m_2)^2 where m_1 and m_2 are the first and second order sample moments.
1 2 3 4 5 6 7 8 9 10 11 12 13 | 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...)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.