I am trying to find the best fitting function in case of logistic regression using R.
regr_A<-glm( cbind(X$M, X$N-X$M)~...., data=mydata, family="binomial"
I want to have the best "composition" of only three regressors
for example like
regr_A<-glm( cbind(X$M, X$N-X$M)~exp(v1^2)+sin(v2)+v3^8, data=mydata, family="binomial"
but also maybe the best fit
regr_A<-glm( cbind(X$M, X$N-X$M)~cos(v2)+v3^3, data=mydata, family="binomial"
whatever.
So is a way to find a function f = g(v1,v2,v3), where g can be everything (the composition of whatever : polynomials, sin, cos etc), that the glm is fitting best?
Sure one can look at the scatter plot and "get a feeling" for the objective function, but is there a way to find it automatically? like to test many possibilities?
I am aware that it is not possible to test an infinite number of functions - but do you see a practical possibility ?
something like this:
regr_A <- glm(cbind(X$M, X$N-X$M) ~ HERE IS A LIKELY COMBINATION OF POLYNOME FUNCTIONS, EXP FUNCTIONS etc), data=mydata, family=binomial)
So a minimization problem (for example via deviance or AIC).I just don't know the best way to iterate over the function set?
So there are three regressors
x,y,z and for example polynomials up to degree 10 (of all possible combinations of the three variables) are to be tested and the fitting function which has the smallest AIC is to be chosen.