Description Usage Arguments Value Note Author(s) References Examples
Generates a nonlinear regression based on partial moment quadrant means.
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  NNS.reg(
x,
y,
factor.2.dummy = TRUE,
order = NULL,
stn = 0.95,
dim.red.method = NULL,
tau = NULL,
type = NULL,
point.est = NULL,
location = "top",
return.values = TRUE,
plot = TRUE,
plot.regions = FALSE,
residual.plot = TRUE,
std.errors = FALSE,
confidence.interval = NULL,
threshold = 0,
n.best = NULL,
noise.reduction = "off",
dist = "L2",
ncores = NULL,
point.only = FALSE,
multivariate.call = FALSE
)

x 
a vector, matrix or data frame of variables of numeric or factor data types. 
y 
a numeric or factor vector with compatible dimensions to 
factor.2.dummy 
logical; 
order 
integer; Controls the number of partial moment quadrant means. Users are encouraged to try different 
stn 
numeric [0, 1]; Signal to noise parameter, sets the threshold of 
dim.red.method 
options: ("cor", "NNS.dep", "NNS.caus", "all", 
tau 
options("ts", NULL); 
type 

point.est 
a numeric or factor vector with compatible dimensions to 
location 
Sets the legend location within the plot, per the 
return.values 
logical; 
plot 
logical; 
plot.regions 
logical; 
residual.plot 
logical; 
std.errors 
logical; 
confidence.interval 
numeric [0, 1]; 
threshold 
numeric [0, 1]; 
n.best 
integer; 
noise.reduction 
the method of determining regression points options: ("mean", "median", "mode", "off"); In low signal:noise situations, 
dist 
options:("L1", "L2", "DTW", "FACTOR") the method of distance calculation; Selects the distance calculation used. 
ncores 
integer; value specifying the number of cores to be used in the parallelized procedure. If NULL (default), the number of cores to be used is equal to the number of cores of the machine  1. 
point.only 
Internal argument for abbreviated output. 
multivariate.call 
Internal argument for multivariate regressions. 
UNIVARIATE REGRESSION RETURNS THE FOLLOWING VALUES:
"R2"
provides the goodness of fit;
"SE"
returns the overall standard error of the estimate between y
and y.hat
;
"Prediction.Accuracy"
returns the correct rounded "Point.est"
used in classifications versus the categorical y
;
"derivative"
for the coefficient of the x
and its applicable range;
"Point.est"
for the predicted value generated;
"regression.points"
provides the points used in the regression equation for the given order of partitions;
"Fitted.xy"
returns a data.table of x
, y
, y.hat
, resid
, NNS.ID
, gradient
;
MULTIVARIATE REGRESSION RETURNS THE FOLLOWING VALUES:
"R2"
provides the goodness of fit;
"equation"
returns the numerator of the synthetic X* dimension reduction equation as a data.table consisting of regressor and its coefficient. Denominator is simply the length of all coefficients > 0, returned in last row of equation
data.table.
"x.star"
returns the synthetic X* as a vector;
"rhs.partitions"
returns the partition points for each regressor x
;
"RPM"
provides the Regression Point Matrix, the points for each x
used in the regression equation for the given order of partitions;
"Point.est"
returns the predicted value generated;
"Fitted.xy"
returns a data.table of x
,y
, y.hat
, gradient
, and NNS.ID
.
Please ensure point.est
is of compatible dimensions to x
, error message will ensue if not compatible.
Like a logistic regression, the (type = "CLASS")
setting is not necessary for target variable of two classes e.g. [0, 1]. The response variable base category should be 1 for classification problems.
For low signal:noise instances, increasing the dimension may yield better results using NNS.stack(cbind(x,x), y, method = 1, ...)
.
Fred Viole, OVVO Financial Systems
Viole, F. and Nawrocki, D. (2013) "Nonlinear Nonparametric Statistics: Using Partial Moments" https://www.amazon.com/dp/1490523995/ref=cm_sw_su_dp
Vinod, H. and Viole, F. (2017) "Nonparametric Regression Using Clusters" https://link.springer.com/article/10.1007/s1061401797135
Vinod, H. and Viole, F. (2018) "Clustering and Curve Fitting by Line Segments" https://www.preprints.org/manuscript/201801.0090/v1
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 37 38 39 40 41 42  ## Not run:
set.seed(123)
x < rnorm(100) ; y < rnorm(100)
NNS.reg(x, y)
## Manual {order} selection
NNS.reg(x, y, order = 2)
## Maximum {order} selection
NNS.reg(x, y, order = "max")
## xonly paritioning (Univariate only)
NNS.reg(x, y, type = "XONLY")
## For Multiple Regression:
x < cbind(rnorm(100), rnorm(100), rnorm(100)) ; y < rnorm(100)
NNS.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)
NNS.reg(x, y, point.est = c(.25, .5, .75), dim.red.method = "cor")
## IRIS dataset examples:
# Dimension Reduction:
NNS.reg(iris[,1:4], iris[,5], dim.red.method = "cor", order = 5)
# Dimension Reduction using causal weights:
NNS.reg(iris[,1:4], iris[,5], dim.red.method = "NNS.caus", order = 5)
# Multiple Regression:
NNS.reg(iris[,1:4], iris[,5], order = 2, noise.reduction = "off")
# Classification:
NNS.reg(iris[,1:4], iris[,5], point.est = iris[1:10, 1:4], type = "CLASS")$Point.est
## To call fitted values:
x < rnorm(100) ; y < rnorm(100)
NNS.reg(x, y)$Fitted
## To call partial derivative (univariate regression only):
NNS.reg(x, y)$derivative
## End(Not run)

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.