-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
Description
After some timing tests, these are the bottlenecks in the programme:
- 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. - Evaluating the inverse of
Var.Y
. The default R method is to usesolve(Var.Y)
. A faster, albeit less stable, way is to use the Cholesky decompositionchol2inv(chol(Var.Y))
. This is 5 times faster than the regular method. - 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 asintercept = mean(Y)
. - 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 asolve()
Will look into this.
@Wicher2 can you comment on the above points, specifically 2-4? Thanks.