简体   繁体   中英

Robust Multivariate Polynomial Regression in Python

Is there an easy way to do a multivariate robust polynomial regression in Python? Eg

y = a + bx_1 + cx_2 + dx_1x_2 + ex_1^2 + fx_2^2 

and possibly higher degree terms, where a,b,c,d,e,f are constants and the x_i are the dependent variables (there could be more than 2).

I have a set of data plagued by outliers, so the normality assumption does not hold. I have not much knowledge of regressions, but I've found that there are 'robust' methods to deal with this problem. Unfortunately I have not been able to find an easy way to do this in Python, without having to code the entire method. Have I overlooked something? Or should I maybe use another more suited language, such as R? (Since I don't know anything of R, and this is part of a larger problem which I've coded in Python, I would rather do it in Python. But maybe learning R is more efficient than trying to do this kind of stuff in Python.)

Thanks in advance.

R is very well suited for this, and there are libraries that let you talk to R from Python, like RPy2

http://rpy.sourceforge.net/rpy2.html

And here is a tutorial on robust regression with R:

http://www.ats.ucla.edu/stat/r/dae/rreg.htm

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM