# Tag Info

I hope I understood you correctly and that the following thoughts help you a bit. Reference point: Univariate curve fitting using splines With a univariate function $f(x)$ you can perform 1D spline interpolation and require for each (inner) $x_i$-node that: \begin{align} \left.f_{i-1}(x)\right|_{x=x_i}&=\left.f_i(x)\right|_{x=x_i} \quad \mathrm{... 4 When we worked with that model several years go, we used Differential Evolution and it worked very well. See Calibrating the Nelson-Siegel-Svensson Model. At least in the standard version, a best-of-many gradient searches (with random initial values) also worked well. See A Note on 'Good Starting Values' in Numerical Optimisation. If you were willing to use ... 4 I don't use fPortfolio but when I run your code example, I first get an error: ## Error in add.constraint() : could not find function "add.constraint" Nevertheless, after that, I can extract a solution: getWeights(minCVAR_Portfolio2) ## SBI SPI SII LMI MPI ALT ## 0.240491 0.000172 0.169241 0.500000 0.000000 0.090096 ... 3 I feel this is not a duplicate of a question asking about applications of graph theory as this goes the other way. If you're talking purely about currency arbitrage, the quickest way seems to be finding a negative cycle in a graph of currency where the vertices are the currencies and the nodes the exchange rate. 3 Let's stick with the nomenclature in the literature and let \gamma denote the decision maker's risk aversion coefficient. The optimization problem is \max_{\mathrm{w}} \mathrm{w}^T\mathrm{\mu}-\frac{1}{2}\gamma \mathrm{w}^T\mathrm{\Sigma}\mathrm{w} \quad s.t. \mathrm{w}^T\mathrm{e}=1 $$where e denotes a vector of ones. The corresponding Lagrangean ... 3 Yes there are two ways to solve the tangency portfolio: closed-form analytical solution optimization problem (maximization of the Sharpe ratio) The closed-form analytical solution you incorrectly wrote is actually$$w_{\text{tan}} = \frac{\Sigma^{-1} \left(\mu - r_f \cdot \iota\right)}{\iota^{\prime}\Sigma^{-1}\left(\mu - r_f \cdot \iota\right)}$$This is ... 2 This might not be a direct response, but just some general advise / ideas. I think giving you "optimal" parameters is not a straight realistic response. It depends on the security you are analizing. For instance, what you can do is grab a set of historical years, run multiple simulations on different parameters, and check which ones provide you the ... 2 The quadratic programming approach is used to solve problems of the form$$ \sum_i\beta_ix_i+\sum_i\sum_j \gamma_{ij}x_ix_j \quad s.t.\quad Ax\leq a\quad \mathrm{and}\quad Bx=b. $$A portfolio optimisation that involves decisions over skew and kurtosis introduces terms in \sum_i\sum_j\sum_k\kappa_{ijk} x_ix_jx_k and \sum_i\sum_j\sum_k\sum_l\theta_{ijkl} ... 1 Hi: I came up with something but go over it carefully because it's a little different from what you were doing (but not much). First, let y_{i} =  the portfolio weight bought or sold in stock i. So, if y_{i} is greater than zero then it was purchased and if it is negative, then this means that it was sold. Also, let x_{i} =  current differnce betwen ... 1 It's normal that it takes very long to come close to the efficient frontier with random portfolios. How close you come how fast will be strongly influenced by how you sample the portfolios. In your code, you sample uniformly. You may want to look at the weight distributions of the portfolios on the frontier, and then consider how likely it is that you arrive ... 1 I agree this is off topic so let me try to reign it in with general response. A common solution to financial and probabilistic problems is to reduce them to explore more simpler cases, from which you may be able to deduct patterns. Consider only one die If you only had one die the flipping is irrelevant. The solution is to keep your score provided it is ... 1 As you suspect, you have a mistake. You say that:$$R_{average} = W^{1/n} = (\prod_{i = 1..n}R_{i})^{1/n} = {1\over n} \sum_{i = 1..n}log(R_{i}).$$Notice that you took a log and kept the equation sign. What you really meant is$$\log R_{average} = {1\over n} \sum_{i = 1..n}log(R_{i}).$$So you don't really compare$$\max_{f} W \space \space \space \...