FreeEnergy
computes the free energy of a portfolio given the simple returns of the individual assets.FreeEnergy(pi, R, group.index = NULL)
+Inf
if group.index
is not given. A numeric vector if group.index
is given.group.index
is provided the free energy will be decompoesd using the chain rule stated in Lemma 3.1(ii) of Pal and Wong (2013), see equation (24) there. In this case the output has 1 + 1 + m
components, where m
is the number of groups defined by group.index
. The first component is the left-hand-side of (24). The second component is the first term on the right-hand-side of (24). The other m
components are the terms in the sum on the right-hand-side of (24).EnergyEntropyDecomp
pi <- c(1/3, 1/3, 1/3) # portfolio weights
R <- c(0.1, 0.02, -0.05) # simple returns
FreeEnergy(pi, R)
Run the code above in your browser using DataLab