additive: An additive model regression estimator for pointwise...

Description Usage Arguments Value Author(s) See Also Examples

Description

Computes the value of a regression function estimator at one point, when the estimator is based on the additive model.

Usage

1
additive(x, y, arg=NULL, eval=NULL, h=1, kernel="gauss", M=2, vect=FALSE)

Arguments

x

n*d data matrix; the matrix of the values of the explanatory variables

y

n vector; the values of the response variable

arg

d-vector; the point where the estimate is evaluated

eval

either NULL or a n*d matrix; the matrix that gives the evaluations of the coordinate functions at the data points

h

a positive real number; the smoothing parameter of the kernel estimate

kernel

a character; determines the kernel function; either "gauss" or "uniform"

M

integer >=2; the number of iterations

vect

TRUE or FALSE; internal parameter

Value

list of eval, value, and valvec; "eval" is a n*d matrix of the evaluations of the estimated component functions at the data points; "value" is a real number giving the estimated value of the regression function at one point; "valvec" is d vector giving the estimated values of the component functions at one point

Author(s)

Jussi Klemela

See Also

pcf.additive,

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
set.seed(1)
n<-100
d<-2 
x<-8*matrix(runif(n*d),n,d)-3
C<-(2*pi)^(-d/2)
phi<-function(x){ return( C*exp(-sum(x^2)/2) ) }
D<-3; c1<-c(0,0); c2<-D*c(1,0); c3<-D*c(1/2,sqrt(3)/2)
func<-function(x){phi(x-c1)+phi(x-c2)+phi(x-c3)}
y<-matrix(0,n,1)
for (i in 1:n) y[i]<-func(x[i,])+0.01*rnorm(1)

additive(x,y)

arg<-c(0,0)
additive(x,y,arg=arg)

Example output

