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

add plot bootstrap coefficients #6

Closed
wants to merge 3 commits into from

Conversation

@JoseAlanis
Copy link
Owner

commented Jun 24, 2019

Add example code for bootstraping coeffients of linear model estimator

Example output for the electrode B8 (here showing the effect of phase-coherence):
PC-beta-B8

@jona-sassenhagen

This comment has been minimized.

Copy link
Collaborator

commented on plot_bootstrap_coefficients.py in d96e7be Jun 24, 2019

Ridge with alpha=0 is equivalent to OLS and I wouldn’t call it ridge - the question is simply if using ridge for the OLS might give a speed boost. I thought it did.

This comment has been minimized.

Copy link
Owner Author

replied Jun 25, 2019

Right, I see your point. It was meant more like a breaking point in the script to let it run with either sklearn.linear_model.LinearRegression or sklearn.linear_model.Ridge.

And yes! The script runs faster with sklearn.linear_model.Ridge, I even have problems running the script with 2000 samples of sklearn.linear_model.LinearRegression on my 32 GB Ram machine. Without over-committing memory it will through a memory error.

We could call it method (?). Or just delete one an go with either LinearRegression or Ridge.? What do you think?

@dengemann

This comment has been minimized.

Copy link
Collaborator

commented Jul 2, 2019

Other than my comments it looks clean.

@dengemann

This comment has been minimized.

Copy link
Collaborator

commented Jul 2, 2019

@JoseAlanis looking at #5 we should probably just combine these PRs into one.
They show the same, don't they?

@dengemann

This comment has been minimized.

Copy link
Collaborator

commented Jul 2, 2019

Probably you can just close this one for now and see which of my comments apply to #5, i.e., those about random state.

@JoseAlanis

This comment has been minimized.

Copy link
Owner Author

commented Jul 3, 2019

@JoseAlanis looking at #5 we should probably just combine these PRs into one.
They show the same, don't they?

yup, they are very similar. #5 looks at the mean (the ERP) and #6 looks at the betas. But the approach is pretty much the same.

@dengemann

This comment has been minimized.

Copy link
Collaborator

commented Jul 3, 2019

@JoseAlanis

This comment has been minimized.

Copy link
Owner Author

commented Jul 9, 2019

what is the difference between beta and ERP? Betas estimate the ERP.

I see your point. The PRs do show some redundant information, Originally, I thought it would be good to show people how the bootstrap procedure is done for the Betas (i.e., actually fitting the model 2000 times on random samples of the original data). But I guess once one has understood how the bootstrap is carried out for the mean it should be easy to extrapolate to the linear model. But perhaps you are right and we could just close this PR. We'll pick up this approach later in other analyses.

@dengemann

This comment has been minimized.

Copy link
Collaborator

commented Jul 9, 2019

It is really the same to me. We’re really interested in bootstrapping beta.

@JoseAlanis

This comment has been minimized.

Copy link
Owner Author

commented Jul 9, 2019

It is really the same to me. We’re really interested in bootstrapping beta.

Alright, you're right. Closing here for now.

@JoseAlanis JoseAlanis closed this Jul 9, 2019

JoseAlanis added a commit that referenced this pull request Jul 23, 2019
[MRG] add boostrapped confidence intervals for ERPs (#5)
* add boostrapped regression

* add plot bootstrap ci

* update bootstrap ci

* remove tmin copy

* remove upper and lower evokeds

* remove plot_bootstrapped_coefficients file

* delete unused imports

* add dengemans suggestion from #6  / simplify code

* replace bootstrap mean with bootstrap fit

* minor improvements in bootstrap code

* remove line comment

@JoseAlanis JoseAlanis deleted the add_bootstrap_coefs branch Jul 24, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.