From: Reto Kaspar on 28 Apr 2010 12:01 Hi all, I am trying to fit a "replicating portfolio" to a given structure of cash-flows. The cash flows are in stochastic form, i.e. a set of "scenarios" with a cash flow to match for each scenario. For this, I want to solve a linear least squares problem in the form of min (y - Xb), where y(i) is my cash flow to match in scenario i X(i,j) is the cash flow generated by asset j in scenario i b(i) is my asset allocation (the vector I am trying to find) The above problem of course works perfectly using OLS. Now the complication: I would like to set a constraint of "transaction cost". This constraint is non-linear since transaction cost will be positive for both negative and positive asset allocation. My constraint is therefore in the form of abs(b)' * market value * percent transaction cost < maximum transaction cost abs(b)' and market value are vectors, the other parameters are scalars. This blows the problem out of OLS proportions. - I have tried using fmincon with an OLS objective function, but it does not converge at all, although the constraint is clearly not hit. If I remove the constraint (or use fminunc) the solver finds a perfect solution due to the global convexity of the least squares function - lsqlin is not feasible and did not even give good results when I set upper and lower bounds on allocation Does anyone have an idea how to implement this problem? Thanks in advance. Reto
From: John D'Errico on 28 Apr 2010 13:44 "Reto Kaspar" <mylastname.myfirstname(a)gmail.com> wrote in message <hr9m4h$nsg$1(a)fred.mathworks.com>... > Hi all, > > I am trying to fit a "replicating portfolio" to a given structure of cash-flows. The cash flows are in stochastic form, i.e. a set of "scenarios" with a cash flow to match for each scenario. > > For this, I want to solve a linear least squares problem in the form of > > min (y - Xb), where > y(i) is my cash flow to match in scenario i > X(i,j) is the cash flow generated by asset j in scenario i > b(i) is my asset allocation (the vector I am trying to find) > > The above problem of course works perfectly using OLS. Now the complication: > I would like to set a constraint of "transaction cost". This constraint is non-linear since transaction cost will be positive for both negative and positive asset allocation. > > My constraint is therefore in the form of > abs(b)' * market value * percent transaction cost < maximum transaction cost > > abs(b)' and market value are vectors, the other parameters are scalars. > > This blows the problem out of OLS proportions. > > - I have tried using fmincon with an OLS objective function, but it does not converge at all, although the constraint is clearly not hit. If I remove the constraint (or use fminunc) the solver finds a perfect solution due to the global convexity of the least squares function > > - lsqlin is not feasible and did not even give good results when I set upper and lower bounds on allocation You CANNOT use lsqlin, since it does not work with nonlinear constraints! > Does anyone have an idea how to implement this problem? Use fmincon. However, we cannot know that you set it up properly, or that you gave it good starting values. Did you start it at a feasible point? John
|
Pages: 1 Prev: Removing multiple rows from matrix Next: Concatenate large number of matrices |