I was looking at the assetsStat function as an example for my 
investments class for calculating portfolio statistics. The 
documentation said it was developed for monthly data and rescaling was a 
problem.  I reviewed the code to determine the rescaling factors I would 
need for daily or weekly data when I noticed the following two lines of 
code (bold face in the function attached at the bottom).
* *       result[3, i] = annualizedAverage = mean(r) * sqrt(12)
        result[4, i] = annualizedVolatility = sqrt(var(r))
the AnnualizedAverage in multiplied by the sqrt(12) should this be just 
12? and the following line of code have the standard deviation 
multiplied by the sqrt(12) or sqrt(var(r)*12)?

Thank you
Joe

function (x)
{
    statistics = 14
    if (is.null(dim(x))) {
        n = 1
        x = matrix(x, length(x))
        result = matrix(rep(0, times = statistics), ncol = 1)
    }
    else {
        n = dim(x)[2]
        result = matrix(rep(0, times = statistics * n), ncol = n)
    }
    stat.names = c("Records", "paMean", "paAve", "paVola", "paSkew",
        "paKurt", "maxDD", "TUW", "mMaxLoss", "mVaR", "mModVaR",
        "mSharpe", "mModSharpe", "skPrice")
    dimnames(result) = list(stat.names, dimnames(x)[[2]])
    for (i in 1:n) {
        r = x[, i]
        result[1, i] = length(r)
        result[2, i] = annualizedMean = (1 + mean(r))^12 - 1
*        result[3, i] = annualizedAverage = mean(r) * sqrt(12)
        result[4, i] = annualizedVolatility = sqrt(var(r))
*        result[5, i] = annualizedSkewness = skewness(r)
        result[6, i] = annualizedKurtosis = kurtosis(r)
        result[7, i] = maxDrawdown = max(cummax(cumsum(r)) -
            cumsum(r))
        result[8, i] = timeUnderWater = 
max(diff(which(diff(cummax(cumsum(r))) !=
            0)))
        result[9, i] = maxMonthlyLoss = min(r)
        zc = 2.33
        result[10, i] = monthlyVaR = annualizedMean - zc * 
annualizedVolatility
        p = 0.99
        s = annualizedSkewness
        k = annualizedKurtosis
        zcf = zc + (zc * zc - 1) * s/6 + zc * (zc * zc - 3) *
            k/24 + zc * (2 * zc * zc - 5) * s * s/36
        result[11, i] = monthlyModVaR = annualizedMean - zcf *
            annualizedVolatility
        result[12, i] = monthlySharpeRatio = 
annualizedMean/annualizedVolatility
        result[13, i] = monthlyModSharpeRatio = annualizedMean/monthlyModVaR
        result[14, i] = skewnesskurtosisPrice = annualizedMean *
            (monthlyModVaR/monthlyVaR - 1)
    }
    ans = as.data.frame(round(result, digits = 3))
    ans
}


	[[alternative HTML version deleted]]

