Thanks for the reply Matt. It looks like you are creating a returns time
series from an estimated return vector and cov matrix. I agree, there has
to be a better way in this package to simply use an expected return vector
and estimated cov matrix. Going through the documentation seems to suggest
a tie in with the portfolioData(data, spec=portfolioSpec()) function. The
documentation even says ....

data
[portfolioStatistics] -
a time series or a named list, containing either a series of returns or
named entries 'mu' and 'Sigma' being mean and covariance matrix.

But no information on the format of the list. Under details, there's even a
reference to list data. But the documentation doesn't specify the actual
name of the data. From the documentation on portfolioData:

Simulated Mean-Cov Data Set:

This data is taken from chapter 1.3.2 in Scherer, M., Martin, R.D. (2005);
Introduction To Modern Portfolio Optimization with NuOPT, S-PLUS and
S+Bayes, Springer, Berlin. It is a list of covariance matrix and the return
means of imaginary assets. It is an example set for learning about
optimization.

I also tried : example(portfolioData) but I get back the cryptic:

prtflD> ## ...
prtflD>
prtflD>
prtflD>

Under "Examples" in the documentation for portfolioData,. there's another
crptic ...

Examples

## ...

Seems like such a simple straight forward problem... use estimated returns
vector or estimated covariance matrix. There are also a number of other
functions in the package that suggest a list of expected returns and
covariance matrix can be used instead of a times serries of returns. But so
far I'm not turning up an example.

If anyone else has experience with this package, your input would be
appreciated.



On Fri, Nov 8, 2013 at 1:10 PM, <matt@considine.net> wrote:

> Here's how I approached it at one point when I wanted to use a
> consultant's data as input (code is pulled from a larger script, so doesn't
> stand alone ...).  There may be much easier/better ways.
>
> expRet # this is the expected return of the asset classes
> covM   # is a positive definite or near p.d. variance/covariance matrix
>         # derived from asset class correlations and standard deviations
> library(timeSeries)
> library(MASS)
> #create returns series
> testdata<- timeSeries(mvrnorm(n=500,mu=expRet,Sigma=covM,empirical=TRUE))
> #check : this should be a set of zeros
> cor(testdata)-ia2$correlation
> #create price series - used elsewhere
> testprices<-100*apply(testdata,2,function(x) cumprod(1+x))
> testprices<-rbind(matrix(rep(100,length(expRet)),nrow=1),testprices)
> colnames(testprices)<-colnames(testdata)
> #check that expected means are correct
> colMeans(apply(testprices,2,function(x) ROC(x,type="discrete")),na.rm=
> TRUE)-expRet
> library(fPortfolioAdvanced)
> the_hull<-feasleHull(testdata)
> ...
>
> Hope this helps,
> Matt
>
>  List-Post: <mailto:r-sig-finance@r-project.org>
>> Content-Transfer-Encoding: quoted-printable
>> From: ericstrom <ericstrom@aol.com>
>> Precedence: list
>> MIME-Version: 1.0
>> To: r-sig-finance@r-project.org
>> Date: Thu, 7 Nov 2013 19:42:54 -0500 (EST)
>> Message-ID: <8D0AA32987CA530-1988-16EC8@webmail-vm004.sysops.aol.com>
>> Content-Type: text/plain
>> Subject: [R-SIG-Finance] Using forecasted data in fportfolio
>> Message: 1
>>
>>  Still trying to figure out the correct way in the fportfolio package to
>> de=
>> termine the portfolio frontier using a forcasted returns vector and/or a
>> fo=
>> recasted covariance matrix ?  I have no problem coming up with the
>> portfoli=
>> o frontier using historical returns. But what I want to do is use
>> forcasted=
>>  returns and / or forecasted covariance matrix. For example, if my
>> historic=
>> al data is in zts, then the following works:spec
>> =3DportfolioSpec()frontier=
>>  &lt;- portfolioFrontier(zts, spec)frontierPlot(frontier, risk=3D"Sigma",
>> a=
>> uto=3DFALSE)class(zts)[1] "timeSeries"attr(,"package")[1]
>> "timeSeries"head(=
>> zts)GMT                  WBLRX        LSBRX        DBLTX         TFSHX
>>   =
>>       TBT          SPY2012-11-09  0.003013563 -0.002106003 0.0000000000
>> -0.=
>> 0036968619 -0.0312447930 -0.0112530152012-11-16 -0.007045827 -0.003519891
>> 0=
>> .0000000000 -0.0037105794 -0.0074161810 -0.0130282882012-11-23
>>  0.003025721=
>>   0.006326910 0.0000000000  0.0018570107  0.0337662016
>>  0.0358429662012-11-=
>> 30  0.001006543  0.005590511 0.0018365478  0.0027790662 -0.0096968465
>> 0.00=
>> 56951462012-12-07 -0.001006543  0.005559431 0.0009170106  0.0009246418
>>  0.0=
>> 008254231  0.0017955262012-12-14  0.004020106  0.005528694 0.0009161705
>>  0.=
>> 0046104277  0.0134406219 -0.002155018But suppose instead of using
>> historica=
>> l returns data, I want to use forecasted returns and/or forecasted
>> covarian=
>> ce (call them mu1 and covmat). What are the analogous statements to
>> portfol=
>> ioFrontier and frontierPlot using mu1 and covmat as inputs instead of
>> histo=
>> rical returns data ?&gt; class(mu1)[1] "numeric"&gt; class(covmat)[1]
>> "matr=
>> ix"&gt; mu1        WBLRX         LSBRX         DBLTX         TFSHX
>>  =
>>   TBT           SPY  0.0013537910  0.0010611297  0.0001845725
>> -0.0021064133=
>>   0.0032720265  0.0052493188 &gt; covmat              WBLRX         LSBRX
>>  =
>>        DBLTX         TFSHX           TBT           SPYWBLRX  8.980255e-05
>>  =
>> 5.538752e-06  3.384955e-06 -2.753534e-06 -2.347333e-05  6.669676e-06LSBRX
>>  =
>> 5.538752e-06  5.017554e-05  1.297063e-05 -1.055112e-05 -8.994622e-05
>>  2.555=
>> 718e-05DBLTX  3.384955e-06  1.297063e-05  1.848077e-05 -6.448218e-06
>> -5.496=
>> 978e-05  1.561903e-05TFSHX -2.753534e-06 -1.055112e-05 -6.448218e-06
>>  4.277=
>> 017e-05  4.471585e-05 -1.270549e-05TBT   -2.347333e-05 -8.994622e-05
>> -5.496=
>> 978e-05  4.471585e-05  1.388306e-03 -1.083118e-04SPY    6.669676e-06
>>  2.555=
>> 718e-05  1.561903e-05 -1.270549e-05 -1.083118e-04  2.170639e-04I've
>> checked=
>>  the package documentation and I am not finding anything. Any help would
>> be=
>>  appreciated.
>>
>
> _______________________________________________
> R-SIG-Finance@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
> -- Subscriber-posting only. If you want to post, subscribe first.
> -- Also note that this is not the r-help list where general R questions
> should go.
>

	[[alternative HTML version deleted]]

