# Tag Info

2

Both R and Python can do this very nicely. For Python you would need the pandas package and its dependencies. pandas has a lot of basic statistics, but for more advanced statistics like it looks like you want to do, you can use the statsmodels package, which can work directly with pandas data types. It can also download the csv files directly off the ...

2

Similar to Juan Gil's answer but a bit differently I would say the following based on this: The OU process $$dX_t = \kappa(\theta-X_t)dt + \sigma dW_t$$ can be (Euler-Maryuama discretization) discretized at times $n \Delta t,n=1,\ldots,\infty$ which gives with $t = k \Delta t$ $$X_{k+1} - X_k = \kappa \theta \Delta t -\kappa X_k \Delta t + \sigma (W_{k+1} ... 2 For a Ornstein-Uhlenbeck process, the maximum likelihood parameters are the ones from least squares regression. If your process is:$$ dX=\kappa (\theta-X)dt+\sigma dW $$you can do a linear regression in the form$$ \frac{dX}{dt}=a+bX+\epsilon $$So your parameters will be:$$ \kappa=-b  \theta=-\frac{a}{b}  \sigma=std(\epsilon dt) 

1

In addition to the above answers - You should be very careful that you do not introduce survivorship bias in your creation of indices and choose your data source carefully to remove such bias. For example, Yahoo Finance only contains currently-listed securities.

1

Looking at your code, you seem to be mixing the risk minimization formulation of the mean-variance problem with the risk aversion formulation. Both formulations include the "budget" constraint, that the sum of the weights equal 1, and can require that each of the weights be greater than zero, the "long-only" inequality constraints. In the risk minimization ...

1

There are two answers to your question If you want to use the Neston-Nandi model, you can use it directly with the parameters that you already show above: model = list(omega = 0.000001, alpha = 0.5, beta = 0.4) In r, the fOptions package has an HN model that can use them: HNGOption(TypeFlag, model, S, X, Time.inDays, r.daily) If you want to calculate ...

1

You'll want the ibrokers package, its very good and built on the c++ api. Also check out quantmod, performanceanalytics, and highfrequency package. And a comprehensive list, http://cran.r-project.org/web/views/Finance.html

Only top voted, non community-wiki answers of a minimum length are eligible