Loss function

Share:

Description

Quadratic loss function for the method of moments

Usage

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

Arguments

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

Value

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.

See Also

Ediweibull

Examples

 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...)