Top tag
Next privilege 500 Rep.
Cast close & reopen votes
3 5
~7k people reached

comment DCF of Arbitrary Dates Cash Flows
The conversion between the dates and the year fraction is determined by the day counting convention you use. The following document explains this in more details:…
comment PCA Variances and Principal Portfolio Variances
If I run your code, I have identical values. Try in a fresh session (rm(list=ls()) is usually not sufficient).
comment Methods for distributing cash into allocation
This is called dollar cost averaging, but it just says that if you do not have all the money at the begining and if you do not have any view on the evolution of the market, you should not worry and invest progressively, as the money arrives: the market fluctuations will more or less even out. But if you have all the money at the begining and/or know how the market will change, this is suboptimal.
comment Quadratic Programming Problem
I assume that $V$ and $G$ are variance matrices (of returns, etc.): in particular, they are positive semi-definite. If there are no constraints, then $X=0$ is a solution. If you have equality constraints, you can use Lagrange multipliers. If you also have inequality constraints, you can use a quadratic solver. I am not sure what you mean by "both V and G should be uncorrelated" (diagonal variance matrices?).
comment How to quickly estimate a lower bound on correlation for a large number of stocks?
An upper bound, in the general case, can be obtained in the same way -- compute the determinant of the $3\times3$ matrix and solve for $c$: one of the roots is a lower bound, the other an upper bound. The formula is the same, except for the sign in front of the square root.
comment Historical volatility from close prices (Haug pg 166)
You seem to have logarithms of squared ratio returns (log_squared_returns) instead of squares of log-returns: sum_squares_1 can be negative.
comment GJR-GARCH Model In R
library(sos); ???GJR suggests that the rugarch package can fit this model.
comment MPT: Adding constraint on minimum asset weight
@BobJansen: I have made the change you suggested, to match the constraints in the question.
comment MPT: Adding constraint on minimum asset weight
The constraints ``$w_i = 0$ or $0.01 \leq w_i \leq 0.05$'' can be rewritten as $0.01 n_i \leq w_i \leq 0.05 n_i$ by adding binary variables $n_i \in \{0,1\}$. The constraints are still linear, but the objective function is still quadratic: we would need a mixed integer quadratic solver -- Rglpk is only a (mixed integer) linear solver...
comment MPT: Adding constraint on minimum asset weight
That only considers the constraint $0 \leq w_i \leq 0.05$, not the non-convex constraint ``$w_i=0$ or $0.01 \leq w_i \leq 0.05$''.
comment If the distribution of returns in symmetric, why not use a coin toss, small risk & high reward?
Your strategy seems equivalent to the following: the price $X_t$ is a standard random walk, you buy at $t=0$ and sell when it reaches -1/2 or 2 (whichever comes first). In this case, the expected profit is zero.
comment a simpler test for normality given skewness, kurtosis and autocorrelation and size of time series
To visually compare distributions, it is often easier (for the untrained eye) to look at the quantile-quantile plots: the sample data versus a gaussian distribution to test for normality, the first half of the sample versus the second half to test if the distributions are identical.
comment Calculating log returns using R
To be sure that lag works as you expect, it is much safer to store your time series as zoo or xts objects: if you use vectors (or even ts objects), many operations will discard or ignore the timestamps.