compute_scale_par: Compute scale parameter for error in kdde

Description Usage Arguments Details Value Author(s) Examples

Description

This function computes the maximum likelihood estimator of the standard deviation for the error distribution provided as long as this error is normal or Laplace and the sample is either a sample or errors or a sample of differences of errors (which arises in panel data).

Usage

1
compute_scale_par(error_dist, error_smp, k, error_scale_par = NULL)

Arguments

error_dist

An integer specifying the error distribution: 1 if non-parametric, 2 if Laplace, 3 if normal.

error_smp

Vector of sample of errors or differences of errors.

k

An integer specifying what is being provided as sample of errors: '1' for pure sample of errors and otherwise for differences of errors.

error_scale_par

NULL by default. It is is given, the function does nothing but return this value.

Details

This function also computes the standard deviation when the error is approximated with the empirical characteristic function, since it is useful for bandwidth selection.

Value

The (positive) standard deviation

Author(s)

Guillermo Basulto-Elias

Examples

1
2
3
4
## Difference of Laplace errors is provided:
sigma <- 5
smp <- rlaplace(n = 100, sd = sigma) - rlaplace(n = 100, sd = sigma)
kerdec:::compute_scale_par(2, smp, 2)

gbasulto/kerdec documentation built on June 5, 2019, 10:58 a.m.