有办法在逻辑上有两个分布具有相关性的变量?

1视图(30天)
有办法在逻辑上有两个分布具有相关性的变量?“portsim”与正态分布函数能够做到这一点这是完成物流吗?

接受的答案

MathWorks支万博1manbetx持团队
编辑:MathWorks支万博1manbetx持团队 2021年8月27日
因为多元logistic分布不是一个分析分布没有真正可能的方法。正态(高斯)分布,一个可以模拟使用协方差矩阵和相关样品单变量样本,但这不是真正的其他发行版一般。为了做到这一点,你可能需要使用仿真的接合部。注意:会有一些失真的原始分布由于这个过程。
需要注意的另一件事是,“portsim”可以扩展采样率,但是我们不能因为它的物流。如果不是采样速度经常你会有问题,你需要处理原始返回之前拟合分布。
以下文件被创造出来,以帮助解释如何可以做到这一点。文件还没有被充分测试,不处理错误或输入检查,但是你是一个好地方开始了解如何可以做到这一点。
  1. LogCop.m: This file walks through the basic workflow of generating correlated samples.
  2. CorrelatedLogisticSamples.mlx: I use some actual data (stockIndices.mat) to perform the workflow with the new function:
  3. logisticCopulaSim.m: The (undocumented) function which simulates a numObs-by-numAssets-by-numSim matrix of correlated asset returns assuming the underlying marginal returns are logistically distributed. The only tricky part in this file may be the last 2 lines in which I need to perform a transpose, reshape and permutationa. Feel free to rewrite this with a nested for-loop if you would rather do that.
这个文档的例子也可以帮助理解这些文件:

更多的答案(0)

社区寻宝

找到宝藏在MATLAB中央,发现社区如何帮助你!

开始狩猎!