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

Generalized least squares #11

Open
lindonroberts opened this issue Feb 12, 2020 · 2 comments
Open

Generalized least squares #11

lindonroberts opened this issue Feb 12, 2020 · 2 comments
Assignees

Comments

@lindonroberts
Copy link
Collaborator

Allow option for generalized least squares (i.e. instead of ||r(x)||^2, have ||r(x)||_A^2, where A is the inverse of the correlation matrix; see https://en.wikipedia.org/wiki/Generalized_least_squares). This captures correlation/heteroskedacity in the residuals.

@lindonroberts lindonroberts self-assigned this Feb 12, 2020
@SimonTett
Copy link

Hi Lindon,
this would be useful! I implement it by translating into (and out of ) the eigenvector space of the covariance matrix.

@SimonTett
Copy link

And as I gave been having a hard time with DFOLS and "noise" in my trials so have been looking at that bit of my code I put it here!
Part 1 --generate transformation matrix from Covariance matrix. You might want to filter this
evalue, evect = np.linalg.eigh(Cov)
transMatrix = np.diag(evalue ** (-0.5)).dot(evect.T)
Part 2 -- apply
resid = transMatrix @ fn(params)

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

No branches or pull requests

2 participants