[Returnanalytics-commits] r3945 - in pkg/Meucci: R demo man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Aug 12 10:50:54 CEST 2015


Author: xavierv
Date: 2015-08-12 10:50:54 +0200 (Wed, 12 Aug 2015)
New Revision: 3945

Modified:
   pkg/Meucci/R/DynamicPortfolioManagement.R
   pkg/Meucci/R/LognormalParameters2Statistics.R
   pkg/Meucci/R/PlotMarginalsNormalInverseWishart.R
   pkg/Meucci/R/RandNormalInverseWishart.R
   pkg/Meucci/demo/00Index
   pkg/Meucci/demo/RobustBayesianCaseStudy.R
   pkg/Meucci/demo/S_AnalyzeLognormalCorrelation.R
   pkg/Meucci/demo/S_AnalyzeNormalCorrelation.R
   pkg/Meucci/demo/S_AnalyzeNormalInverseWishart.R
   pkg/Meucci/demo/S_AutocorrelatedProcess.R
   pkg/Meucci/demo/S_DynamicManagementCase2.R
   pkg/Meucci/man/LognormalParam2Statistics.Rd
   pkg/Meucci/man/PlotMarginalsNormalInverseWishart.Rd
   pkg/Meucci/man/RandNormalInverseWishart.Rd
Log:
Formatted demo scripts and its relating functions up to S_B*

Modified: pkg/Meucci/R/DynamicPortfolioManagement.R
===================================================================
--- pkg/Meucci/R/DynamicPortfolioManagement.R	2015-08-12 07:03:47 UTC (rev 3944)
+++ pkg/Meucci/R/DynamicPortfolioManagement.R	2015-08-12 08:50:54 UTC (rev 3945)
@@ -298,8 +298,8 @@
     #set the monitoring times of interest
     t <- c(0, tau, t_view - k * tau)
     t <- sort(t)
-    t <- t[t>=0]
-    idx <- which(diff(t) < tau * 10 ^ -10) 
+    t <- t[t >= 0]
+    idx <- which(diff(t) < tau * 10 ^ -10)
     t <- t(setdiff(1:length(t), idx))
     T_ <- length(t)
 

Modified: pkg/Meucci/R/LognormalParameters2Statistics.R
===================================================================
--- pkg/Meucci/R/LognormalParameters2Statistics.R	2015-08-12 07:03:47 UTC (rev 3944)
+++ pkg/Meucci/R/LognormalParameters2Statistics.R	2015-08-12 08:50:54 UTC (rev 3945)
@@ -1,33 +1,37 @@
-#' @title Compute expectation, covariance, standard deviation and correlation for a lognormal distribution.
+#' @title Compute expectation, covariance, standard deviation and correlation
+#' for a lognormal distribution.
 #'
-#' @description Compute expectation, covariance, standard deviation and correlation for a lognormal distribution, as described in 
-#' A. Meucci "Risk and Asset Allocation", Springer, 2005.
+#' @description Compute expectation, covariance, standard deviation and
+#' correlation for a lognormal distribution, as described in A. Meucci
+#' "Risk and Asset Allocation", Springer, 2005.
 #'
 #'	@param Mu    : [vector] (N x 1) location parameter
 #'	@param Sigma : [matrix] (N x N) scale parameter
 #'
-#'  
+#'
 #'	@return Exp   : [vector] (N x 1) expectation
 #'	@return Cov   : [matrix] (N x N) covariance
 #'	@return Std   : [vector] (N x 1) standard deviation
 #'	@return	Corr  : [matrix] (N x N) correlation
 #'
 #' @references
-#' A. Meucci - "Exercises in Advanced Risk and Portfolio Management" \url{http://symmys.com/node/170}, 
-#' "E 85 - Correlation in lognormal markets".
+#' A. Meucci - "Exercises in Advanced Risk and Portfolio Management"
+#' \url{http://symmys.com/node/170}, "E 85 - Correlation in lognormal markets".
 #'
 #' See Meucci's script for "LognormalParam2Statistics.m"
 #'
-#' @author Xavier Valls \email{flamejat@@gmail.com}
+#' @author Xavier Valls \email{xaviervallspla@@gmail.com}
 #' @export
 
