Definitely a nice addition to the blog series. Not sure if this is addressed elsewhere, but is there a performance reason why you would use r = rows(X) instead of for(i = 1; i <= rows(X); i++)? Also, are objects defined in Mata functions automatically garbage collected when the function terminates or is it better to make the values of potentially larger sized matrices null (or a null matrix) before the function ends?
↧