Hi Danny,

I've been using Julia full-time for close to a year now for my research in 
financial econometrics. Once you work out the (fairly simple) rules for 
getting good performance out of Julia, the speed is amazing! However, be 
aware that there aren't a whole lot of packages for working with 
time-series in the official repository yet. It works for me, since 
typically most of the things I want to do haven't been implemented in other 
languages anyway, so if I've got the write it, I might as well write it in 
a fast language that is easy to use.

I will be adding some time-series packages to the official repository soon 
though. I'll do it when Julia v0.4 comes out (with its new documenting 
capabilities). Packages will include dependent bootstraps (with optimal 
block length selection procedures), forecast evaluation (diebold-mariano, 
reality-check, SPA test, etc), ARIMA models (the current ARIMA stuff in 
TimeModels only allows you to simulate I think), bandwidth selection 
procedures, and HAC variance estimators.

Regarding workflow, the data-frames package works well, although personally 
I don't use it. My preference is to store the time-index for any 
time-series data in a sorted vector  and then keep the corresponding data 
in a vector or matrix (again, I'll add my package for sorted vectors and 
sorted data structures to the official repository once v0.4 comes out). 

For the specific problem you describe in your email, the code provided by 
Andreas should do the job. However, be aware, you probably won't see much 
performance improvement doing that task than you would from doing it in R, 
in fact, it may even run slower as my understanding is that reading data 
from csv files is currently a bit slower in Julia than R (personally I find 
it more efficient to store all my data in HDF5 format, and the Julia HDF5 
package is very nice). Computing a covariance will run at about the same 
speed in both languages, since R's function for this is essentially just 
calling C. Where Julia really shines for working with time-series is when 
you need to implement something that hasn't already been written in C, and 
that you don't want to have to write in C yourself. Particularly large 
benefits if it is an algorithm that can't be vectorized (and so will run 
slow in R or Matlab).

If you want to see the current state of the packages I'll be adding in 
v0.4, just check my github page:

https://github.com/colintbowers

Be aware though, most of these are still actively being developed, and 
there are a few bugs here and there that I'm aware of but haven't fixed or 
documented yet. I'll sort them out before adding them to the official 
package list.

Cheers,

Colin

On Wednesday, 22 July 2015 23:08:52 UTC+10, Danny Zuko wrote:
>
> I am new to Julia and would like to try it to deal with financial time 
> series. I read there has been a good bunch discussions within the Julia 
> community about it (for example, some interesting ones on indexing).
>
> As a test, I would like to read some 100MB .csv file containing prices 
> into an array (or data-frame?), computing their logarithmic returns and 
> eventually compute a covariance matrix. 
>
> Something that in R I might do like:
>
> ## Read CSV file and store contents in a dataframe:
> ## - fields are separated by semicolons,
> ## - first line contains column names,
> ## - first column contains row names,
> ## - decimal separator is a comma.
> prices <- read.table ("prices.csv",
>                       sep = ";", header = TRUE, row.names = 1, dec = ",")
>
> ## Convert prices into logarithmic returns by applying the diff function on
> ## the log of the prices:
> returns <- apply (log (prices), 2, diff)
>
> ## Compute the covariance matrix for the logarithmic returns:
> returns_covariance <- cov (returns, use = "pairwise.complete.obs")
>
> As far as the current state of the art is concerned, which are the latest 
> packages that are considered a reference at the moment? Is it TimeSeries.jl?
>

Reply via email to