Description Usage Arguments Value Author(s) See Also Examples
Computes the value of a single index model regression estimator at one point.
1 2 | single.index(x, y, arg=NULL, h=1, kernel="gauss", M=2, method="iter",
vect=FALSE, argd=arg, take=length(y), seed=1)
|
x |
n*d data matrix; the matrix of the values of the explanatory variables |
y |
n vector; the values of the response variable |
arg |
NULL or d vector; the point where the value of the regression function is estimated |
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 |
method |
character string; "poid", "aved", "iter", or "nume"; if method="poid", then the direction vector is estimated using the reference point optionally given in the argument "argd"; if method="aved", then the average derivative method is used; if method="iter", then an iterative algorithm is used; if method="nume", then numerical optimization is used |
vect |
TRUE or FALSE; internal parameter |
argd |
d vector; the point optionally used in the estimation of the direction vector |
take |
positive integer |
seed |
real number; the seed for the random number generator |
either d vector or a real value; if arg=NULL, then the estimated index is returned, otherwise the estimate at "arg" is returned
Jussi Klemela
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)
single.index(x,y)
arg<-c(0,0)
single.index(x,y,arg=arg)
|
Loading required package: denpro
[,1]
[1,] 0.8763256
[2,] 0.4817192
[1] 0.05748599
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.