3
$\begingroup$

I'm trying to find variance minimizing currency hedge ratios $\mathbf{h}$ for $m$ currency exposures constrained between $0$ (no hedge) and $1$ (full hedge). We have weights $\mathbf{w}$ for $n$ assets and $m$ related foreign currency exposures $\mathbf{v}$. As an asset can be domestic, it holds that $m \leq n$. The weight vectors are

\begin{equation} \mathbf{w}=\begin{bmatrix} w_{1} \\ w_{2} \\ \vdots \\ {w}_{n} \end{bmatrix}, \quad \mathbf{v}=\begin{bmatrix} v_{1} \\ v_{2} \\ \vdots \\ v_{m} \end{bmatrix}, \end{equation}

where $\mathbf{1}^{T}\mathbf{w} = 1$ and $\mathbf{w} \geq 0$, i.e. all the funds are invested and the portfolio is long-only.

We also have covariance matrix $C$ $(n+m)\times(n+m)$. This matrix can be expressed as partitioned matrix of asset-asset, asset-currency and currency-currency return covariances:

\begin{equation} \mathbf{C}=\begin{bmatrix} \mathbf{C_{ww}} & \mathbf{C_{wv}}\\ \mathbf{C_{vw}} & \mathbf{C_{ww}}\\ \end{bmatrix} \end{equation}

The objective function (i.e. portfolio variance) is

\begin{equation} min \quad f(\mathbf{h}) = \begin{bmatrix} \mathbf{w}\\ \mathbf{v + h} \end{bmatrix}^{T} \begin{bmatrix} \mathbf{C_{ww}} & \mathbf{C_{wv}}\\ \mathbf{C_{vw}} & \mathbf{C_{vv}}\\ \end{bmatrix} \begin{bmatrix} \mathbf{w}\\ \mathbf{v + h}\\ \end{bmatrix} \end{equation}

subject to \begin{equation}\mathbf{h} \leq 0, \quad \mathbf{- v - h} \leq 0, \\\end{equation} i.e. hedging positions are short and we cannot "overhedge" the currency exposures by short positions that are larger than the hedged exposures in absolute terms. The objective function is approximate but its not the concern here.

When I try to solve this in R using solnl in NlcOptim-package for non-linear optimization problems, the solution is relatively much dependent on initial guess for $\mathbf{h}$. How should I determine the initial guess? Do you know any potential alternatives to NlcOptim?

The R code:

h0 <- 1 * (-v) # initial guess for optimum hedge ratios is now 1

# objective function
f_obj = function(h){
  return( t(c(w, v+h)) %*% cov_mat %*% c(w, v+h) )
}

# constraining functions
f_con = function(h){
  f = NULL # no NULLs allowed in the solution
  f = rbind(f, -(v+h)) # i.e. -(v+h) <= 0
  f = rbind(f, h) # i.e. h <= 0
  return(list(ceq=NULL,c=f)) # c --> use of inequality const. only
}

h_optim <- solnl(h0, objfun=f_obj, confun=f_con)[1] # save solution only

EDIT based on a helpful comment by Mark L. Stone:

My quick try to use solve.qp instead of solnl seems to work better. Solving $\mathbf{v + h}$ instead of $\mathbf{h}$:

lw <- length(w) # no. of assets
lv <- length(v) # no. of currency exposures

# one equality constraint for each asset and two inequality constraints for 
# each currency exposure which are "v+h" from the objective function
mata <- rbind(diag(lw), matrix(0, lv, lw)
matc <- rbind(matrix(0, lw, 2*lv), cbind(diag(lv), -diag(lv)))
Amat <- cbind(mata, matc)
bvec <- c(w, rep(0, lv, -v)

h_optim <- solve.QP(cov_mat, rep(0, lw+lv), Amat, bvec, meq = lw)$solution
$\endgroup$
6
  • $\begingroup$ Presuming $C is symmetric positive semidefinite, this is a convex Quadratic Programming problem, for which any solution is a global optimum. If C is positive definite, the solution should be unique. DO the various solutions you get all have the same objective value? You an use a Quadratic Programming (QP) solver, rather than a general nonlinear solver. $\endgroup$ Commented May 31, 2018 at 10:57
  • $\begingroup$ Thank you Mark. The $C$ is symmetric semi-definite sample covariance. With solnl, I do not get the same objective function values with the various solutions. I tried to use solve.QP instead. At least so far it seems that I can get consistently better solutions with it. $\endgroup$ Commented May 31, 2018 at 15:45
  • $\begingroup$ Did solnl say that it had found the optimum? Does it even report a status? Regardless of the soundness of the underlying algorithm on which it is allegedly based, let me just say that not all Cran functions are of the top quality robustness, and assuming they are, even for not well known functions, is a perilous gamble. $\endgroup$ Commented May 31, 2018 at 15:55
  • $\begingroup$ @MarkL.Stone as far as I understand it finds a solution. Do you have an idea how can I know if solnl says the solution to be the optimum? At least it reports the information it promises. Now the objective function value seem to be higher with solnl than with solve.qp. I'm not completely sure that I was using solnl the right way as I only used the default assumptions. $\endgroup$ Commented May 31, 2018 at 16:10
  • 1
    $\begingroup$ That may be, but I will not investigate solnl further as QP solver seems to fit this problem better $\endgroup$ Commented May 31, 2018 at 16:23

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.