-LognormalParam2Statistics = function( Mu, Sigma )
+LognormalParam2Statistics <- function(Mu, Sigma)
 {
 
-	Exp  = exp( Mu + (1/2) * diag( Sigma ) );
-	Cov  = exp( Mu + (1/2) * diag( Sigma ) ) %*% t( exp( Mu + (1/2) * diag( Sigma ) ) ) * ( exp( Sigma ) - 1 );
-	Std  = sqrt( diag( Cov ) );
-	Corr = diag( 1 / Std ) %*% Cov %*% diag( 1 / Std );
+	Exp  <- exp(Mu + (1 / 2) * diag(Sigma))
+	Cov  <- exp(Mu + (1 / 2) * diag(Sigma)) %*% t(exp(Mu + (1 / 2) *
+			diag(Sigma))) * (exp(Sigma) - 1)
+	Std  <- sqrt(diag(Cov))
+	Corr <- diag(1 / Std) %*% Cov %*% diag(1 / Std)
 
-	return( list( Exp = Exp, Covariance = Cov, Standard_Deviation = Std, Correlation = Corr ) );
-}
\ No newline at end of file
+	return(list(Exp = Exp, Covariance = Cov, Standard_Deviation = Std,
+				Correlation = Corr));
+}

Modified: pkg/Meucci/R/PlotMarginalsNormalInverseWishart.R
===================================================================
--- pkg/Meucci/R/PlotMarginalsNormalInverseWishart.R	2015-08-12 07:03:47 UTC (rev 3944)
+++ pkg/Meucci/R/PlotMarginalsNormalInverseWishart.R	2015-08-12 08:50:54 UTC (rev 3945)
@@ -12,67 +12,70 @@
 #'  @note Numerically and analytically the marginal pdf of 
 #'		- the first entry of the random vector Mu
 #'		- the (1,1)-entry of the random matrix inv(Sigma)
-#'		when Mu and Sigma are jointly normal-inverse-Wishart: Mu ~ St(Mu_0,Sigma/T_0)
-#'                                                            inv(Sigma) ~ W(Nu_0,inv(Sigma_0)/Nu_0)
+#'		when Mu and Sigma are jointly normal-inverse-Wishart: 
+#'				Mu ~ St(Mu_0,Sigma/T_0)
+#'              inv(Sigma) ~ W(Nu_0,inv(Sigma_0)/Nu_0)
 #'
 #' @references
-#' A. Meucci - "Exercises in Advanced Risk and Portfolio Management" \url{http://symmys.com/node/170}.
+#' A. Meucci - "Exercises in Advanced Risk and Portfolio Management"
+#' \url{http://symmys.com/node/170}.
 #'
 #' See Meucci's script for "PlotMarginalsNormalInverseWishart.m"
 #'
-#' @author Xavier Valls \email{flamejat@@gmail.com}
+#' @author Xavier Valls \email{xaviervallspla@@gmail.com}
 #' @export
 
