Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Speed up effects function #214

Open
jschepers opened this issue Aug 12, 2024 · 1 comment
Open

Speed up effects function #214

jschepers opened this issue Aug 12, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@jschepers
Copy link
Collaborator

jschepers commented Aug 12, 2024

At the moment, calculating marginal effects for several subjects, channels, predictors etc. is rather time-consuming.
I think it would be worth checking whether there is optimization potential for the effects function.

Example: Computing the marginal effects for one subject with an Unfold model with 128 channels, 2 basis functions and specifying one predictor with 3 levels (with 9 predictor variables in total in the model), took about 99.4 seconds.

This does not scale well if one has 20-30 subjects and more predictor values.

@jschepers jschepers added the enhancement New feature or request label Aug 12, 2024
@behinger
Copy link
Member

behinger commented Sep 2, 2024

acknowledged. I did a deep dive into the effects function to try to make it faster - and for small models I succeeded. But I also noticed I didnt get any gains for large models.

I already shifted every column to a special vector that encodes unique values as Ints (forgot the name right now). I will try to look into it again. I would also like to be able to calculate effects only for specific channels.

I did see much faster speeds, with me needing 200s for 30subjects with a slightly smaller model. So not entirely sure what happenening here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants