I need to compute the logarithmic tick by tick return from a 100 000 000 x 6 matrix. The first three columns are day count, dates in yyyymmdd format and the timestamp from the transcation.
For the log returns of the tick by tick, I used the following function:
[line,column]=size(z); %take the size of the matrix to do the log returns
r=log(z(2:i,4))-log(z(1:i-1,4));%compute log returns
For the daily returns, I want the function to compute the log return based on the price from the fourth column with the price of the last data in the same column when the day count (column one) increase by one.