0
$\begingroup$

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

$\endgroup$
1
  • 1
    $\begingroup$ It seems like adding polynomials or splines would account for this in a single model. $\endgroup$
    – Noah
    Sep 24, 2021 at 18:34

1 Answer 1

0
$\begingroup$

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: enter image description here

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.

$\endgroup$
1
  • 1
    $\begingroup$ Thank you both (Noah and ofer-a). The polynomial works nicely. $\endgroup$
    – Matthew
    Sep 24, 2021 at 19:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.