Loading required package: denpro
$eval
                [,1]         [,2]
  [1,] -7.172071e-03  0.001535543
  [2,]  1.285765e-02  0.032163115
  [3,]  1.970865e-02  0.018085249
  [4,] -7.003033e-03 -0.039865253
  [5,] -2.208652e-02  0.004483553
  [6,] -6.286951e-03  0.003796269
  [7,] -9.475963e-03 -0.017452517
  [8,]  1.400992e-02  0.027898151
  [9,]  1.637496e-02 -0.034159604
 [10,] -4.720841e-02  0.009533881
 [11,] -2.109442e-02 -0.038705689
 [12,] -2.772971e-02 -0.008843645
 [13,]  1.187459e-02  0.032473197
 [14,]  1.439730e-02  0.032739325
 [15,]  4.560298e-03 -0.012898793
 [16,]  2.136915e-02 -0.040748339
 [17,]  9.241008e-03 -0.006646655
 [18,] -1.223440e-02 -0.023453697
 [19,]  1.389239e-02  0.031520496
 [20,]  3.873803e-03  0.003556192
 [21,] -8.829614e-03 -0.039808922
 [22,] -1.965897e-02  0.025485119
 [23,]  1.471825e-02  0.027064721
 [24,] -3.785325e-02 -0.006547252
 [25,] -6.781702e-03 -0.012014099
 [26,]  1.463995e-02  0.030767185
 [27,] -5.191503e-02  0.023172109
 [28,]  1.418663e-02  0.002316106
 [29,] -4.079318e-03  0.007811129
 [30,]  8.008102e-03  0.009992048
 [31,]  2.116663e-02  0.013182803
 [32,]  1.829257e-02 -0.029015520
 [33,]  2.133612e-02 -0.036936098
 [34,] -2.559822e-02  0.003180748
 [35,] -5.551084e-04 -0.034612153
 [36,]  1.339978e-02  0.009634141
 [37,]  2.364148e-03  0.015369481
 [38,] -4.082023e-02  0.020876141
 [39,]  8.703366e-03 -0.039348045
 [40,]  1.729601e-02  0.023706219
 [41,]  2.584916e-06 -0.002256477
 [42,]  1.506855e-02  0.009118162
 [43,]  3.379247e-03  0.010426689
 [44,]  2.051629e-02  0.015222282
 [45,]  2.115045e-02 -0.008505691
 [46,]  2.801798e-03  0.030903997
 [47,] -5.109650e-02 -0.006114986
 [48,]  2.105928e-02 -0.010888183
 [49,]  7.938731e-03 -0.023053671
 [50,]  1.139317e-02 -0.027271314
 [51,]  2.106870e-02  0.007185866
 [52,] -3.396481e-03  0.015959447
 [53,]  1.936589e-02  0.029292545
 [54,] -1.197678e-02  0.030846382
 [55,] -4.613091e-02  0.024778714
 [56,] -4.214364e-02 -0.004636039
 [57,]  3.633233e-03  0.020311144
 [58,]  2.131710e-02 -0.029380192
 [59,]  1.391473e-02  0.019787742
 [60,]  1.687786e-02  0.003663427
 [61,] -7.336160e-03  0.021327224
 [62,] -9.669224e-04 -0.031018638
 [63,]  2.046083e-02  0.031525084
 [64,]  6.626178e-03 -0.015549692
 [65,]  1.477963e-02 -0.029294215
 [66,] -8.894406e-03  0.033731365
 [67,]  2.109052e-02 -0.031668061
 [68,]  4.879315e-03  0.030204196
 [69,] -4.434825e-02 -0.007748159
 [70,] -4.525285e-03  0.030474303
 [71,]  7.790779e-03  0.004919076
 [72,] -1.588006e-03 -0.024085910
 [73,]  9.061730e-03 -0.026172538
 [74,]  6.870591e-03  0.034057540
 [75,]  2.103751e-02  0.033845227
 [76,] -5.824829e-03 -0.031059258
 [77,] -3.649990e-03  0.002969572
 [78,]  1.509497e-02 -0.010114121
 [79,]  3.885035e-03  0.008558794
 [80,] -1.046271e-02 -0.031927107
 [81,]  1.914337e-02  0.023192192
 [82,]  9.688540e-03 -0.001938384
 [83,]  1.619216e-02 -0.030000694
 [84,]  5.349621e-03  0.024350095
 [85,]  5.712593e-03 -0.028855320
 [86,] -2.185359e-02 -0.002476363
 [87,]  9.810232e-03 -0.012471372
 [88,] -3.852901e-02 -0.007852828
 [89,] -1.181460e-02 -0.036039590
 [90,] -3.457385e-02  0.017464253
 [91,] -1.319166e-02 -0.006132615
 [92,] -4.753910e-02  0.034032022
 [93,]  1.542494e-02 -0.023963374
 [94,] -4.599768e-03 -0.034482403
 [95,]  3.741279e-03  0.020991463
 [96,]  2.089848e-03  0.010769518
 [97,]  2.029564e-02 -0.021849954
 [98,]  1.718614e-02 -0.024071215
 [99,]  8.860866e-04  0.027639356
[100,]  1.796896e-02 -0.015955952

$value
NULL

$valvec
NULL

