~ubuntu-branches/ubuntu/trusty/fportfolio/trusty

« back to all changes in this revision

Viewing changes to man/feasiblePortfolio.Rd

  • Committer: Bazaar Package Importer
  • Author(s): Dirk Eddelbuettel
  • Date: 2008-12-04 11:36:54 UTC
  • mfrom: (1.1.6 upstream) (2.1.3 squeeze)
  • Revision ID: james.westby@ubuntu.com-20081204113654-gr832nfs44blp5ph
Tags: 280.74-1
* New upstream release
* Finally uploading as r-cran-rglpk is out of NEW after five weeks

* debian/control: Updated (Build-)Depends: and Suggests:

* debian/control: Set (Build-)Depends: to current R version
* debian/control: Set Standards-Version: to current version

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
\name{feasiblePortfolio}
 
2
 
 
3
 
 
4
\alias{feasiblePortfolio}
 
5
 
 
6
 
 
7
\title{Portfolio Class}
 
8
 
 
9
 
 
10
\description{
 
11
  
 
12
    Returns properties of a feasible portfolio.
 
13
    
 
14
}
 
15
    
 
16
 
 
17
\usage{
 
18
feasiblePortfolio(data, spec = portfolioSpec(), constraints = "LongOnly")
 
19
}
 
20
 
 
21
 
 
22
 
 
23
\arguments{
 
24
 
 
25
    \item{constraints}{
 
26
        a character string vector, containing the constraints of the form\cr
 
27
        \code{"minW[asset]=percentage"} for box constraints resp. \cr
 
28
        \code{"maxsumW[assets]=percentage"} for sector constraints.
 
29
        }
 
30
    \item{data}{
 
31
        a multivariate time series described by an S4 object of class
 
32
        \code{timeSeries}. If your timeSerie is not a \code{timeSeries}
 
33
        object, consult the generic function \code{as.timeSeries} to 
 
34
        convert your time series.
 
35
        }
 
36
    \item{spec}{
 
37
        an S4 object of class \code{fPFOLIOSPEC} as returned by the function
 
38
        \code{portfolioSpec}.
 
39
        }
 
40
 
 
41
}
 
42
 
 
43
 
 
44
\details{
 
45
    
 
46
    \bold{A Feasible Portfolio:}
 
47
    \cr\cr   
 
48
    
 
49
    A feasible portfolio is a portfolio with given weights which
 
50
    lies inside the feasible region of portfolios.
 
51
       
 
52
    The function requires three arguments: \code{data}, \code{spec} 
 
53
    (specifications), and \code{constraints}, see above. Be sure that
 
54
    the specification structure \code{"spec"} has defined a weights
 
55
    vector which is different from \code{"NULL"}.  To assign values
 
56
    to the weights in the specification structure, use the function 
 
57
    \code{setWeights}. 
 
58
    
 
59
    The \code{feasiblePortfolio} function returns the properties of 
 
60
    the feasible portfolio as an S4 object of class \code{fPORTFOLIO}.
 
61
 
 
62
}
 
63
 
 
64
 
 
65
\value{
 
66
    
 
67
    \code{feasiblePortfolio} function returns an S4 object of class 
 
68
    \code{"fPORTFOLIO"}, with the following slots:
 
69
 
 
70
    \item{@call}{
 
71
        a call, returning the matched function call.
 
72
        }
 
73
    \item{@data}{
 
74
        a list with two named elements, \code{series} holding the time series
 
75
        data if available, otherwise NA, and \code{statistics}, itself a
 
76
        named list with two named elements \code{mu} and \code{Sigma}
 
77
        holding the vector of means and the matrix of covariances.
 
78
        }  
 
79
    \item{@description}{
 
80
        a character string, allowing for a brief project description.
 
81
        }        
 
82
    \item{@portfolio}{
 
83
        a list, containing parameter specifications for the portfolio:\cr 
 
84
        \code{weights} a numeric vector specifying the portfolio 
 
85
            weights,\cr
 
86
        \code{targetReturn} a numeric value specifying the target 
 
87
            return,\cr
 
88
        \code{targetRisk} a numeric value specifying the target 
 
89
            risk,\cr  
 
90
        \code{targetMean} a numeric value specifying the target 
 
91
            return determinated with function mean(),\cr
 
92
        \code{targetStdev} a numeric value specifying the target risk in 
 
93
            standart deviation as risk measure.
 
94
        }
 
95
    \item{@specification}{
 
96
        a list with one named element \code{spec} which represents an object 
 
97
        of class \code{fPFOLIOSPEC}, including all information about
 
98
        the portfolio specifications.
 
99
        }
 
100
    \item{@title}{
 
101
        a title string.
 
102
        }
 
103
    
 
104
}
 
105
 
 
106
 
 
107
 
 
108
%\references{}
 
109
 
 
110
 
 
111
\examples{
 
112
## data -
 
113
   # Load Data and Convert to timeSeries Object:
 
114
   Data = as.timeSeries(data(smallcap.ts))
 
115
   Data = Data[, c("BKE", "GG", "GYMB", "KRON")]
 
116
   Data
 
117
   
 
118
## portfolioSpec - 
 
119
   # Set Default Specifications:
 
120
   Spec = portfolioSpec()
 
121
   setWeights(Spec) = rep(0.25, times = 4)
 
122
   Spec
 
123
   
 
124
## Allow for unlimited Short Selling:
 
125
   Constraints = "LongOnly"
 
126
   
 
127
## Compute properties of Efficient Portfolio
 
128
   feasiblePortfolio(Data, Spec, Constraints)
 
129
}
 
130
 
 
131
 
 
132
\keyword{models}
 
133