[Returnanalytics-commits] r2344 - pkg/Meucci/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Jun 17 19:05:38 CEST 2013


Author: xavierv
Date: 2013-06-17 19:05:37 +0200 (Mon, 17 Jun 2013)
New Revision: 2344

Added:
   pkg/Meucci/R/LognormalMoments2Parameters.R
Log:
added LognormalMoments2Parameters.R file

Added: pkg/Meucci/R/LognormalMoments2Parameters.R
===================================================================
--- pkg/Meucci/R/LognormalMoments2Parameters.R	                        (rev 0)
+++ pkg/Meucci/R/LognormalMoments2Parameters.R	2013-06-17 17:05:37 UTC (rev 2344)
@@ -0,0 +1,26 @@
+#' Compute the mean and standard deviation of a lognormal distribution from its parameters, as described in  
+#' A. Meucci, "Risk and Asset Allocation", Springer, 2005,  Chapter 1.
+#'
+#'	@param  e    : [scalar] expected value of the lognormal distribution
+#'  @param	v    : [scalar] variance of the lognormal distribution
+#'  
+#'  @return	mu   : [scalar] expected value of the normal distribution
+#'  @return	sig2 : [scalar] variance of the normal distribution
+#'  
+#'  @note	Inverts the formulas (1.98)-(1.99) in Risk and Asset Allocation", Springer, 2005.
+#'
+#' @references
+#' \url{http://}
+#' See Meucci's script for "LognormalMoments2Parameters"
+#'
+#' @author Xavier Valls \email{flamejat@@gmail.com}
+#' @export
+
+LognormalMoments2Parameters = function( e, v)
+{
+	sig2 = log( 1 + v / ( e^2 ) );
+	mu = log( e ) - sig2 / 2;
+	
+	return( list( sigma_square = sig2 , mu = mu ) );
+
+}
\ No newline at end of file



More information about the Returnanalytics-commits mailing list