samedi 29 mars 2014

loess.smooth, smooth.splines and sm.regression with more x variables


Vote count:

0




I'd like to predict a y with several x values (x1, x2, x3, x4, x5, x6). A linear model is very simple, but i don't understand how can i use loess.smooth, smooth.splines and sm.regression with more x variables. I tried using a dataset or a matrix as x, but this way doesn't work.


x is a matrix 700x6, while y is a 700 element array.



sm1=sm.regression(x, y, h=0.5, add=F, ngrid=300, display="none")



Error in sm.check.data(x = x, y = y, weights = weights, group = group, : x has too many columns




ls1=loess.smooth(x, y, span=0.5)



simpleLoess(y, x, w, span, degree, FALSE, FALSE, normalize = FALSE, : NA/NaN/Inf in foreign function call (arg 1)



I checked and there aren't any NA, Nan or Inf in x.



ss1=smooth.spline(x,y, spar=0.5)



Error in xy.coords(x, y) : 'x' and 'y' lengths differ




asked 1 min ago

As As

380





Aucun commentaire:

Enregistrer un commentaire