Learn R Programming

alR (version 2.2.0)

mmKDEshort: Moment matching for kernel density estimators.

Description

Estimate parameters of a linear model by matching the moments of kernel density estimators.

Usage

mmKDEshort(formula, data = list(), xin, type, ...)

Arguments

formula

An LHS ~ RHS formula, specifying the linear model to be estimated.

data

A data.frame which contains the variables in formula.

xin

Numeric vector of length equal to the number of independent variables, of initial values, for the parameters to be estimated.

type

An integer specifying the bandwidth selection method used, see bw.

...

Arguments to be passed on to the control argument of the optim function.

Value

mmKDEshort: A list with the following components:

  • coefficients: A vector of estimated coefficients.

  • error: The value of the objective function.

Details

A shortened version of mmKDE.

Examples

Run this code
# NOT RUN {
x <- 1:10
y <- x+rnorm(10)
XIn <- lm(y~x)
mmKDEshort(y~x, xin=coef(XIn), type=-1)

# }

Run the code above in your browser using DataLab