rgeneral(rportfolios)
rgeneral()所属R语言包:rportfolios
Generate random general portfolios
产生随机的一般投资组合
译者:生物统计家园网 机器人LoveR
描述----------Description----------
This function generates m random general portfolios with n investments each. There are k positions that can be positive or negative. The probability that a given investment weight is positive is p. The maximum absolute exposure is x.u which has 1 / k as the default
此功能会产生m个随机一般有n个投资各投资组合。有k个位置,可以是正的或负的。投资一个给定的重量为正的概率是p。最大绝对风险是徐1 / k默认的
用法----------Usage----------
rgeneral(m, n = 2, k = n, p = 0.5, x.u = 1/k)
参数----------Arguments----------
参数:m
A positive integer value for the number of portfolios
投资组合的数量正整数值
参数:n
A positive integer value for the number of investments in the portfolio
投资组合中的一个正整数的值
参数:k
A positive integer value for the number of non-zero investment positions
正整数值为非零投资头寸的数量
参数:p
A positive numeric value for the probability that a non-zero position is positive
阿正的数值的概率,一个非零的位置是正
参数:x.u
A positive numeric value for the maximum absolute exposure to an investment
正数值的最大绝对的投资风险
Details
详细信息----------Details----------
The function executes the function random.general using the R function sapply. The result returned is the transpose of the matrix generated in the previous step.
该功能执行的功能random.general使用R的功能sapply,。返回的结果是在先前步骤中产生的矩阵的转置。
值----------Value----------
An m \times n numeric matrix. The rows are the portfolios and the columns are the investment weights for each portfolio
m \times n数字矩阵。该行的投资组合和列是每个投资组合的投资权重
(作者)----------Author(s)----------
Frederick Novomestky <a href="mailto:fnovomes@poly.edu">fnovomes@poly.edu</a>
参见----------See Also----------
random.general
random.general
实例----------Examples----------
###[##]
### 100 long only portfolios of 30 investments with 30 non-zero positions[##100长仅30投资组合的30个非零位]
###[##]
x.long <- rgeneral( 100, 30, p=1.0 )
###[##]
### 100 long only portfolios of 30 investments with 10 non-zero positions[##100长仅30投资组合的10个非零位]
###[##]
y.long <- rgeneral( 100, 30, 10, p=1.0 )
###[##]
### 100 short only portfolios of 30 investments with 30 non-zero positions[##100短的只有30投资组合的30个非零位]
###[##]
x.short <- rgeneral( 100, 30, p=0.0 )
###[##]
### 100 short only portfolios of 30 investments with 10 non-zero positions[##100短的只有30投资组合的10个非零位]
###[##]
y.short <- rgeneral( 100, 30, 10, p=0.0 )
###[##]
### 100 long short portfolios of 30 investments with 30 non-zero positions[##100 30投资组合的长的短的30个非零位]
###[##]
x.long.short <- rgeneral( 100, 30, p=0.5 )
###[##]
### 100 long short portfolios of 30 investments with 10 non-zero positions[##100 30投资组合的长的短的10个非零位]
###[##]
y.long.short <- rgeneral( 100, 30, 10, p=0.5 )
###[##]
### 100 long bias portfolios of 30 investments with 30 non-zero positions[##100长投资的30个与30个非零位偏差投资组合]
###[##]
x.long.bias <- rgeneral( 100, 30, p=0.7 )
###[##]
### 100 long bias portfolios of 30 investments with 10 non-zero positions[##100长投资的30个与10个非零位偏差投资组合]
###[##]
y.long.bias <- rgeneral( 100, 30, 10, p=0.7 )
###[##]
### 100 short bias portfolios of 30 investments with 30 non-zero positions[##100短的偏压组合投资的30个与30个非零位]
###[##]
x.short.bias <- rgeneral( 100, 30, p=0.3 )
###[##]
### 100 short bias portfolios of 30 investments with 10 non-zero positions[##100短的偏压组合投资的30个与10个非零位]
###[##]
y.short.bias <- rgeneral( 100, 30, 10, p=0.3 )
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|