mmKDE: Moment matching for kernel density estimators.

Description Usage Arguments Value Methods (by class) Examples

Description

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

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
mmKDE(formula, data = list(), xin, type, ...)

## Default S3 method:
mmKDE(formula, data = list(), xin, type, ...)

## S3 method for class 'mmKDE'
print(x, ...)

## S3 method for class 'mmKDE'
summary(object, ...)

## S3 method for class 'summary.mmKDE'
print(x, ...)

## S3 method for class 'formula'
mmKDE(formula, data = list(), xin, type, ...)

## S3 method for class 'mmKDE'
predict(object, newdata = NULL, ...)

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.

x

An mmKDE object.

object

An mmKDE object.

newdata

The data on which the estimated model is to be fitted.

Value

A generic S3 object with class mmKDE.

mmKDE.default: A list with all components from optim, as well as:

summary.mmKDE: A list of class summary.mmKDE with the following components:

print.summary.mmKDE: The object passed to the function is returned invisibly.

predict.mmKDE: A vector of predicted values resulting from the estimated model.

Methods (by class)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
x <- 1:10
y <- x+rnorm(10)
XIn <- lm(y~x)
mmKDE.default(y~x, xin=coef(XIn), type=-1)

u <- 11:20
v <- u+rnorm(10)
XIn <- lm(y~x)
mom <- mmKDE(y~x, xin=coef(XIn), type=-1)
predict(mom, newdata=data.frame(y=v, x=u))

mtloots/alR documentation built on May 23, 2019, 8:18 a.m.