lossdiw function

Loss function

Loss function

Quadratic loss function for the method of moments

lossdiw(x, par, eps = 1e-04, nmax=1000)

Arguments

  • x: a vector of sample values
  • par: a vector of parameters (qq and β\beta)
  • eps: a tolerance error for the computation of first order moments
  • nmax: a first maximum value for the computation of first order moments

Returns

the value of the quadratic loss function L(x;q,β)=(E(X;q,β)m1)2+(E(X2;q,β)m2)2L(x; q, \beta)=(E(X; q, \beta)-m_1)^2+(E(X^2; q, \beta)-m_2)^2 where m1m_1 and m2m_2 are the first and second order sample moments.

See Also

Ediweibull

Examples

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...)
  • Maintainer: Alessandro Barbiero
  • License: GPL
  • Last published: 2016-05-01

Useful links