I'm using statsmodel and this is the code I'm using to generate a multilinear regression:
def regression():
Data = pd.read_csv("CSV_file")
DependentVariable = Data[["Variable1"]].values.tolist()
IndependentVariables = Data[["Variable2","Variable3","Variable4"]].values.tolist()
huber_t = sm.RLM(DependentVariable, IndependentVariables, M=sm.robust.norms.HuberT())
hub_results = huber_t.fit()
return hub_results.summary()
This gives a normal output. However, I would also like to weight my data so that the more recent data is more significant than older data. I was thinking about using some sort of exponential decay to compute the weight. Is there any way to take this weighting into account when computing the linear regression?