Skip to content

add final covmat regularisation procedure and a stat estimator table#630

Merged
Zaharid merged 8 commits into
masterfrom
covmat_reg_table
Feb 13, 2020
Merged

add final covmat regularisation procedure and a stat estimator table#630
Zaharid merged 8 commits into
masterfrom
covmat_reg_table

Conversation

@wilsonmr
Copy link
Copy Markdown
Contributor

@wilsonmr wilsonmr commented Jan 15, 2020

added the final recommendation for covmat reg to calcutils, added functions which regularize both covmat and sqrt of covmat (lower triangle/systematics file)

Also added a preliminary table for comparing the affect of different thresholds on the difference between the chi2 and the expected chi2 in units of the standard deviation of the chi2.

To do:

closes #584

updated function to regularize full covmat, updated kwarg to reflect that the norm of the matrix has threshold not the condition number.
@wilsonmr wilsonmr requested a review from Zaharid January 15, 2020 15:28
@wilsonmr wilsonmr changed the title [WIP] add final covmat procedure and a stat estimator table [WIP] add final covmat regularisation procedure and a stat estimator table Jan 15, 2020
@wilsonmr
Copy link
Copy Markdown
Contributor Author

The purpose of this was to have stable versions of the functions which regularize the covmats/sqrtcovmats on master and also some of the tables for the paper can perhaps be generated with validphys more efficiently than in a notebook.

@wilsonmr
Copy link
Copy Markdown
Contributor Author

example of two tables added: https://vp.nnpdf.science/EJsoHwoDQeyfWe0l3bAW6g==

@Zaharid
Copy link
Copy Markdown
Contributor

Zaharid commented Jan 21, 2020

I have a couple of questions regarding the interface. I have the feeling that it is better the way it is done already though.

Now we have an opt in boolean flag that enables the regularization and additionally a threshold number. Could we have instead threshold=Optional[Number] with the meaning that there is no regularization if it is None?

Also would it make sense if the regularized covmat is some sort of explicit node instead of piling up functionality on top of the function we have? My intuition is no because we don't have some diverging dependencies for the normal and regularized mat (and you would still have to call it anyway).

More importantly how would this interact with the fit? Ideally there should be an easy way (for n3fit at least) to do fits with regularized covmats and to get the regularization from fit somehow. Possibly by adding the setting to the various fitcontext namespaces.

@wilsonmr
Copy link
Copy Markdown
Contributor Author

Now we have an opt in boolean flag that enables the regularization and additionally a threshold number. Could we have instead threshold=Optional[Number] with the meaning that there is no regularization if it is None?

This seems sensible, changed to reflect this

Also would it make sense if the regularized covmat is some sort of explicit node instead of piling up functionality on top of the function we have? My intuition is no because we don't have some diverging dependencies for the normal and regularized mat (and you would still have to call it anyway).

I've never really looked at the explicit node stuff, I think the way it's currently done seems fine - like you say the normal and regularized covmats are used in the same way

More importantly how would this interact with the fit? Ideally there should be an easy way (for n3fit at least) to do fits with regularized covmats and to get the regularization from fit somehow. Possibly by adding the setting to the various fitcontext namespaces.

hmm more complicated because what this PR does not do yet is the correct regularization on experiment covmats, since we really need to commondata file to do that it was more for the dataset chi2s. I suspect this feature will be easier to do with the experiment API, because we can regularize the sqrt cov with regularize_l2 function before any 'group of datasets' covmat is constructed - if at all.

@wilsonmr
Copy link
Copy Markdown
Contributor Author

hopefully tests pass then this closes #584

@wilsonmr wilsonmr changed the title [WIP] add final covmat regularisation procedure and a stat estimator table add final covmat regularisation procedure and a stat estimator table Feb 12, 2020
Comment thread validphys2/src/validphys/calcutils.py
Comment thread validphys2/src/validphys/config.py
@Zaharid Zaharid merged commit 614816e into master Feb 13, 2020
@Zaharid
Copy link
Copy Markdown
Contributor

Zaharid commented Feb 13, 2020

Cool.

@Zaharid Zaharid deleted the covmat_reg_table branch June 5, 2020 13:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

regularization should have unit tests

2 participants