npnorm: Distance-based non-parametric method with normal component.

Description Usage Arguments Details Value Examples

Description

Compute the non-parametric mixing distrbution

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
npnorm.sq(
  data,
  stdev = NULL,
  mix = NULL,
  order = FALSE,
  maxit = 100,
  tol = 1e-06
)

npnorm.cvm(
  data,
  stdev = NULL,
  mix = NULL,
  order = FALSE,
  maxit = 100,
  tol = 1e-06
)

npnorm.ad(
  data,
  stdev = NULL,
  mix = NULL,
  order = FALSE,
  maxit = 100,
  tol = 1e-06
)

Arguments

data

the vector of observation to compute the mixing distribution

stdev

the standard deviation of the component density

mix

the initial mixing distribution

order

the digit to round down the observations. If FALSE, no binning is performed.

maxit

the maximum iterations allowed.

tol

the tolerence. Stop if the directional derivative is less than tol

Details

This function uses the non-parametric method to compute the mixing distribution based on various losses

npnorm.sq computes the mixing distribution under squared error loss.

npnorm.cvm computes the mixing distribution under cramer-von Mises loss.

npnorm.ad computes the mixing distribution under Anderson-Darling loss.

Value

the nspmix object with ll meaning the loss.

Examples

1
2
3
4
5
6
7
data = rnorm(100, c(0, 2))
npnorm.sq(data)
npnorm.cvm(data)
npnorm.ad(data)
datalarge = rnorm(1e5, c(0, 2))
npnorm.cvm(datalarge, order = -2)
npnorm.ad(datalarge, order = -2)

xiangjiexue/npfixedcomp documentation built on June 15, 2020, 9:18 a.m.