Update index.html
Browse files- index.html +12 -14
index.html
CHANGED
|
@@ -540,9 +540,9 @@
|
|
| 540 |
}
|
| 541 |
}
|
| 542 |
|
| 543 |
-
// 计算资本利得区间(基于正态分布)
|
| 544 |
function calculateCapitalGainRange(period) {
|
| 545 |
-
// 确定波段次数
|
| 546 |
let cycles;
|
| 547 |
switch(period) {
|
| 548 |
case 'SHORT': cycles = 1; break; // 0-3个月:1次
|
|
@@ -551,23 +551,20 @@
|
|
| 551 |
default: cycles = 1;
|
| 552 |
}
|
| 553 |
|
| 554 |
-
// 单次波段参数:
|
| 555 |
-
const singleStd =
|
| 556 |
-
const singleMean = 0; // 均值为0,
|
| 557 |
|
| 558 |
// 年化分布参数(n次独立同分布的和)
|
| 559 |
const annualMean = singleMean * cycles;
|
| 560 |
const annualStd = singleStd * Math.sqrt(cycles);
|
| 561 |
|
| 562 |
-
// 计算
|
| 563 |
-
const
|
| 564 |
-
const p75 = normalQuantile(0.75, annualMean, annualStd);
|
| 565 |
|
| 566 |
return {
|
| 567 |
-
lower:
|
| 568 |
-
upper:
|
| 569 |
-
mean: annualMean / 100,
|
| 570 |
-
std: annualStd / 100
|
| 571 |
};
|
| 572 |
}
|
| 573 |
|
|
@@ -745,6 +742,7 @@
|
|
| 745 |
const bondResult = calculateBaseReturn();
|
| 746 |
const capGain = calculateCapitalGainRange(period);
|
| 747 |
|
|
|
|
| 748 |
const totalLower = bondResult.baseReturn + capGain.lower;
|
| 749 |
const totalUpper = bondResult.baseReturn + capGain.upper;
|
| 750 |
|
|
@@ -939,13 +937,13 @@
|
|
| 939 |
|
| 940 |
<div style="margin-top: 30px; padding: 20px; background: #f0f8ff; border-radius: 8px;">
|
| 941 |
<h3>💡 计算说明</h3>
|
| 942 |
-
<p><strong>资本利得模型:</strong>基于
|
| 943 |
<ul style="margin-left: 20px; margin-top: 5px;">
|
| 944 |
<li>短期(0-3个月):1次波段</li>
|
| 945 |
<li>中期(3-6个月):1.5次波段</li>
|
| 946 |
<li>长期(6-12个月):3次波段</li>
|
| 947 |
</ul>
|
| 948 |
-
<p><strong>
|
| 949 |
<p><strong>资产预期:</strong>${result.strategy === '固收+策略' ?
|
| 950 |
`采用${result.expectation}预期,${result.asset}指数预测区间为${result.assetReturnRange}` :
|
| 951 |
'纯债策略主要依赖票息收入和资本利得'}</p>
|
|
|
|
| 540 |
}
|
| 541 |
}
|
| 542 |
|
| 543 |
+
// 计算资本利得区间(基于正态分布,第50-80百分位)
|
| 544 |
function calculateCapitalGainRange(period) {
|
| 545 |
+
// 确定波段次数(按照我们讨论的逻辑)
|
| 546 |
let cycles;
|
| 547 |
switch(period) {
|
| 548 |
case 'SHORT': cycles = 1; break; // 0-3个月:1次
|
|
|
|
| 551 |
default: cycles = 1;
|
| 552 |
}
|
| 553 |
|
| 554 |
+
// 单次波段参数:正态分布 N(0, σ),σ=18bp
|
| 555 |
+
const singleStd = 18; // 18bp标准差,基于我们讨论的参数
|
| 556 |
+
const singleMean = 0; // 均值为0,第50百分位不亏钱
|
| 557 |
|
| 558 |
// 年化分布参数(n次独立同分布的和)
|
| 559 |
const annualMean = singleMean * cycles;
|
| 560 |
const annualStd = singleStd * Math.sqrt(cycles);
|
| 561 |
|
| 562 |
+
// 计算第80百分位(因为我们取第50-80百分位区间,下限为0,上限为第80百分位)
|
| 563 |
+
const p80 = normalQuantile(0.8, annualMean, annualStd);
|
|
|
|
| 564 |
|
| 565 |
return {
|
| 566 |
+
lower: 0, // 第50百分位为0
|
| 567 |
+
upper: p80 / 100 // 转换为百分比
|
|
|
|
|
|
|
| 568 |
};
|
| 569 |
}
|
| 570 |
|
|
|
|
| 742 |
const bondResult = calculateBaseReturn();
|
| 743 |
const capGain = calculateCapitalGainRange(period);
|
| 744 |
|
| 745 |
+
// 总收益率区间 = 基础收益率 + 资本利得区间
|
| 746 |
const totalLower = bondResult.baseReturn + capGain.lower;
|
| 747 |
const totalUpper = bondResult.baseReturn + capGain.upper;
|
| 748 |
|
|
|
|
| 937 |
|
| 938 |
<div style="margin-top: 30px; padding: 20px; background: #f0f8ff; border-radius: 8px;">
|
| 939 |
<h3>💡 计算说明</h3>
|
| 940 |
+
<p><strong>资本利得模型:</strong>基于正态分布N(0, 18bp),不同期限对应不同波段次数,计算第50-80百分位交易员收益区间:</p>
|
| 941 |
<ul style="margin-left: 20px; margin-top: 5px;">
|
| 942 |
<li>短期(0-3个月):1次波段</li>
|
| 943 |
<li>中期(3-6个月):1.5次波段</li>
|
| 944 |
<li>长期(6-12个月):3次波段</li>
|
| 945 |
</ul>
|
| 946 |
+
<p><strong>资本利得区间:</strong>下限为0bp(第50百分位不亏钱),上限为第80百分位值</p>
|
| 947 |
<p><strong>资产预期:</strong>${result.strategy === '固收+策略' ?
|
| 948 |
`采用${result.expectation}预期,${result.asset}指数预测区间为${result.assetReturnRange}` :
|
| 949 |
'纯债策略主要依赖票息收入和资本利得'}</p>
|