help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: SOLSP


From: Vic Norton
Subject: Re: SOLSP
Date: Tue, 17 May 2005 16:10:02 -0400

I don't know anything about posting things on Sources-Octave, Patrik. I'd be glad to post my stuff somewhere. Perhaps someone on the "address@hidden" can advise me. That's why I'm Cc-ing this reply there.

BTW SOLSP stands for "Sharpe-Optimal Long-Short Portfolio". If anyone is curious about this application of Octave, check out
   http://www.dacor.net/norton/finance-math/sospdr/

The mathematical core of this work is an LP-style algorithm to maximize a cosine function on the convex hull of a bunch of points in a Euclidean space. It should be written in Fortran with BLAS, but I haven't written any Fortran in over 10 years -- and I'm lazy. I'm appending the description of the octave subroutine, cxjqr, below.

As I said, I don't know what to do with this stuff, Patrik. I'd be happy to share it, if anyone is interested, but I don't know how.

Regards,

Vic

At 8:51 AM -0700 5/17/05, Patrik Nyman wrote:
Hi

I have tried to find more information on the SOLSP and how it works.
Is it possible to get the solsp.m.zip posted on Sources-Octave

Regards

Patrik Nyman


*** Description of cxjqr follows ***

function  [ J, xJ, Q, R ] = cxjqr( u, A, J, xJ, Q, R )

#-------------------------------------------------------------------------------
#
# Usage:    [ J, xJ, Q, R ] = cxjqr( u, A, J, xJ, Q, R )
#
# Purpose:  Maximize the cosine function
#              cosu(p) = (u' * p)/norm(p, 2)    (norm(u, 2) = 1)
#           on the convex hull of the columns of A.
#
# Input:
#    u    - nonzero m-vector u.
#           (u is normalized to a column vector of unit length.)
#    A    - m x n matrix.
#    J    - vector of nJ distinct column indices from { 1 .. n }.
#    xJ   - vector of nJ positive numbers.
#           (xJ is normalized to sum to 1.)
#    Q    - m x nJ matrix with orthonormal columns.
#    R    - nJ x nJ nonsingular, upper-triangular matrix.
#
# Output:
#    The output J, xJ, Q, R satisfy the same conditions (but nJ changes).
#
# Further requirements and results:
#    1. A(:, J) = Q * R. (input or output)
#    2. Set p = A(:. J) * xJ. (input or output)
#       u' * p is positive and p maximizes the cosine function
#          cosu(p) = (u' * p)/((norm(u, 2) * norm(p, 2))
#       on the convex hull of the columns of A(:, J) (input),
#       on the convex hull of the columns of A (output).
#
# Application:
#    To maximize cosu on the convex hull of columns of A:
#    1. Run through the numbers u' * A. If none of these numbers is positive,
#       the maximum occurs on one of the columns of A.
#    2. Otherwise:
#       A. Find j such that that u' * A(:, j) > 0.
#       B. Set
#             J = [j],
#            xJ = [1],
#             Q = A(:, j)/norm(A(:, j), 2),
#             R = [ norm(A(:, j), 2) ].
#       C. Run
#             [ J, xJ, Q, R ] = cxjqr( u, A, J, xJ, Q, R ).
#       Then cosu achieves its maximum on the convex hull of the columns of A
#       at the point
#          p = A(:, J) * xJ.
#
#       Remark. One dimensional, initial J, xJ, Q, and R (as just described)
#       are easy to come by. Start with higher dimensional versions if
#       available.
#
#-------------------------------------------------------------------------------



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]