My binary dependent variable (pollinator presence) responds to the independent variable (air temperature). With increasing temperatures there is a logistic increase in probability of pollinator presence (a positive logistic function), but at very high temperatures there is a second logistic decrease in probability of pollinator presence (a negative logistic function). Thus, I'd like to simultaneously fit two (positive and negative) logistic functions to one independent variable. I can do this using a custom non-linear fitting procedure using logistic functions (nls in R), but it seems that a formal/standard procedure must be available (e.g. using glm in R). The benefit of a formal approach would be the ability to compare models and easier treatment of interactions with other variables etc. Any suggestions? Presumably this type of approach is common, but not easy to find on the net. Thanks
1 Answer
A common approach would be to add $t^2$ as a feature. i.e your linear model now will be $sigmoid(W_1t + W_2t^2 + b)$. This will enable the model second degree polynomial equation.
An example with $W_1 = 2, W_2 = 0.3, b = -1$ would result with this function:
If you have more complex pattern, the best would be to use non linear model like NN. With NN, by composing lots of non linear functions you can achieve modeling of complex patterns.
-
1$\begingroup$ Thank you both (Noah and ofer-a). The polynomial works nicely. $\endgroup$– MatthewCommented Sep 24, 2021 at 19:43