{"action":"created","issue":{"url":"https://api.github.com/repos/haziqjamil/iprior/issues/20","repository_url":"https://api.github.com/repos/haziqjamil/iprior","labels_url":"https://api.github.com/repos/haziqjamil/iprior/issues/20/labels{/name}","comments_url":"https://api.github.com/repos/haziqjamil/iprior/issues/20/comments","events_url":"https://api.github.com/repos/haziqjamil/iprior/issues/20/events","html_url":"https://github.com/haziqjamil/iprior/issues/20","id":130037560,"number":20,"title":"Speeding up the programme","user":{"login":"haziqjamil","id":16189362,"avatar_url":"https://avatars.githubusercontent.com/u/16189362?v=3","gravatar_id":"","url":"https://api.github.com/users/haziqjamil","html_url":"https://github.com/haziqjamil","followers_url":"https://api.github.com/users/haziqjamil/followers","following_url":"https://api.github.com/users/haziqjamil/following{/other_user}","gists_url":"https://api.github.com/users/haziqjamil/gists{/gist_id}","starred_url":"https://api.github.com/users/haziqjamil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/haziqjamil/subscriptions","organizations_url":"https://api.github.com/users/haziqjamil/orgs","repos_url":"https://api.github.com/users/haziqjamil/repos","events_url":"https://api.github.com/users/haziqjamil/events{/privacy}","received_events_url":"https://api.github.com/users/haziqjamil/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/haziqjamil/iprior/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2016-01-30T21:16:00Z","updated_at":"2016-05-22T22:11:03Z","closed_at":null,"body":"After some timing tests, these are the bottlenecks in the programme:\r\n\r\n1. The many matrix multiplications of the kernel matrix `H.mat %*% H.mat`. Need some clever way to reduce these occurences. This is doable I think. The plan is to do all possible matrix multiplications and store them, and use them as needed. This way they are not evaluated again and again.\r\n2. Evaluating the inverse of `Var.Y`. The default R method is to use `solve(Var.Y)`. A faster, albeit less stable, way is to use the Cholesky decomposition `chol2inv(chol(Var.Y))`. This is 5 times faster than the regular method.\r\n3. Figure out an alternative method to estimate the intercept, because the current Generalised Least Squares method that I employ heavily relies on the inverse of `Var.Y`. If I can find another method which does not depend on this inverse, then I can speed up the programme. For example, sometimes it is as simple as `intercept = mean(Y)`.\r\n4. Calculation of the log-likelihood via the built in function `dmvnorm()` also takes a substantial amount of time, but not sure how much can be reduced by building own function. For reference, `dmvnorm()` takes 1/8th of the time to do a `solve()`Will look into this.\r\n\r\n@Wicher2 can you comment on the above points, specifically 2-4? Thanks."},"comment":{"url":"https://api.github.com/repos/haziqjamil/iprior/issues/comments/220859694","html_url":"https://github.com/haziqjamil/iprior/issues/20#issuecomment-220859694","issue_url":"https://api.github.com/repos/haziqjamil/iprior/issues/20","id":220859694,"user":{"login":"haziqjamil","id":16189362,"avatar_url":"https://avatars.githubusercontent.com/u/16189362?v=3","gravatar_id":"","url":"https://api.github.com/users/haziqjamil","html_url":"https://github.com/haziqjamil","followers_url":"https://api.github.com/users/haziqjamil/followers","following_url":"https://api.github.com/users/haziqjamil/following{/other_user}","gists_url":"https://api.github.com/users/haziqjamil/gists{/gist_id}","starred_url":"https://api.github.com/users/haziqjamil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/haziqjamil/subscriptions","organizations_url":"https://api.github.com/users/haziqjamil/orgs","repos_url":"https://api.github.com/users/haziqjamil/repos","events_url":"https://api.github.com/users/haziqjamil/events{/privacy}","received_events_url":"https://api.github.com/users/haziqjamil/received_events","type":"User","site_admin":false},"created_at":"2016-05-22T22:11:03Z","updated_at":"2016-05-22T22:11:03Z","body":"The action item after this next update will be: Are there any algorithmic improvements that can be made, e.g. nice matrix tricks to avoid matrix multiplications?"}}
{"actor":{"display_login":"haziqjamil"}}