Description Usage Arguments Details Value Author(s) See Also Examples

Computes the Sharpe ratio of the hedged Markowitz portfolio of some observed returns.

1 2 3 4 5 6 7 | ```
as.del_sropt(X, G, drag = 0, ope = 1, epoch = "yr")
## Default S3 method:
as.del_sropt(X, G, drag = 0, ope = 1, epoch = "yr")
## S3 method for class 'xts'
as.del_sropt(X, G, drag = 0, ope = 1, epoch = "yr")
``` |

`X` |
matrix of returns, or |

`G` |
an |

`drag` |
the 'drag' term, |

`ope` |
the number of observations per 'epoch'. For convenience of
interpretation, The Sharpe ratio is typically quoted in 'annualized'
units for some epoch, that is, 'per square root epoch', though returns
are observed at a frequency of |

`epoch` |
the string representation of the 'epoch', defaulting to 'yr'. |

Suppose *xi* are *n* independent draws of a *q*-variate
normal random variable with mean *mu* and covariance matrix
*Sigma*. Let *G* be a *g x q* matrix
of rank *g*.
Let *xbar* be the (vector) sample mean, and
*S* be the sample covariance matrix (using Bessel's correction).
Let

*zeta(w) = (w'xbar - c0)/sqrt(w'Sw)*

be the (sample) Sharpe ratio of the portfolio *w*, subject to
risk free rate *c0*.

Let *w** be the solution to the portfolio optimization
problem:

*max {zeta(w) | 0 < w'Sw <= R^2, G S w = 0},*

with maximum value *z* = zeta(w*)*.

Note that if `ope`

and `epoch`

are not given, the
converter from `xts`

attempts to infer the observations per epoch,
assuming yearly epoch.

An object of class `del_sropt`

.

Steven E. Pav [email protected]

Other del_sropt: `del_sropt`

,
`is.del_sropt`

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | ```
nfac <- 5
nyr <- 10
ope <- 253
# simulations with no covariance structure.
# under the null:
set.seed(as.integer(charToRaw("be determinstic")))
Returns <- matrix(rnorm(ope*nyr*nfac,mean=0,sd=0.0125),ncol=nfac)
# hedge out the first one:
G <- matrix(diag(nfac)[1,],nrow=1)
asro <- as.del_sropt(Returns,G,drag=0,ope=ope)
print(asro)
G <- diag(nfac)[c(1:3),]
asro <- as.del_sropt(Returns,G,drag=0,ope=ope)
# compare to sropt on the remaining assets
# they should be close, but not exact.
asro.alt <- as.sropt(Returns[,4:nfac],drag=0,ope=ope)
## Not run:
# using real data.
if (require(quantmod)) {
get.ret <- function(sym,...) {
OHLCV <- getSymbols(sym,auto.assign=FALSE,...)
lrets <- diff(log(OHLCV[,paste(c(sym,"Adjusted"),collapse=".",sep="")]))
# chomp first NA!
lrets[-1,]
}
get.rets <- function(syms,...) {
some.rets <- do.call("cbind",lapply(syms,get.ret,...))
}
some.rets <- get.rets(c("IBM","AAPL","A","C","SPY","XOM"))
# hedge out SPY
G <- diag(dim(some.rets)[2])[5,]
asro <- as.del_sropt(some.rets,G)
}
## End(Not run)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.