[Returnanalytics-commits] r2192 - pkg/PerformanceAnalytics/sandbox/Meucci/R
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Mon Jul 23 02:11:22 CEST 2012
Author: mkshah
Date: 2012-07-23 02:11:22 +0200 (Mon, 23 Jul 2012)
New Revision: 2192
Modified:
pkg/PerformanceAnalytics/sandbox/Meucci/R/DetectOutliersviaMVE.R
pkg/PerformanceAnalytics/sandbox/Meucci/R/RankingInformation.R
pkg/PerformanceAnalytics/sandbox/Meucci/R/RobustBayesianAllocation.R
Log:
Updating comments and correcting code
Modified: pkg/PerformanceAnalytics/sandbox/Meucci/R/DetectOutliersviaMVE.R
===================================================================
--- pkg/PerformanceAnalytics/sandbox/Meucci/R/DetectOutliersviaMVE.R 2012-07-22 23:58:54 UTC (rev 2191)
+++ pkg/PerformanceAnalytics/sandbox/Meucci/R/DetectOutliersviaMVE.R 2012-07-23 00:11:22 UTC (rev 2192)
@@ -23,7 +23,7 @@
library( matlab )
# parameter checks
- if ( ncol( corruptSample ) > nrow( corruptSample ) ) { stop("The number of assets must be greater than number of observations (otherwise system is singular)") }
+ if ( ncol( sample ) > nrow( sample ) ) { stop("The number of assets must be greater than number of observations (otherwise system is singular)") }
# initialize parameters
T = nrow( sample )
@@ -203,6 +203,7 @@
#' @param numGoodSamples number of observations drawn from the covariance matrix
#' @param numOutliers number of outliers added to sample
#' @param covarianceMatrix the covariance matrix for the asset returns from which good samples will be drawn
+#' @param shuffle a boolean suggesting whether order of the twos should be shuffled
#'
#' @return sample a matrix of returns consisting of good and bad sample. Rows are observations, columns are the assets.
#' @author Ram Ahluwalia \email{ram@@wingedfootcapital.com}
Modified: pkg/PerformanceAnalytics/sandbox/Meucci/R/RankingInformation.R
===================================================================
--- pkg/PerformanceAnalytics/sandbox/Meucci/R/RankingInformation.R 2012-07-22 23:58:54 UTC (rev 2191)
+++ pkg/PerformanceAnalytics/sandbox/Meucci/R/RankingInformation.R 2012-07-23 00:11:22 UTC (rev 2192)
@@ -6,8 +6,8 @@
# TODO: confirm QuadProg does not have a bug (i.e. it can optimize expected returns without use dvec by adding an equality constraint)
#' Generate a Stacked Bar Chart based on the frontier weights matrix
-#' @param a matrix of weights where rows are efficient portfolios summing to one, and columns are assets
-#' @param a string indicating the title of the chart
+#'
+#' @param weightsMatrix a matrix of weights where rows are efficient portfolios summing to one, and columns are assets
StackedBarChart = function( weightsMatrix )
{
data = as.data.frame( weightsMatrix )
@@ -18,6 +18,9 @@
}
#' view the rankings
+#'
+#' @param X a vector containing returns for all the asset classes
+#' @param p a vector containing the prior probability values
#' @param Lower a vector of indexes indicating which column is lower than the corresponding column number in Upper
#' @param Upper a vector of indexes indicating which column is lower than the corresponding column number in Upper
#' @export EntropyProg
Modified: pkg/PerformanceAnalytics/sandbox/Meucci/R/RobustBayesianAllocation.R
===================================================================
--- pkg/PerformanceAnalytics/sandbox/Meucci/R/RobustBayesianAllocation.R 2012-07-22 23:58:54 UTC (rev 2191)
+++ pkg/PerformanceAnalytics/sandbox/Meucci/R/RobustBayesianAllocation.R 2012-07-23 00:11:22 UTC (rev 2192)
@@ -179,13 +179,13 @@
#' \\ \mu_{1} \equiv \frac{1}{ T_{1} } \big( T_{0} \mu_{0} + T \hat{ \mu } \big)
#' \\ \nu_{1} \equiv \nu_{0} + T
#' \\ \Sigma_{1} \equiv \big( \nu_{0} \Sigma_{0} + T \hat{ \Sigma } + \frac{ \big(\mu_{0} - \hat{\mu} \big) \big(\mu_{0} - \hat{\mu} \big)' }{ \big( \frac{1}{T} + \frac{1}{T_{0} } \big) } }
-#' @param mean the mean of the sample returns
-#' @param cov the sample covariance matrix
-#' @param mean_prior the prior for the mean returns
-#' @param cov_prior the covariance matrix prior
-#' @param confidenceInMeanPrior a numeric with the relative confidence in the mean prior vs. the sample mean. A value of 2 indicates twice as much weight to assign to the prior vs. the sample data. Must be greater than or equal to zero
-#' @param confidenceInCovPrior a numeric with the relative confidence in the covariance prior vs. the sample covariance. A value of 2 indicates twice as much weight to assign to the prior vs. the sample data. Must be greater than or equal to zero
-#' @param sampleSize a numeric with the number of rows in the sample data used to estimate mean_sample and cov_sample
+#' @param mean_sample the mean of the sample returns
+#' @param cov_sample the sample covariance matrix
+#' @param mean_prior the prior for the mean returns
+#' @param cov_prior the covariance matrix prior
+#' @param relativeConfidenceInMeanPrior a numeric with the relative confidence in the mean prior vs. the sample mean. A value of 2 indicates twice as much weight to assign to the prior vs. the sample data. Must be greater than or equal to zero
+#' @param relativeConfidenceInCovPrior a numeric with the relative confidence in the covariance prior vs. the sample covariance. A value of 2 indicates twice as much weight to assign to the prior vs. the sample data. Must be greater than or equal to zero
+#' @param sampleSize a numeric with the number of rows in the sample data used to estimate mean_sample and cov_sample
#'
#' @return mean_post a vector with the confidence weighted posterior mean vector of asset returns blended from the prior and sample mean vector
#' @return cov_post a covariance matrix the confidence weighted posterior covariance matrix of asset returns blended from the prior and sample covariance matrix
More information about the Returnanalytics-commits
mailing list