$eval
                [,1]         [,2]
  [1,] -7.172071e-03  0.001535543
  [2,]  1.285765e-02  0.032163115
  [3,]  1.970865e-02  0.018085249
  [4,] -7.003033e-03 -0.039865253
  [5,] -2.208652e-02  0.004483553
  [6,] -6.286951e-03  0.003796269
  [7,] -9.475963e-03 -0.017452517
  [8,]  1.400992e-02  0.027898151
  [9,]  1.637496e-02 -0.034159604
 [10,] -4.720841e-02  0.009533881
 [11,] -2.109442e-02 -0.038705689
 [12,] -2.772971e-02 -0.008843645
 [13,]  1.187459e-02  0.032473197
 [14,]  1.439730e-02  0.032739325
 [15,]  4.560298e-03 -0.012898793
 [16,]  2.136915e-02 -0.040748339
 [17,]  9.241008e-03 -0.006646655
 [18,] -1.223440e-02 -0.023453697
 [19,]  1.389239e-02  0.031520496
 [20,]  3.873803e-03  0.003556192
 [21,] -8.829614e-03 -0.039808922
 [22,] -1.965897e-02  0.025485119
 [23,]  1.471825e-02  0.027064721
 [24,] -3.785325e-02 -0.006547252
 [25,] -6.781702e-03 -0.012014099
 [26,]  1.463995e-02  0.030767185
 [27,] -5.191503e-02  0.023172109
 [28,]  1.418663e-02  0.002316106
 [29,] -4.079318e-03  0.007811129
 [30,]  8.008102e-03  0.009992048
 [31,]  2.116663e-02  0.013182803
 [32,]  1.829257e-02 -0.029015520
 [33,]  2.133612e-02 -0.036936098
 [34,] -2.559822e-02  0.003180748
 [35,] -5.551084e-04 -0.034612153
 [36,]  1.339978e-02  0.009634141
 [37,]  2.364148e-03  0.015369481
 [38,] -4.082023e-02  0.020876141
 [39,]  8.703366e-03 -0.039348045
 [40,]  1.729601e-02  0.023706219
 [41,]  2.584916e-06 -0.002256477
 [42,]  1.506855e-02  0.009118162
 [43,]  3.379247e-03  0.010426689
 [44,]  2.051629e-02  0.015222282
 [45,]  2.115045e-02 -0.008505691
 [46,]  2.801798e-03  0.030903997
 [47,] -5.109650e-02 -0.006114986
 [48,]  2.105928e-02 -0.010888183
 [49,]  7.938731e-03 -0.023053671
 [50,]  1.139317e-02 -0.027271314
 [51,]  2.106870e-02  0.007185866
 [52,] -3.396481e-03  0.015959447
 [53,]  1.936589e-02  0.029292545
 [54,] -1.197678e-02  0.030846382
 [55,] -4.613091e-02  0.024778714
 [56,] -4.214364e-02 -0.004636039
 [57,]  3.633233e-03  0.020311144
 [58,]  2.131710e-02 -0.029380192
 [59,]  1.391473e-02  0.019787742
 [60,]  1.687786e-02  0.003663427
 [61,] -7.336160e-03  0.021327224
 [62,] -9.669224e-04 -0.031018638
 [63,]  2.046083e-02  0.031525084
 [64,]  6.626178e-03 -0.015549692
 [65,]  1.477963e-02 -0.029294215
 [66,] -8.894406e-03  0.033731365
 [67,]  2.109052e-02 -0.031668061
 [68,]  4.879315e-03  0.030204196
 [69,] -4.434825e-02 -0.007748159
 [70,] -4.525285e-03  0.030474303
 [71,]  7.790779e-03  0.004919076
 [72,] -1.588006e-03 -0.024085910
 [73,]  9.061730e-03 -0.026172538
 [74,]  6.870591e-03  0.034057540
 [75,]  2.103751e-02  0.033845227
 [76,] -5.824829e-03 -0.031059258
 [77,] -3.649990e-03  0.002969572
 [78,]  1.509497e-02 -0.010114121
 [79,]  3.885035e-03  0.008558794
 [80,] -1.046271e-02 -0.031927107
 [81,]  1.914337e-02  0.023192192
 [82,]  9.688540e-03 -0.001938384
 [83,]  1.619216e-02 -0.030000694
 [84,]  5.349621e-03  0.024350095
 [85,]  5.712593e-03 -0.028855320
 [86,] -2.185359e-02 -0.002476363
 [87,]  9.810232e-03 -0.012471372
 [88,] -3.852901e-02 -0.007852828
 [89,] -1.181460e-02 -0.036039590
 [90,] -3.457385e-02  0.017464253
 [91,] -1.319166e-02 -0.006132615
 [92,] -4.753910e-02  0.034032022
 [93,]  1.542494e-02 -0.023963374
 [94,] -4.599768e-03 -0.034482403
 [95,]  3.741279e-03  0.020991463
 [96,]  2.089848e-03  0.010769518
 [97,]  2.029564e-02 -0.021849954
 [98,]  1.718614e-02 -0.024071215
 [99,]  8.860866e-04  0.027639356
[100,]  1.796896e-02 -0.015955952

$value
[1] 0.1038264

$valvec
           [,1]
[1,] 0.01473350
[2,] 0.03566291

regpro documentation built on May 1, 2019, 10:21 p.m.

Related to additive in regpro...