-PlotMarginalsNormalInverseWishart = function(Mu_Simul, InvSigma_Simul, Mu_0, T_0, Sigma_0, Nu_0, Legend)
-{
-	NumSimulations = nrow( Mu_Simul );
-	NumBins = round( 10 * log( NumSimulations ));
+PlotMarginalsNormalInverseWishart <- function(Mu_Simul, InvSigma_Simul, Mu_0,
+											  T_0, Sigma_0, Nu_0, Legend) {
+	NumSimulations <- nrow(Mu_Simul)
+	NumBins <- round(10 * log(NumSimulations))
 
-	dev.new();
+	dev.new()
 
-	#################################################################################################################
+	############################################################################
 	### Mu
 	# plot empirical pdf (histogram)
-	par( mfrow = c(2,1) );
-	h = hist(Mu_Simul[ , 1 ], NumBins, plot= FALSE);
-	D = h$mids[ 2 ] - h$mids[ 1 ];
-	n= h$counts /( D * NumSimulations );
-	plot( h$mids, n, type = "h", main = bquote(paste( .(Legend)," ",  mu)) );
-	#barplot( n );
+	par(mfrow = c(2,1))
+	h <- hist(Mu_Simul[, 1], NumBins, plot= FALSE)
+	D <- h$mids[2] - h$mids[1]
+	n <-  h$counts / (D * NumSimulations)
+	plot(h$mids, n, type = "h", main = bquote(paste(.(Legend)," ",  mu)))
+	#barplot(n)
 
 	# superimpose analytical expectation
-	points( Mu_0[ 1 ], 0,  pch = 21, bg = "red" );
-	
+	points(Mu_0[1], 0,  pch = 21, bg = "red")
 
+
 	# superimpose analytical pdf
-	x_lo = min(Mu_Simul[ ,1 ]);
-	x_hi = max(Mu_Simul[ ,1 ]);
-	x_grid = seq( x_lo, x_hi, (x_hi-x_lo)/100 );
-	m = Mu_0[ 1 ];
-	s = sqrt(Sigma_0[ 1, 1] / T_0 );
-	f = 1 / s * dt( (x_grid - m )/s, Nu_0 );
-	lines(x_grid, f ,col = "red" );
+	x_lo <- min(Mu_Simul[,1])
+	x_hi <- max(Mu_Simul[,1])
+	x_grid <- seq(x_lo, x_hi, (x_hi-x_lo) / 100)
+	m <- Mu_0[1]
+	s <- sqrt(Sigma_0[1, 1] / T_0)
+	f <- 1 / s * dt((x_grid - m)/s, Nu_0)
+	lines(x_grid, f,col = "red")
 
-	#################################################################################################################
+	############################################################################
 	### Sigma
 	# plot empirical pdf (histogram)
-	h = hist(InvSigma_Simul[  ,1 ], NumBins, plot= FALSE );
-	D = h$mids[ 2 ] - h$mids[ 1 ];
-	n= h$counts /( D * NumSimulations );
-	plot( h$mids, n, type = "h", main = bquote(paste( .(Legend),  " inv(Sigma)")) );
-	
+	h <- hist(InvSigma_Simul[,1], NumBins, plot= FALSE)
+	D <- h$mids[2] - h$mids[1]
+	n <-  h$counts /(D * NumSimulations)
+	plot(h$mids, n, type = "h", main = bquote(paste(.(Legend),
+		  "inv(Sigma)")))
+
 	# superimpose analytical expectation
-	InvSigma_0=solve(Sigma_0);
-	points(InvSigma_0[ 1, 1 ],0, pch = 21, bg = "red" );
+	InvSigma_0 <- solve(Sigma_0)
+	points(InvSigma_0[1, 1], 0, pch = 21, bg = "red")
 
 
 	# superimpose analytical pdf
-	x_lo = min(InvSigma_Simul[ ,1 ]);
-	x_hi = max(InvSigma_Simul[ ,1 ]);
-	x_grid = seq( x_lo, x_hi, (x_hi-x_lo)/100 );
-	sigma_square = InvSigma_0[ 1, 1] / Nu_0;
-	A = Nu_0 / 2;
-	B = 2 * sigma_square;
-	f = dgamma(x_grid, shape = A, scale = B);
-	lines(x_grid, f, col = "red" );
-}
\ No newline at end of file
+	x_lo <- min(InvSigma_Simul[,1])
+	x_hi <- max(InvSigma_Simul[,1])
+	x_grid <- seq(x_lo, x_hi, (x_hi - x_lo) / 100)
+	sigma_square <- InvSigma_0[1, 1] / Nu_0
+	A <- Nu_0 / 2
+	B <- 2 * sigma_square
+	f <- dgamma(x_grid, shape = A, scale = B)
+	lines(x_grid, f, col = "red")
+}

Modified: pkg/Meucci/R/RandNormalInverseWishart.R
===================================================================
--- pkg/Meucci/R/RandNormalInverseWishart.R	2015-08-12 07:03:47 UTC (rev 3944)
+++ pkg/Meucci/R/RandNormalInverseWishart.R	2015-08-12 08:50:54 UTC (rev 3945)
@@ -1,7 +1,9 @@
-#' @title Generates a multivariate i.i.d. sample of lenght J from the normal-inverse-Wishart distribution.
+#' @title Generates a multivariate i.i.d. sample of lenght J from the
+#' normal-inverse-Wishart distribution.
 #'
-#' @description Generates a multivariate i.i.d. sample of lenght J from the normal-inverse-Wishart distribution, as described in 
-#' A. Meucci "Risk and Asset Allocation", Springer, 2005.
+#' @description Generates a multivariate i.i.d. sample of lenght J from the 
+#' normal-inverse-Wishart distribution, as described in A. Meucci "Risk and
+#' Asset Allocation", Springer, 2005.
 #'
 #'  @param  Mu_0      [vector]  location parameter.
 #'  @param  T_0       [scalar]  number of observations.
@@ -9,49 +11,50 @@
 #'  @param  nu_0      [scalar]  degrees of freedom. 
 #'  @param  J         [scalar]  number of simulations to compute.
 #'  
-#'  @return Mu        [vector] location parameter from the normal-inverse-Wishart distribution.
-#'  @return Sigma     [matrix] dispersion parameter from the normal-inverse-Wishart distribution.
-#'  @return InvSigma  [matrix] inverse of the dispersion parameter from the normal-inverse-Wishart distribution.
+#'  @return Mu        [vector] location parameter from the
+#'                             normal-inverse-Wishart distribution.
+#'  @return Sigma     [matrix] dispersion parameter from the
+#'                             normal-inverse-Wishart distribution.
+#'  @return InvSigma  [matrix] inverse of the dispersion parameter from the
+#'                             normal-inverse-Wishart distribution.
 #'
 #'  @note 
