[R] fitted values with locfit

2012-03-19 Thread Soberon Velez, Alexandra Pilar
Dear memberships, I'm trying to estimate the following multivariate local regression model using the "locfit" package: BMI=m1(RCC)+m2(WCC) where (m1) and (m2) are unknown smooth functions. My problem is that once I get the regression done I cannot get the fitted values of each of this smoo

[R] multivariate locfit regression

2012-03-17 Thread Soberon Velez, Alexandra Pilar
Dear memberships, I'm trying to estimate the following multivariate local regression model using the "locfit" package: BMI=m1(RCC)+m2(WCC) where (m1) and (m2) are unknown smooth functions. My problem is that once I get the regression done I cannot get the fitted values of each of this

[R] inverse of the weight function

2011-11-28 Thread Soberon Velez, Alexandra Pilar
Dear members, I'm trying to do a local polynomial estimation where the weight function is the inverse of the kernel (using a gaussian kernel). Does anybody know how I can do it? When I work with a weigth function usual I use: locfif(y~lp(x,deg=1,h=0.75),kern="gauss") Does anybody know

[R] varying coefficients model

2011-10-21 Thread Soberon Velez, Alexandra Pilar
Dear members, I'm trying to estimate a varying coefficients model using the local polynomial estimation method in two case (univariate and bivariate) and with two smooth functions. In the univariate case I use: m1<-smooth.lf(x=lp(z1,by=x1,deg=1,h=0.7,ev=z1)+lp(z3,by=expl2,deg=1,h=0.7,ev=z1

[R] kernel weight

2011-09-12 Thread Soberon Velez, Alexandra Pilar
Hello dear members, I need to calculate "by hand" a local lineal regression so I need to compute a kernel weight. Does somebody knows how to get a kernel to use as weighted? I can calculate a density kernel function and after pre-multiply it by the sample size. However I know this is not w

[R] multivariate bandwidth: regband

2011-09-05 Thread Soberon Velez, Alexandra Pilar
Hello to everybody, Somebody know how I can apply the instruction (regband) of the package (locfit) to a multivariate covariate. In the instructions states that the formula has to have only one predictor. How can I use that when I have an unknown function with two predictors, m(X,Z)? Is there

[R] KernSmooth: dpill

2011-09-05 Thread Soberon Velez, Alexandra Pilar
Hello, I trying to find a way to calculate a bivariate bandwidth for a bivariate local polynomial regression and I have a question. Somebody know if I can use the instruction "dpill" to do it? When I read the instructions I see that "x" must be a vector of variables, but if I state "x" is

[R] automathic bandwidth for multivariate local regression

2011-09-03 Thread Soberon Velez, Alexandra Pilar
Hi, I want to calculate the bandwith of a multivariate local polynomial regression such as the model is: Y=m(X,Z)+u. Please, somebody knows how I can do it in a multivariate case? In an univariate case I use the instrucction "regband" of the locfit package, but it is impossible to find a

[R] Bandwith selectors for multivariate local regression

2011-09-02 Thread Soberon Velez, Alexandra Pilar
Dear all, I'm trying to do a multivariate local regression whit the locfit instruction, such as:Y=m(Z,X,W)+u However, I have a problem at the moment of calculte the bandwith of the regression. If I had a univarite local regression model I could use the instruction "regband". However, t

[R] Generate 2 variables with normal distribution correlated betweenthem and with serial correlation

2011-08-26 Thread Soberon Velez, Alexandra Pilar
Hello, I want to create 2 variables with normal distribution that the correlation between them is equal to 0.8 and also each one has a serial correlation equal to 0.6. To generate variables with correlation between them I use: t1<-10 N<-45 sigma2<-matrix(c(1,0.8*sqrt(1),0.8*sqrt(1),1),

[R] Create two uniformly random variables correlated

2011-08-25 Thread Soberon Velez, Alexandra Pilar
Hello, I want to create two random variables (x1,x2) both with uniform distribution bounded by (-1) and (1) that has a correlation of 0.6 between them. Does somebody know how I can do it? For normal random variables I known how to implement it with the rmvnorm command but I don't know how t

[R] How to store the output of a loop into a matrix??

2011-08-24 Thread Soberon Velez, Alexandra Pilar
Hello, I want to create a matrix of N random numbers with a uniform distributions. Later, I want to repeat T times each row of this matrix. For this I do the following loop: N<-45 T<-10 n<-N*T a<-matrix(runif(N,min=-1,max=1),nr=N) mymat<-matrix(rep(NA,n),nr=n,nc=1) for(i in i:N){ b<-rep(a[i,],