我的代码:
%%%%% copula 模型的参数分析
% 最佳迭代次数
k = nuhat; % t分布自由度
for j=1:1:length(linss2)
CDF_t = copulacdf('t',[U1(:),V1(:)],linss2(1,:),k);
CDF_gum = copulacdf('Gumbel',[U1(:),V1(:)],linss2(2,:));
CDF_fra = copulacdf('Frank',[U1(:),V1(:)],linss2(3,:));
end
其中:linss2是迭代得到的3行n列矩阵,n为迭代次数,每一次迭代都会有三个不同的参数值(按列排列)
问题:无法实现
错误使用 copulacdf (第 65 行)
RHO 必须为相关方阵,且大小等于 U 的列数。
出错 copula_parameter (第 129 行)
CDF_t(:,length(linss1)) = copulacdf('t',[U1(:),V1(:)],linss2(1,:),k);
目的:我的U和V数据都是365*1的矩阵,按照逻辑,形成的变量CDF_**应该是365*n,每一个参数值都应该对应一个copulacdf的列向量,
但是上述代码无法运算
有没有老师可以帮助一下

 채택된 답변

0 개 추천

提示不是已经很明确地告诉你了吗,“RHO 必须为相关方阵,且大小等于 U 的列数”。
copulacdf函数(超链接,自己点进去看) 帮助文档明确写了调用语法
Syntax
y = copulacdf('t',u,rho,nu)
rho — Linear correlation parameters
Linear correlation parameters for the copula, specified as a scalar value or matrix of scalar values.
If u is an n-by-p matrix, then rho is a p-by-p correlation matrix.
If u is an n-by-2 matrix, then rho can be a scalar correlation coefficient.
写代码时候至少应该看看帮助文档,检查自己调用是否符合语法要求并满足参数规格

추가 답변 (0개)

카테고리

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!