-#'  \deqn{\mu\| \Sigma \sim N(\mu_{0}, \frac{\Sigma}{T_{0}}) }{Mu|Sigma   ~ N(Mu_0,Sigma/T_0)}
-#'  \deqn{\Sigma^{-1} \sim W(\nu_{0},\frac{\Sigma_{0}^{-1}}{\nu_{0}})}{inv(Sigma) ~ W(Nu_0,inv(Sigma_0)/Nu_0)}
+#'  \deqn{\mu\| \Sigma \sim N(\mu_{0}, \frac{\Sigma}{T_{0}}) }
+#'      {Mu|Sigma ~ N(Mu_0,Sigma/T_0)}
+#'  \deqn{\Sigma^{-1} \sim W(\nu_{0},\frac{\Sigma_{0}^{-1}}{\nu_{0}})}
+#'      {inv(Sigma) ~ W(Nu_0,inv(Sigma_0)/Nu_0)}
 #'
 #' @references
-#' A. Meucci - "Exercises in Advanced Risk and Portfolio Management" \url{http://symmys.com/node/170}.
-#' See Meucci's script for "RandNormalInverseWishart.m"
+#' A. Meucci - "Exercises in Advanced Risk and Portfolio Management"
+#' \url{http://symmys.com/node/170}. See Meucci's script for
+#'  "RandNormalInverseWishart.m"
 #'
-#' @author Xavier Valls \email{flamejat@@gmail.com}
+#' @author Xavier Valls \email{xaviervallspla@@gmail.com}
 #' @export
 
