VN Regression

Share:

Description

Generates a nonlinear regression based on partial moment quadrant means.

Usage

1
2
3
4
5
VN.reg(x, y, order = NULL, s.t.n = 0.9, type = NULL, point.est = NULL,
  location = "top", return.values = TRUE, plot = TRUE,
  residual.plot = TRUE, threshold = 0, dep.order = NULL,
  precision = "LOW", n.best = 2, text = FALSE, noise.reduction = NULL,
  norm = NULL)

Arguments

x

Independent Variable(s)

y

Dependent Variable

order

Controls the number of partial moment quadrant means. Users are encouraged to try different order= integer settings with noise.reduction=NULL.

s.t.n

Signal to noise parameter, sets the threshold of VN.dep which reduces "order" when order=NULL. Defaults to 0.9 to ensure high dependence for higher "order" and endpoint determination.

type

To perform logistic regression, set to type = "LOGIT". To perform a classification, set to type = "CLASS". Defualts to NULL.

point.est

Returns the fitted value for any value of the independent variable. Use a vector of values for independent varaiables to return the multiple regression fitted value.

location

Sets the legend location within the plot

return.values

Defaults to TRUE, set to FALSE in order to avoid displaing all VALUE outputs.

plot

To plot regression or not. Defaults to TRUE.

residual.plot

To plot the fitted values of Y and Y. Defaults to TRUE.

threshold

Sets the correlation threshold for independent variables. Defaults to 0.

dep.order

Sets the internal order for VN.dep. Categorical variables typically require dep.order=1. Error message will alert user if this is the case.

precision

Increases speed of computation at the expense of precision. 3 settings offered: "LOW" (Default setting), "MED", and "HIGH". "HIGH" is the limit condition of every observation as a regression point.

n.best

Sets the number of nearest regression points to use in kernel weighting for multivariate regression. Defaults to 1.

text

If performing a text classification, set text=TRUE. Defaults to FALSE.

noise.reduction

In low signal:noise situations,noise.reduction="mean" uses means for VN.dep restricted partitions, noise.reduction="median" uses medians instead of means for VN.dep restricted partitions, while noise.reduction="mode" uses modes instead of means for VN.dep restricted partitions. noise.reduction=NULL (Default setting) allows for maximum possible fit and specific order specification.

norm

Normalizes regressors between 0 and 1 for multivariate regression when set to norm="std", or normalizes regressors according to VN.norm when set to norm="VN". Defaults to NULL.

Value

UNIVARIATE regression returns the values: "Fitted" for only the fitted values of the DV; "Fitted.xy" for a data frame of IV and fitted values; "derivative" for the coefficient of the IV and its applicable range; "Point" returns the IV point(s) being evaluated; "Point.est" for the predicted value generated; "regression.points" provides the points used in the regression equation for the given order of partitions; "R2" provides the goodness of fit.

MULTIVARIATE regression returns the values: "Fitted" for only the fitted values of the DV; "Fitted.xy" for a data frame of IV and fitted values; "regression.points" provides the points for each IV used in the regression equation for the given order of partitions; "rhs.partitions" returns the partition points for each IV; "partition" returns the DV, quadrant assigned to the observation and fitted value; "Point" returns the IV point(s) being evaluated; "Point.est" returns the predicted value generated; "equation" returns the synthetic X* dimension reduction equation.

Author(s)

Fred Viole, OVVO Financial Systems

References

Viole, F. and Nawrocki, D. (2013) "Nonlinear Nonparametric Statistics: Using Partial Moments" http://amzn.com/1490523995

Examples

 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
27
28
29
30
31
32
33
34
35
36
set.seed(123)
x<-rnorm(100); y<-rnorm(100)
VN.reg(x,y)

## Manual {order} selection
VN.reg(x,y,order=2)

## Maximum {order} selection
VN.reg(x,y,order='max')

## x-only paritioning (Univariate only)
VN.reg(x,y,type="XONLY")

## Logistic Regression (Univariate only)
VN.reg(x,y,type="LOGIT")

## For Multiple Regression:
x<-cbind(rnorm(100),rnorm(100),rnorm(100)); y<-rnorm(100)
VN.reg(x,y,point.est=c(.25,.5,.75))

## For Multiple Regression based on Synthetic X* (Dimension Reduction):
x<-cbind(rnorm(100),rnorm(100),rnorm(100)); y<-rnorm(100)
VN.reg(x,y,point.est=c(.25,.5,.75),type="CLASS")

## IRIS dataset example:
#Dimension Reduction:
VN.reg(iris[,1:4],iris[,5],type="CLASS",order=5,dep.order=1)
#Multiple Regression:
VN.reg(iris[,1:4],iris[,5],order=2)

## To call fitted values:
VN.reg(x,y)$Fitted

## To call partial derivative (univariate regression only):
x<-rnorm(100); y<-rnorm(100)
VN.reg(x,y)$derivative