A method comprising: receiving reference analyte measurements; receiving, from an in vivo analyte sensor, at least a first uncompensated analyte measurement at a first initial reference time ( N 0), a second uncompensated analyte measurement at a first prior reference time ( N 1), and a third uncompensated analyte measurement at a second prior reference time ( N 2); and calculating an analyte rate-of-change estimate based on the sum of the first scaled rate-of-change, and the second scaled rate-of-change, comprising: determining a first scaled rate-of-change by multiplying a first scalar ( c 1) and a first rate-of-change, the first rate-of-change computed between the first uncompensated analyte measurement at the first initial reference time to the second uncompensated analyte measurement at the first prior reference time, wherein the first scalar ( c 1) is determined based on the reference analyte measurements; determining a second scaled rate-of-change by multiplying a second scalar (c 2) and a second rate-of-change, the second rate-of-change computed between the first uncompensated analyte measurement at the first initial reference time to the third uncompensated analyte measurement at the second prior reference time, wherein the second scalar ( c 2) is determined based on the reference analyte measurements; and calculating error metrics for a plurality of combinations of values as parameters (N 0, N 1, N 2, c 1, c 2) in the analyte rate-of-change estimate; selecting a set of parameter values based on the calculated error metrics; and deriving a set of weighting coefficients (d 0, d 1, d 2) for the analyte rate-of-change estimate based on the selected set of parameter values, and calculating a lag-compensated analyte rate-of-change measurement by applying the set of weighting coefficients to the first uncompensated analyte measurement, the second uncompensated analyte measurement, and the third uncompensated analyte measurement, respectively. receiving reference analyte measurements; receiving, from an in vivo analyte sensor, at least a first uncompensated analyte measurement at a first initial reference time ( N 0), a second uncompensated analyte measurement at a first prior reference time ( N 1), and a third uncompensated analyte measurement at a second prior reference time ( N 2); and calculating an analyte rate-of-change estimate based on the sum of the first scaled rate-of-change, and the second scaled rate-of-change, comprising: determining a first scaled rate-of-change by multiplying a first scalar ( c 1) and a first rate-of-change, the first rate-of-change computed between the first uncompensated analyte measurement at the first initial reference time to the second uncompensated analyte measurement at the first prior reference time, wherein the first scalar ( c 1) is determined based on the reference analyte measurements; determining a second scaled rate-of-change by multiplying a second scalar (c 2) and a second rate-of-change, the second rate-of-change computed between the first uncompensated analyte measurement at the first initial reference time to the third uncompensated analyte measurement at the second prior reference time, wherein the second scalar ( c 2) is determined based on the reference analyte measurements; and calculating error metrics for a plurality of combinations of values as parameters (N 0, N 1, N 2, c 1, c 2) in the analyte rate-of-change estimate; selecting a set of parameter values based on the calculated error metrics; and deriving a set of weighting coefficients (d 0, d 1, d 2) for the analyte rate-of-change estimate based on the selected set of parameter values, and calculating a lag-compensated analyte rate-of-change measurement by applying the set of weighting coefficients to the first uncompensated analyte measurement, the second uncompensated analyte measurement, and the third uncompensated analyte measurement, respectively. determining a first scaled rate-of-change by multiplying a first scalar ( c 1) and a first rate-of-change, the first rate-of-change computed between the first uncompensated analyte measurement at the first initial reference time to the second uncompensated analyte measurement at the first prior reference time, wherein the first scalar ( c 1) is determined based on the reference analyte measurements; determining a second scaled rate-of-change by multiplying a second scalar (c 2) and a second rate-of-change, the second rate-of-change computed between the first uncompensated analyte measurement at the first initial reference time to the third uncompensated analyte measurement at the second prior reference time, wherein the second scalar ( c 2) is determined based on the reference analyte measurements; and calculating error metrics for a plurality of combinations of values as parameters (N 0, N 1, N 2, c 1, c 2) in the analyte rate-of-change estimate; selecting a set of parameter values based on the calculated error metrics; and deriving a set of weighting coefficients (d 0, d 1, d 2) for the analyte rate-of-change estimate based on the selected set of parameter values, and calculating a lag-compensated analyte rate-of-change measurement by applying the set of weighting coefficients to the first uncompensated analyte measurement, the second uncompensated analyte measurement, and the third uncompensated analyte measurement, respectively.