Last data update: 2014.03.03

R: Sample estimation for the ADSL
estdlaplace2R Documentation

Sample estimation for the ADSL

Description

The function provides the point estimates for the parameters of the ASDL, resorting to four possible methods: method of moments, maximum likelihood method, method of proportion, modified method of moments. For details, please take a look at the references.

Usage

estdlaplace2(x, method = "M", err = 0.001, parml = c(exp(-1), exp(-1)))

Arguments

x

a vector of observations from the ADSL

method

M for the method of moments, ML for the maximum likelihood methods, P for the method of proportion, MM for the modified method of moments

err

a positive tolerance value, as small as possible, used in the definition of lower and upper bounds of the parameters p and q in the minimization algorithm utilized by the method of moments

parml

starting values for p and q in the optimization process for the maximum likelihood method

Value

a vector with the parameter estimates of p and q.

Author(s)

Alessandro Barbiero, Riccardo Inchingolo

References

A. Barbiero, An alternative discrete Laplace distribution, Statistical Methodology, 16: 47-67

See Also

dlaplacelike2

Examples

p <- 0.4
q <- 0.6
x <- rdlaplace2(n=100, p, q)
est <- matrix(0, 5, 2)
est[1,] <- c(p,q)
est[2,] <- estdlaplace2(x, method="M")
est[3,] <- estdlaplace2(x, method="ML")
est[4,] <- estdlaplace2(x, method="P")
est[5,] <- estdlaplace2(x, method="MM")
dimnames(est)[[1]]<-c("true","M","ML","P","MM")
dimnames(est)[[2]]<-c("p","q")
xlim <- c(min(est[,1])*.98,max(est[,1])*1.02)
ylim <- c(min(est[,2])*.98,max(est[,2])*1.02)
plot(est, pch=19, col=1:5, xlim=xlim, ylim=ylim)
text(est, dimnames(est)[[1]], pos=3, col=1:5, cex= .75)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(DiscreteLaplace)
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/DiscreteLaplace/estdlaplace2.Rd_%03d_medium.png", width=480, height=480)
> ### Name: estdlaplace2
> ### Title: Sample estimation for the ADSL
> ### Aliases: estdlaplace2
> ### Keywords: distribution,htest
> 
> ### ** Examples
> 
> p <- 0.4
> q <- 0.6
> x <- rdlaplace2(n=100, p, q)
> est <- matrix(0, 5, 2)
> est[1,] <- c(p,q)
> est[2,] <- estdlaplace2(x, method="M")
> est[3,] <- estdlaplace2(x, method="ML")
> est[4,] <- estdlaplace2(x, method="P")
> est[5,] <- estdlaplace2(x, method="MM")
> dimnames(est)[[1]]<-c("true","M","ML","P","MM")
> dimnames(est)[[2]]<-c("p","q")
> xlim <- c(min(est[,1])*.98,max(est[,1])*1.02)
> ylim <- c(min(est[,2])*.98,max(est[,2])*1.02)
> plot(est, pch=19, col=1:5, xlim=xlim, ylim=ylim)
> text(est, dimnames(est)[[1]], pos=3, col=1:5, cex= .75)
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>