How to build a prediction model for exam score based on previous scores I am trying to construct a formula, which will take student's previous exam results (for ex: SAT) taken at particular dates and predict his future test result. 
One X is previous test result 1; another X is date of previous test 1 (can be converted to number of days between this test and the last test for simplicity); and other Xs are similar variables for additional previous tests, of which there are 3-5 per person.  My Y is the result of the last test. 
Normally I would use simple linear regression to model this relation, but the problem is that this relation is not linear, because improving one's score from 100 to 200 is easier than from 300 to 400, for example. And also because of the upper limit of the test score (700 for example). 
Is there a way to create a more or less meaningful model for such prediction given 3-5 previous test results? Thank you!
 A: There are multiple ways to address the question you are asking, depending on what data you have and what you are willing to suppose.
One problem is that you (presumably) don't have any $y$ data, if $y$ are the scores for the last test, a test that hasn't happened yet. In this case you cannot build a regression model of the form $\hat y = E(y|x)$ (where $x$ are the exogenous variables, ie students' id and score histories), because you cannot compare your predictions $\hat y$ with 'true' observed $y$...
Once you know that, there are two main possibilities I suppose: either you predict $\hat y$ as a weighted mean of the previous test scores (with weights chosen by you, not much machine learning there) or you treat all test scores (both observed and unobserved) as auto-regressive time series:
$score_{i,t}= f(score_{i,t-1}, score_{i,t-2}, ...)$, where subscript $i$ stands for student id, and $t$ is the time index of tests. I can't help you much from there, but I suppose a simple model with a trend and fixed individual effects could do the trick.
If you had more data, eg. of the class of last year, you could use (nonlinear) regression techniques by fitting a model on the data from last year and using it to predict the final scores for this year.
A: First just calculate the slope of the trend line for simple linear regression without taking into account limits (for example using this formula). Now you have two cases, either the slope is positive, so the student is making progress, or the slope is negative (or zero), and student is not learning anything. I think these two cases should be handled in different ways, because we have a reason to think that if the slope is positive then the student will become better in the future (since he is studying hard), however we don't have a good reason to think that if the slope is negative then the student will become worse in the future. I think it is more likely that the negative trend is by accident, than that it is due to the fact that the student just keeps getting worse with time.
So I think that if the slope is negative, you should just return the average of all his test scores as a prediction for any future date. Alternatively, you can always return the last taken test score, or the average of k last taken test scores.
If however the slope is positive, then u can model it as follows:
Define reciprocal score as (700 - score). So, if his score on test is 400, then his reciprocal score is 300.
Our model is that as the student studies, his reciprocal score is multiplied by some factor less than 1 every day. With this model, his reciprocal score can never become less than 0, and so his score can never become more than 700. Basically we assume that it is as hard to go from 500 to 600, as it is from 600 to 650, and as it is from 650 to 675, and so on.
Now we need to estimate the daily reciprocal factor by which this particular student's daily reciprocal score is multiplied.
We can easily calculate the daily reciprocal factor(DRF) between any two nearby test dates.
For example if there passed 20 days between adjacent tests, and the students reciprocal score in first test was 200, and in second test was 100, then the DRF is 20th root of 100/200, which is equal to 0.9659.
After we calculate DRF between each two nearby tests, we now know the DRF for each date.
But what DRF do we predict for the future?
We could do just a simple linear regression on pairs of date/DRF, however it is possible that DRF is increasing (means the speed at which student's score increases is decreasing), and in this case the student will eventually start losing score and with time his score will go down to minus infinity. So, this is problematic.
A better way is to just take a geometric mean of the DRF over entire history and assume that the geometric mean of the DRF will not change in the future.
The geometric mean of DRF (GMDRF) is equal to exp( sum of the logs of DRFs of all days in history, divided by the number of days in history ) .
Then you make predictions as follows:
Given a date in the future, you calculate the number of days between this date and the date of last test. Let this number be denoted by N. Then the predicted score is equal to:
Predicted score = 700 - (Reciprocal score of last test)*((GMDRF)^N)
A second variant is to use "average reciprocal score of all taken tests (or k last taken tests)" instead of "Reciprocal score of last test" in the above formula. This second variant will usually predict a lower score than the first variant.
A: Based on your problem description, you are supposed to build a time series model for each student. Only 3-5 historical data might be not sufficient to build "fancy" models such as ARIMA or LSTM etc. Try plot the scores in Excel (x axis is date and y axis is score) and see if you can find some clear trends: going better, going worse, fluctuating or staying the same. Then you will have a rough judgement of the next score at a specific time.
