(EDIT: the question has been modified just a little bit to be more specific)
I want to fit a multivariate polynomial regression that accounts for measurement errors (an Error-in-Variables model).
As an example, my input data is like:
y sd_y x sd_x z sd_z 9.55 0.26 6.74 0.71 0.25 0.02 8.31 0.19 5.93 0.33 -0.40 0.05 ... ... ... ... ... ...
where sd_y, sd_x, sd_z are the standard deviations of each variable, and
wx <- 1/(sd_x)**2 ; wy <- 1/(sd_y)**2 ; wz <- 1/(sd_z)**2
would be the weights for each variable.
If I use a standard regression model (where predictors are supposed to have been measured exactly or without error) my function or fit, in R, would be:
p <- lm(y~polym(x, z, degree = 2, raw=TRUE))
Is there a method/package in R that allows to deal with "error-in-variables models"? If so, how I would write my fit p when using the supposed package?