请教下面 matlab代码哪里有问题 谢谢
发布:whwblog | 分类:Matlab软件培训
关于本站
人大经济论坛-经管之家:分享大学、考研、论文、会计、留学、数据、经济学、金融学、管理学、统计学、博弈论、统计年鉴、行业分析包括等相关资源。
经管之家是国内活跃的在线教育咨询平台!
获取电子版《CDA一级教材》
完整电子版已上线CDA网校,累计已有10万+在读~ 教材严格按考试大纲编写,适合CDA考生备考,也适合业务及数据分析岗位的从业者提升自我。
TOP热门关键词
function[s,delt_s,s_cor]=C_CMethod(data)%thisfunctioncalculatetimedelayandembeddingdemensionwithC-C%Method,whichprovedbyH.S.Kim%skyhawk&flyinghawk%%****************调试程序段************************ ...
免费学术公开课,扫码加入![]() |
%this function calculate time delay and embedding demension with C-C
%Method,which proved by H.S.Kim
%skyhawk&flyinghawk
% %****************调试程序段****************************
clear all;
data=load('c:/a11.txt');
% %************************************************
N=length(data);
max_d=9;%the maximum value of the time delay
sigma=std(data);%calcute standard deviation s_d
for t=1:max_d
t
s_t=0;
delt_s_s=0;
for m=2:5
s_t1=0;
for j=1:4
r=sigma*j/2;
data_d=disjoint(data,N,t);%将时间序列分解成t个不相交的时间序列
[ll,N_d]=size(data_d);
s_t3=0;
for i=1:t
i
Y=data_d(i,:);
C_1(i)=correlation_integral(Y,N_d,r,i);%计算C(1,N_d,r,t)
X=reconstitution(Y,N_d,m,t);%相空间重构
N_r=N_d-(m-1)*t;
C_I(i)=correlation_integral(X,N_r,r,i);%计算C(m,N_r,r,t)
s_t3=s_t3+(C_I(i)-C_1(i)^m);%对t个不相关的时间序列求和
end
s_t2(j)=s_t3/t;
s_t1=s_t1+s_t2(j);%对rj求和
end
delt_s_m(m)=max(s_t2)-min(s_t2);%求delt S(m,t)
delt_s_s=delt_s_s+delt_s_m(m);%delt S(m,t)对m求和
s_t0(m)=s_t1;
s_t=s_t+s_t0(m);%S对m求和
end
s(t)=s_t/16;
delt_s(t)=delt_s_s/4;
s_cor(t)=delt_s(t)+abs(s(t));
end
fid=fopen('result.txt','w');
fprintf(fid,'%f %f %f %f/n',t,s(t),delt_s(t),s_cor(t));
fclose(fid);
t=1:max_d;
plot(t,s,t,delt_s,'.',t,s_cor,'*')
title('铁路货运量增长率时间序列C-C方法求嵌入时延及嵌入窗')
function C_I=correlation_integral(X,M,r,qs)
%the function is used to calculate correlation integral
%C_I:the value of the correlation integral
%X:the reconstituted state space, is a m*M matrix
%m:the embedding demention
%M:M is the number of embedded points in m-dimensional space
%r:the radius of the Heaviside function,sigma/2<r<2sigma
%calculate the sum of all the values of Heaviside
%skyhawk
sum_H=zeros(1,M);
for i=1:M
for j=1:M
if j==i
continue;
end
d=norm((X(:,i)-X(:,j)),inf);%calculat the distances of each two points in matris M with sup-norm
sita=heaviside(r-d);%calculate the value of the heaviside function
sum_H(i)=sum_H(i)+sita;
end
sum_H(i)=sum_H(i)^qs;
end
C_I=sum(sum_H);%the value of correlation integral
function data_d=disjoint(data,N,t)
%the function is used to subdivid the time series into t disjoint time
%series.
%data:the time series
%N:the length of the time series
%t:the index lag
%skyhawk
for i=1:t
for j=1:(N/t)
data_d(i,j)=data(i+(j-1)*t);
end
end
function sita=heaviside(r)
%the function is used to calculate the value of the Heaviside function
%sita:the value of the Heaviside function
%r:the radius in the Heaviside function,sigma/2<r<2sigma
%d:the distance of two points
%skyhawk
if (r)<0
sita=0;
else sita=1;
end
「经管之家」APP:经管人学习、答疑、交友,就上经管之家!
免流量费下载资料----在经管之家app可以下载论坛上的所有资源,并且不额外收取下载高峰期的论坛币。
涵盖所有经管领域的优秀内容----覆盖经济、管理、金融投资、计量统计、数据分析、国贸、财会等专业的学习宝库,各类资料应有尽有。
来自五湖四海的经管达人----已经有上千万的经管人来到这里,你可以找到任何学科方向、有共同话题的朋友。
经管之家(原人大经济论坛),跨越高校的围墙,带你走进经管知识的新世界。
扫描下方二维码下载并注册APP
免流量费下载资料----在经管之家app可以下载论坛上的所有资源,并且不额外收取下载高峰期的论坛币。
涵盖所有经管领域的优秀内容----覆盖经济、管理、金融投资、计量统计、数据分析、国贸、财会等专业的学习宝库,各类资料应有尽有。
来自五湖四海的经管达人----已经有上千万的经管人来到这里,你可以找到任何学科方向、有共同话题的朋友。
经管之家(原人大经济论坛),跨越高校的围墙,带你走进经管知识的新世界。
扫描下方二维码下载并注册APP
您可能感兴趣的文章
- Matlab软件 ... | [求助]matlab做最小二乘回归的t统 ...
- Matlab软件 ... | 【下载】Introduction to Patter ...
- Matlab软件 ... | [PDF英文原版教材首发]Basics.of ...
- Matlab软件 ... | 【下载】MATLAB Neural Networks ...
- Matlab软件 ... | 【MATLAB】北京十一开课,免费送 ...
- Matlab软件 ... | Matlab介绍 matlab软件下载链接 ...
- Matlab软件 ... | Webinars Matlab – Matlab Reco ...
- Matlab软件 ... | linear Programming with Matlab ...
人气文章
本文标题:请教下面 matlab代码哪里有问题 谢谢
本文链接网址:https://bbs.pinggu.org/jg/ruanjianpeixun_matlabruanjianpeixun_1493922_1.html
2.转载的文章仅代表原创作者观点,与本站无关。其原创性以及文中陈述文字和内容未经本站证实,本站对该文以及其中全部或者部分内容、文字的真实性、完整性、及时性,不作出任何保证或承若;
3.如本站转载稿涉及版权等问题,请作者及时联系本站,我们会及时处理。



