# Logistic regression in LabVIEW

I am using a psychophysical model to calculate the probability (P) of detecting an electrical stimulus to the skin (amplitude = x) over time (t):

$$P(x;\alpha(t),\beta) = \dfrac{1}{1+e^{\beta(\alpha(t)-x)}}, \text{ } {\small \alpha \text{= threshold & } \beta \text{ = slope}}$$

To find the model parameters I would like to use a logistic regression function:

$$logit(\pi) = b_0 +b_1X +b_2T$$

Does anyone know how to implement this logistic regression function in LabVIEW? As inputs I have a timevector, an amplitude vector and a response (0 or 1) vector.

• I'm guessing you're stuck w/ LabView because you want real-time calculations based on sensor response. Otherwise, run screaming to safety. If LabView allows linking/bridging to Matlab or Python, use the builtin logit functions there. Otherwise, just write out the equations in a new unit. – Carl Witthoft Mar 30 '17 at 14:19
• I'm voting to close this question as off-topic because this belongs on StackOverflow or some SE site related to LabView. – Carl Witthoft Mar 30 '17 at 14:19
• I have found a solution: I have used a Matlab node using the following code (S = stimulus amplitude, R = response (0 or 1) and t = time): b = glmfit([S' t'],R' ,'binomial','link','logit'); slope = b(2); x50 = -(b(1)+t.*b(3)/b(2))'; – Alexm Mar 31 '17 at 14:53