# classification using logistic regression on stock data

I have made a model which is supposed to classify the trend of a stock index as an "up day" (=1) or a "no change"/"down day"(=0), where I have coded an "up day" as when the percent change for the index today is > 0. The model has been trained and validated on data where I know if the index has been a 1 or a 0.

However, I want to apply my model to days where I don't know the direction of today's market. How would I go about solving this? Any advice is much appreciated :) Also, first question on this forum (have been a reader for some time, finally took the step right? :))

My model looks like the following:

direction ~ Bo+B1x1+...+B19x19, where direction = 1 if index > 0, 0 otherwise

B1 to B5 are lagged variables of the index I want to predict and the rest is variables with closing time before or after the index of interest.

Since I don't know the direction of the index today, I don't have anything to predict(?)

• Why would you build this model when you can model actual returns? There's so much more information in returns than a 0,1 dependent variable! – Mike Hunter Aug 7 '16 at 23:46
• How did you train your model? If your independent variables are observed at time t-1 (or t-k for k>=1) and you are predicting the direction of the index at time t, then you merely need to plug in yesterday's (or previous days) values of your independent variables into your model to obtain the predicted index movement today. – dmanuge Aug 8 '16 at 1:02
• I trained it with five lagged variables of the index to be predicted and indexes for markets which close in the early morning and late evening relative to my time zone, so I guess in some sense they could also be lagged variables (?) even though they don't fit the formal definition. My problem seem to be that when I don't know the outcome of today, I don't have any variable to predict? – lindiswtf Aug 8 '16 at 10:36
• Although I can see a point to creating such a model for characterizing market changes post hoc, I believe that most people--whose information is routinely limited to events in the past--think models of asset prices that require knowledge of the future are useless. – whuber Aug 8 '16 at 15:27
• @whuber "Useless" is a strong word. "Weakly predictive" is probably the better choice. As in Edward Thorp's book Beat the Dealer about the first Vegas card counter, if you can get a 3-4% edge (or better) over the house, you're in the money. – Mike Hunter Aug 10 '16 at 13:10

• Try predict(model, newdata, type = "response"). – Kodiologist Aug 8 '16 at 14:20