-RandNormalInverseWishart = function(Mu_0, T_0, Sigma_0, nu_0, J)
-{
-  N = length( Mu_0 );
-  VecIndex = NULL;
-  for( n in 1 : N )
-  {
-      VecIndex[ n ] = cbind( VecIndex, ( n-1 ) * N +( n:N ) ); ##ok<AGROW>
+RandNormalInverseWishart <- function(Mu_0, T_0, Sigma_0, nu_0, J) {
+  N <- length(Mu_0)
+  VecIndex <- NULL
+  for (n in 1 : N) {
+      VecIndex[n] <- cbind(VecIndex, (n - 1) * N + (n:N))
   }
 
-  invSigma_0 = solve(Sigma_0) %*% diag( 1, dim( Sigma_0 ));
-  Phi = invSigma_0 / nu_0;
+  invSigma_0 <- solve(Sigma_0) %*% diag(1, dim(Sigma_0))
+  Phi <- invSigma_0 / nu_0
 
-  Mu       = NULL;
-  Sigma    = NULL;
-  InvSigma = NULL;
+  Mu       <- NULL
+  Sigma    <- NULL
+  InvSigma <- NULL
 
-  for( j in 1 : J )
-  { 
-      Inv_Sigma = rwishart( df = nu_0, Sigma = Phi );
-      InvSigma  = rbind( InvSigma, Inv_Sigma[ VecIndex ] );    
-               
-      S = solve(Inv_Sigma) %*% diag( 1, dim( Inv_Sigma ) );
-      Sigma = rbind( Sigma, S[VecIndex] );
-      
-      M = rmvnorm( nrow(Mu_0) * nrow(S/T_0), Mu_0, S/T_0);
-      Mu = rbind( Mu, M );
+  for (j in 1 : J) {
+      Inv_Sigma <- rwishart(df = nu_0, Sigma = Phi)
+      InvSigma  <- rbind(InvSigma, Inv_Sigma[VecIndex])
+
+      S <- solve(Inv_Sigma) %*% diag(1, dim(Inv_Sigma))
+      Sigma <- rbind(Sigma, S[VecIndex])
+
+      M <- rmvnorm(nrow(Mu_0) * nrow(S / T_0), Mu_0, S / T_0)
+      Mu <- rbind(Mu, M)
   }
-
-  return( list( Mu = Mu, Sigma = Sigma , InvSigma = InvSigma  ) )
+  return(list(Mu = Mu, Sigma = Sigma, InvSigma = InvSigma))
 }
-

Modified: pkg/Meucci/demo/00Index
===================================================================
--- pkg/Meucci/demo/00Index	2015-08-12 07:03:47 UTC (rev 3944)
+++ pkg/Meucci/demo/00Index	2015-08-12 08:50:54 UTC (rev 3945)
@@ -1,107 +1,234 @@
-AnalyticalvsNumerical       		 compares the numerical and the analytical solution of entropy-pooling
-ButterflyTrading            		 performs the butterfly-trading case study for the Entropy-Pooling approach by Attilio Meucci
-DetectOutliersviaMVE        		 detects outliers in two-asset and multi-asset case
-FullyFlexibleBayesNets      		 uses Entropy Pooling to compute Fully Flexible Bayesian networks for risk management
-FullFlexProbs						 uses Entropy Pooling to compute Fully Flexible Probabilities for historical scenarios
-FullyIntegratedLiquidityAndMarketRisk	 computes the liquidity-risk and funding-risk adjusted P&L distribution
-HermiteGrid_CaseStudy       		 estimates the prior of a hedge fund return and processes extreme views on CVaR according to Entropy Pooling
-HermiteGrid_CVaR_Recursion  		 illustrates the discrete Newton recursion  to process views on CVaR according to Entropy Pooling
-HermiteGrid_demo            		 compares the performance of plain Monte Carlo versus grid in applying Entropy Pooling to process extreme views
-InvariantProjection         		 projects summary statistics to arbitrary horizons under i.i.d. assumption
-MeanDiversificationFrontier  computes the mean-diversification efficient frontier
-Prior2Posterior             		 compares the numerical and the analytical solution of entropy-pooling
-RankingInformation          		 performs ranking allocation using the Entropy-Pooling approach by Attilio Meucci
-RobustBayesianAllocation    		 replicates the example from Meucci's MATLAB script S_SimulationsCaseStudy.M             
-S_AnalyzeLognormalCorrelation		 considers a bivariate lognormal market and display the correlation and the condition number of the covariance matrix
-S_AnalyzeNormalCorrelation      	 considers a bivariate normal market and display the correlation and the condition number of the covariance matrix    
-S_AnalyzeNormalInverseWishart   	 familiarizes the users with multivariate Bayesian estimation.   
-S_AutocorrelatedProcess				 simulates a Ornstein-Uhlenbeck AR(1) process
-S_BivariateSample               	 generates draws from a bivariate distribution with different marginals    
-S_BlackLittermanBasic           	 describes to basic market-based Black-Litterman approach    
-S_BondProjectionPricingNormal   	 projects the distribution of the market invariants for the bond markets from the estimation interval to the investment horizon   
-S_BondProjectionPricingStudentT 	 projects the distribution of the market invariants for the bond markets from the estimation interval to the investment horizon (Student's T assumption)
+AnalyticalvsNumerical       		 compares the numerical and the analytical
+ solution of entropy-pooling
+ButterflyTrading            		 performs the butterfly-trading case study
+ for the Entropy-Pooling approach by Attilio Meucci
+DetectOutliersviaMVE        		 detects outliers in two-asset and
+ multi-asset case
+FullyFlexibleBayesNets      		 uses Entropy Pooling to compute Fully
+ Flexible Bayesian networks for risk management
+FullFlexProbs						 uses Entropy Pooling to compute Fully
+ Flexible Probabilities for historical scenarios
+FullyIntegratedLiquidityAndMarketRisk	 computes the liquidity-risk and
+ funding-risk adjusted P&L distribution
+HermiteGrid_CaseStudy       		 estimates the prior of a hedge fund return
+ and processes extreme views on CVaR according to Entropy Pooling
+HermiteGrid_CVaR_Recursion  		 illustrates the discrete Newton recursion
+  to process views on CVaR according to Entropy Pooling
+HermiteGrid_demo            		 compares the performance of plain Monte
+ Carlo versus grid in applying Entropy Pooling to process extreme views
+InvariantProjection         		 projects summary statistics to arbitrary
+ horizons under i.i.d. assumption
+MeanDiversificationFrontier  computes the mean-diversification efficient
+ frontier
+Prior2Posterior             		 compares the numerical and the analytical
+ solution of entropy-pooling
+RankingInformation          		 performs ranking allocation using the
+ Entropy-Pooling approach by Attilio Meucci
+RobustBayesianAllocation    		 replicates the example from Meucci's
+ MATLAB script S_SimulationsCaseStudy.M             
+S_AnalyzeLognormalCorrelation		 considers a bivariate lognormal market
+ and display the correlation and the condition number of the covariance matrix
+S_AnalyzeNormalCorrelation      	 considers a bivariate normal market and
+ display the correlation and the condition number of the covariance matrix    
+S_AnalyzeNormalInverseWishart   	 familiarizes the users with multivariate
+ Bayesian estimation.   
+S_AutocorrelatedProcess				 simulates a Ornstein-Uhlenbeck AR(1)
+ process
+S_BivariateSample               	 generates draws from a bivariate
+ distribution with different marginals    
+S_BlackLittermanBasic           	 describes to basic market-based
+ Black-Litterman approach    
+S_BondProjectionPricingNormal   	 projects the distribution of the market
+ invariants for the bond markets from the estimation interval to the investment
+ horizon   
+S_BondProjectionPricingStudentT 	 projects the distribution of the market
+ invariants for the bond markets from the estimation interval to the investment
+ horizon (Student's T assumption)
 S_BuyNHold                    		 illustrates the buy & hold dynamic strategy     
-S_CPPI                        		 illustrates the CPPI (constant proportion portfolio insurance) dynamic strategy     
-S_CallsProjectionPricing      		 projects the distribution of the market invariants for the derivatives market and computes the distribution of prices at the investment horizon  
-S_CheckDiagonalization      		 verifies the correctness of the eigenvalue-eigenvector representation in terms of real matrices for the transition matrix of an OU process 
-S_CornishFisher              		 compares the Cornish-Fisher estimate of the VaR with the true analytical VaR under the lognormal assumptions       
-S_CorrelationPriorUniform    		 shows how a jointly uniform prior on the correlations implies that the marginal distribution of each correlation is peaked around zero       
-S_CovarianceEvolution       		 represents the evolution of the covariance of an OU process in terms of the dispersion ellipsoid   
-S_CrossSectionConstrainedIndustries  fits a cross-sectional linear factor model creating industry factors, where the industry factors are constrained to be uncorrelated with the market
-S_CrossSectionIndustries 			 fits a cross-sectional linear factor model creating industry factors           
-S_DerivativesInvariants      		 performs the quest for invariance in the derivatives market       
-S_DeterministicEvolution   			 animates the evolution of the determinstic component of an OU process
-S_DisplayLognormalCopulaPdf          displays the pdf of the copula of a lognormal distribution 
-S_DisplayNormalCopulaCdf             displays the cdf of the copula of a normal distribution
-S_DisplayNormalCopulaPdf             displays the pdf of the copula of a normal distribution
-S_DisplayStudentTCopulaPdf           displays the pdf of the copula of a Student t distribution
-S_ESContributionFactors              computes the expected shortfall and the contributions to ES from each factor in simulations 	
-S_ESContributionsStudentT         	 computes the expected shortfall and the contributions to ES from each security  
-S_EigenvalueDispersion               displays the sample eigenvalues dispersion phenomenon
-S_EllipticalNDim                     decomposes the N-variate normal distribution into its radial and uniform components to generate an elliptical distribution
+S_CPPI                        		 illustrates the CPPI (constant proportion
+ portfolio insurance) dynamic strategy     
+S_CallsProjectionPricing      		 projects the distribution of the market
+ invariants for the derivatives market and computes the distribution of prices
+ at the investment horizon  
+S_CheckDiagonalization      		 verifies the correctness of the
+ eigenvalue-eigenvector representation in terms of real matrices for the
+ transition matrix of an OU process 
+S_CornishFisher              		 compares the Cornish-Fisher estimate of
+ the VaR with the true analytical VaR under the lognormal assumptions       
+S_CorrelationPriorUniform    		 shows how a jointly uniform prior on the
+ correlations implies that the marginal distribution of each correlation is
+ peaked around zero       
+S_CovarianceEvolution       		 represents the evolution of the covariance
+ of an OU process in terms of the dispersion ellipsoid   
+S_CrossSectionConstrainedIndustries  fits a cross-sectional linear factor model
+ creating industry factors, where the industry factors are constrained to be
+ uncorrelated with the market
+S_CrossSectionIndustries 			 fits a cross-sectional linear factor model
+ creating industry factors           
+S_DerivativesInvariants      		 performs the quest for invariance in the
+ derivatives market       
+S_DeterministicEvolution   			 animates the evolution of the determinstic
+ component of an OU process
+S_DisplayLognormalCopulaPdf          displays the pdf of the copula of a
+ lognormal distribution 
+S_DisplayNormalCopulaCdf             displays the cdf of the copula of a normal
+ distribution
+S_DisplayNormalCopulaPdf             displays the pdf of the copula of a normal
+ distribution
+S_DisplayStudentTCopulaPdf           displays the pdf of the copula of a Student
+ t distribution
+S_ESContributionFactors              computes the expected shortfall and the
+ contributions to ES from each factor in simulations 	
+S_ESContributionsStudentT         	 computes the expected shortfall and the
+ contributions to ES from each security  
+S_EigenvalueDispersion               displays the sample eigenvalues dispersion
+ phenomenon
+S_EllipticalNDim                     decomposes the N-variate normal
+ distribution into its radial and uniform components to generate an elliptical
+  distribution
 S_EntropyView						 illustrates the Entropy Pooling approach
-S_EquitiesInvariants                 performs the quest for invariance in the stock market
-S_EquityProjectionPricing            projects the distribution of the market invariants for the stock market from the estimation interval (normal assumption) to the investment horizon. Then it computes the distribution of prices at the investment horizon analytically.
-S_EstimateExpectedValueEvaluation 	 script familiarizes the user with the evaluation of an estimator replicability, loss, error, bias and inefficiency 
-S_EstimateMomentsComboEvaluation     familiarizes the user with the evaluation of an estimator: replicability, loss, error, bias and inefficiency 
-S_EstimateQuantileEvaluation         familiarizes the user with the evaluation of an estimator: replicability, loss, error, bias and inefficiency 
-S_Estimator                          familiarizes the user with the evaluation of an estimator: replicability, loss, error, bias and inefficiency 
+S_EquitiesInvariants                 performs the quest for invariance in the
+ stock market
+S_EquityProjectionPricing            projects the distribution of the market
+ invariants for the stock market from the estimation interval (normal
+ assumption) to the investment horizon. Then it computes the distribution of
+ prices at the investment horizon analytically.
+S_EstimateExpectedValueEvaluation 	 script familiarizes the user with the
+ evaluation of an estimator replicability, loss, error, bias and inefficiency 
+S_EstimateMomentsComboEvaluation     familiarizes the user with the evaluation
+ of an estimator: replicability, loss, error, bias and inefficiency 
+S_EstimateQuantileEvaluation         familiarizes the user with the evaluation
+ of an estimator: replicability, loss, error, bias and inefficiency 
+S_Estimator                          familiarizes the user with the evaluation
+ of an estimator: replicability, loss, error, bias and inefficiency 
 S_EvaluationGeneric                  determines the optimal allocation
-S_ExactMeanAndCovariance             generate draws from a multivariate normal with matching mean and covariance
-S_ExpectationMaximizationHighYield   implements the Expectation-Maximization (EM) algoritm, which estimates the parameters of a multivariate normal distribution when some observations are randomly missing
-S_ExtremeValueTheory                 computes the quantile (VaR) analytically, in simulations and using the extreme value theory approximation
-S_FactorAnalysisNotOk                illustrates the hidden factor analysis puzzle
-S_FactorResidualCorrelation          illustrates exogenous loadings and endogenous factors the true analytical VaR under the lognormal assumptions from the estimation interval to the investment horizon
-S_FitProjectRates           		 fits the swap rates dynamics to a multivariate Ornstein-Uhlenbeck process and computes and plots the estimated future distribution
-S_FitSwapToStudentT                  demonstrates the recursive ML estimation of the location and scatter parameters of a multivariate Student t distribution
-S_FixedIncomeInvariants              performs the quest for invariance in the fixed income market
+S_ExactMeanAndCovariance             generate draws from a multivariate normal
+ with matching mean and covariance
+S_ExpectationMaximizationHighYield   implements the Expectation-Maximization
+ (EM) algoritm, which estimates the parameters of a multivariate normal
+ distribution when some observations are randomly missing
+S_ExtremeValueTheory                 computes the quantile (VaR) analytically,
+ in simulations and using the extreme value theory approximation
+S_FactorAnalysisNotOk                illustrates the hidden factor analysis
+ puzzle
+S_FactorResidualCorrelation          illustrates exogenous loadings and
+ endogenous factors the true analytical VaR under the lognormal assumptions from
+  the estimation interval to the investment horizon
+S_FitProjectRates           		 fits the swap rates dynamics to a
+ multivariate Ornstein-Uhlenbeck process and computes and plots the estimated
+ future distribution
+S_FitSwapToStudentT                  demonstrates the recursive ML estimation of
+ the location and scatter parameters of a multivariate Student t distribution
+S_FixedIncomeInvariants              performs the quest for invariance in the
+ fixed income market
 S_FullCodependence                   illustrates the concept of co-dependence
-S_FxCopulaMarginal                   displays the empirical copula of a set of market variables
+S_FxCopulaMarginal                   displays the empirical copula of a set of
+ market variables
 S_GenerateMixtureSample              generates draws from a univarite mixture
-S_HedgeOptions                       compares hedging based on Black-Scholes deltas with Factors on Demand hedging
-S_HorizonEffect                      studies horizon effect on explicit factors / implicit loadings linear model
-S_InvestorsObjective                 familiarizes the users with the objectives of different investors in a highly non-normal bi-variate  market of securities
+S_HedgeOptions                       compares hedging based on Black-Scholes
+ deltas with Factors on Demand hedging
+S_HorizonEffect                      studies horizon effect on explicit factors/
+implicit loadings linear model
+S_InvestorsObjective                 familiarizes the users with the objectives
+ of different investors in a highly non-normal bi-variate  market of securities
 S_JumpDiffusionMerton                simulates a jump-diffusion process
-S_LinVsLogReturn                     project a distribution in the future according to the i.i.d.-implied square-root rule
+S_LinVsLogReturn                     project a distribution in the future
+ according to the i.i.d.-implied square-root rule
 S_LognormalSample                    simulate univariate lognormal variables
-S_MarkovChainMonteCarlo              illustrates the Metropolis-Hastings algorithm
-S_MaxMinVariance                     dispays location-dispersion ellipsoid and statistic
-S_MaximumLikelihood                  performs ML under a non-standard parametric set of distributions
-S_MeanVarianceBenchmark              projects the distribution of the market invariants for the bond and stock markets from the estimation interval to the investment horizon. Then it computes the distribution of prices at the investment horizon and translates this distribution into the returns distribution
-S_MeanVarianceCalls                  computes the mean-variance frontier of a set of options
-S_MeanVarianceHorizon                projects the distribution of the market invariants for the bond and stock markets from the estimation interval to the investment horizon. Then it computes the distribution of prices at the investment horizon and performs the two-step mean-variance optimization in terms of returns and relative portfolio weights.
-S_MeanVarianceOptimization           projects the distribution of the market invariants for the bond and stock markets from the estimation interval to the investment horizon. Then it computes the distribution of prices at the investment horizon and performs the two-step mean-variance optimization.
-S_MultiVarSqrRootRule                illustrates the multivariate square root rule-of-thumb
-S_NonAnalytical                      generates draws for the sum of random variable
+S_MarkovChainMonteCarlo              illustrates the Metropolis-Hastings
+ algorithm
+S_MaxMinVariance                     dispays location-dispersion ellipsoid and
+ statistic
+S_MaximumLikelihood                  performs ML under a non-standard parametric
+ set of distributions
+S_MeanVarianceBenchmark              projects the distribution of the market
+ invariants for the bond and stock markets from the estimation interval to the
+  investment horizon. Then it computes the distribution of prices at the
+  investment horizon and translates this distribution into the returns
+  distribution
+S_MeanVarianceCalls                  computes the mean-variance frontier of a
+ set of options
+S_MeanVarianceHorizon                projects the distribution of the market
+ invariants for the bond and stock markets from the estimation interval to the
+ investment horizon. Then it computes the distribution of prices at the
+ investment horizon and performs the two-step mean-variance optimization in
+ terms of returns and relative portfolio weights.
+S_MeanVarianceOptimization           projects the distribution of the market
+ invariants for the bond and stock markets from the estimation interval to the
+ investment horizon. Then it computes the distribution of prices at the
+ investment horizon and performs the two-step mean-variance optimization.
+S_MultiVarSqrRootRule                illustrates the multivariate square root
+ rule-of-thumb
+S_NonAnalytical                      generates draws for the sum of random
+ variable
 S_NormalSample                       simulate univariate normal variables
-S_OrderStatisticsPdfLognormal        script shows that the pdf of the r-th order statistics of a lognormal random variable
-S_OrderStatisticsPdfStudentT         script shows that the pdf of the r-th order statistics of a tudent t random variable
-S_PasturMarchenko                    illustrate the Marchenko-Pastur limit of runifom matrix theory
-S_ProjectNPriceMvGarch               fits a multivariate GARCH model and projects the distribution of the compounded returns from the estimation interval to the investment horizon. Then it computes the distribution of prices at the investment horizon. 
-S_ProjectSummaryStatistics           projects summary statistics to arbitrary horizons
-S_PureResidualBonds                  models the joint distribution of the yet-to-be realized key rates of the government curve
+S_OrderStatisticsPdfLognormal        script shows that the pdf of the r-th order
+ statistics of a lognormal random variable
+S_OrderStatisticsPdfStudentT         script shows that the pdf of the r-th order
+ statistics of a tudent t random variable
+S_PasturMarchenko                    illustrate the Marchenko-Pastur limit of
+ runifom matrix theory
+S_ProjectNPriceMvGarch               fits a multivariate GARCH model and
+ projects the distribution of the compounded returns from the estimation
+ interval to the investment horizon. Then it computes the distribution of prices
+ at the investment horizon. 
+S_ProjectSummaryStatistics           projects summary statistics to arbitrary
+ horizons
+S_PureResidualBonds                  models the joint distribution of the
+ yet-to-be realized key rates of the government curve
 S_ResidualAnalysisTheory             performs the analysis of residuals
 S_SelectionHeuristics                computes the r-square of selected factors
-S_SemiCircular                       illustrate the semi-circular law of random matrix theory
[TRUNCATED]

To get the complete diff run:
    svnlook diff /svnroot/returnanalytics -r 3945


More information about the Returnanalytics-commits mailing list