2
$\begingroup$

Suppose I have a dataset df that looks like this:

x1 x2 ... ... x100 y
1 0 ... ... 1 7.2
0 1 ... ... 1 -2.5
... ... ... ... ... ...
1 1 ... ... 0 0.4

where x1,x2,...,x100 are the independent variables that'll be used as features for a model. Then y is the dependent variable or label of the model.

What I'm looking for is coefficients for the independent variables: so the 100 coefficients corresponding with x1,x2,...,x100 respectively. This much is simple enough to do with a linear model (OLS).

Now suppose that I have access to a list of coefficients beta corresponding to the 100 independent variables which were computed using different data.

I'd like to train a model on the data in df while also having the model try and align its output coefficients with beta without using beta as a prior specifically because that wouldn't be an option for out-of-sample cases.

I was thinking of simply making the model features x1,x2,...,x100,y and the label beta (which is what I'm trying to do in theory : use the data in df to predict beta) but the dimensions do not align: beta explicitly has length 100 in this example while df can have any amount of observations.


So, is this even possible? Does it make any sense or am I just spewing nonsense? I'm a complete novice to this so I have no idea if this is an established thing or it's established that it's not possible or what.

The context for why I would like to do this: there is an existing model (consider it model S) that uses post-2000 data to train features on a label - but data for this label did not exist pre-2000. I would like to use the same post-2000 features on a different label (y in this case) that did exist pre-2000 for the purpose of training a model (consider it model T) that can then also be used pre-2000 while being similarly accurate to the post-2000 model S. Thus, when used on just post-2000 data, I want the output coefficients of S and T to be strongly correlated (or as much as possible, at least). But I can't just use beta as a prior because I won't have the beta coefficients for pre-2000 data.

I've tried to search for this question but I'm not even sure how to word the Google search (or the title of this question for that matter). Let me if you think the question title should be worded differently because I struggled with it.

EDIT:

I tried explaining the problem in a generalized way to make it simpler but I don't think I did a good job at doing that, so I'll just go ahead and be specific on exactly what my goal is here.

I am trying to estimate a basketball metric called RAPM (regularized adjusted plus-minus), which works by having a matrix where each column represents one player and is filled with 1s and 0s indicating whether or not that player was on the floor for a single possession. So, each row represents a 'lineup', or a combination of players on the floor.

The dependent variable is the plus/minus per 100 possessions (just a measure of how well they performed) for each lineup. Then you run ridge regression on this data and you get a coefficient for each player which represents their value. Simple enough

The problem is that data for specific lineups only goes as far back as ~1997 while the NBA dates back to ~1952. I want to make historic comparisons so I'd like to train a model similar to RAPM but that can be applied to the past ~70 years of players instead of only ~25.

I've compiled all the data I need to train such a model (it has a row for each game instead of each lineup within a game like RAPM so it's less granular and will be less accurate as a result, but it'll allow for historic comparisons).

I subset the data to the period in which we have RAPM estimates for players and then trained my model (call it xRAPM for now I guess) to see what the correlation is between RAPM coefficients and xRAPM coefficients and I got ~0.64.

I'd like to try and train the model in a way to increase that correlation of ~0.64 because I essentially want a historic estimate of RAPM.

I hope that cleared it up somewhat.

EDIT 2:

I've been thinking about some sort of hyperparameter tuning... like you ltera the parameters of the model, record the correlation (with the RAPM coefficients) for those parameters, and do this until you find the best set of parameters. Problem is that ridge regression only has one parameter afaik so that was not very effective. And other model options that I can think of don't give you coefficients so those wouldn't be an option.

$\endgroup$
15
  • $\begingroup$ do you have post-2000 data on this surrogate dependent variable you want to use? $\endgroup$
    – bdeonovic
    Sep 20, 2021 at 19:35
  • $\begingroup$ and just to confirm: You have two data sets (say $X_1$ and $X_2$) with 100 features, one from pre-2000 and one from post-2000? $\endgroup$
    – bdeonovic
    Sep 20, 2021 at 19:39
  • $\begingroup$ in general your post is very confusing and could benefit from some clarifications; could you be more explicit about what data you have? Eg at end of post you use S and T without specifying what those are (the two different dependent variables I guess from the context) $\endgroup$
    – bdeonovic
    Sep 20, 2021 at 19:51
  • $\begingroup$ @bdeonovic yes, i have the post-2000 data on the DV i want to use. the problem is that this other model uses a DV that is not available pre-2000. i'd like to use the post-2000 data with my surrogate DV and somehow make the new model as similar as possible to the old model so that pre-2000 computations can be made. $\endgroup$ Sep 20, 2021 at 19:58
  • 1
    $\begingroup$ I've added an edit with more specific detail and I tried to refrain from the generalities that I was using before, I hope that helps. Yes, I have the corresponding surrogate DV for post-2000 data as well. $\endgroup$ Sep 20, 2021 at 20:12

1 Answer 1

2
$\begingroup$

There are two general ways you could go about doing this:

  • Build a single model of both datasets: If you can build a single model that incorporates the data from both analyses then this will naturally incorporate the "estimator" of the coefficients from the first dataset and its uncertainty. Depending on the structure of the datasets, it might be possible to specify a model that incorporates both of these, with shared coefficients for the part of interest. If you can construct such a model then any standard estimation technique will incorporate both sets of data and their impact on the shared coefficients.

  • Use Bayesian estimation: If it is hard to specify a single model that incorporates both datasets, another option is to model both datasets using "separate" Bayesian models, but use the posterior from the first model (using the previous dataset) as your prior for the second model (using the new dataset). This will ensure that information about the coefficients from the previous dataset is incorporated into the second analysis.

$\endgroup$
1
  • $\begingroup$ Thank you for the answer, quick clarification question: I was under the impression that a prior wouldn't be appropriate because I would not have access to a prior for out-of-sample testing. As in, I'd be training the model with a prior for time period that the previous dataset covers, but if I want to apply the model to any other time period I wouldn't have a prior. Does that not matter? $\endgroup$ Sep 23, 2021 at 21:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.