alKDE: Arc length matching for kernel density estimators.

Description Usage Arguments Value Methods (by class) Examples

View source: R/alKDE.R

Description

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

Usage

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

## Default S3 method:
alKDE(formula, data = list(), xin, q1, q2, type, ...)

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

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

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

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

## S3 method for class 'alKDE'
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.

q1, q2

Numeric vectors, for the lower and upper bounds of the intervals over which arc lengths are to be computed.

type

An integer specifying the bandwidth selection method, see bw.

...

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

x

An alKDE object.

object

An alKDE object.

newdata

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

Value

A generic S3 object with class alKDE.

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

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

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

predict.alKDE: 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)
alKDE(y~x, xin=coef(XIn), q1=c(0.025,0.5), q2=c(0.5,0.975), type=-1)

u <- 11:20
v <- u+rnorm(10)
XIn <- lm(y~x)
al <- alKDE(y~x, xin=coef(XIn), q1=c(0.025,0.5), q2=c(0.5,0.975), type=-1)
predict(al, newdata=data.frame(y=v, x=u))

alR documentation built on Dec. 7, 2017, 5:03 p.m.

Related to alKDE in alR...