arma模型程序Word下载.docx

上传人:b****6 文档编号:21167831 上传时间:2023-01-28 格式:DOCX 页数:9 大小:227.55KB
下载 相关 举报
arma模型程序Word下载.docx_第1页
第1页 / 共9页
arma模型程序Word下载.docx_第2页
第2页 / 共9页
arma模型程序Word下载.docx_第3页
第3页 / 共9页
arma模型程序Word下载.docx_第4页
第4页 / 共9页
arma模型程序Word下载.docx_第5页
第5页 / 共9页
点击查看更多>>
下载资源
资源描述

arma模型程序Word下载.docx

《arma模型程序Word下载.docx》由会员分享,可在线阅读,更多相关《arma模型程序Word下载.docx(9页珍藏版)》请在冰豆网上搜索。

arma模型程序Word下载.docx

,[min(x),max(x)])%设置x轴的范围

ylim'

[min(y),max(y)],'

layer'

top'

)%设置y轴的范围

h=plot(x,y,'

markersize'

9);

%画图并且取得二维图形中最大值和最小值的索引号

gridon

)%将栅格放在最上层,防止遮盖

axisequal%使每一格的刻度相同,同时也使长度一样

xlabel('

-\pi\leq\theta\leq\pi'

fontsize'

20)

ylabel('

tan(sin(\theta))-sin(tan(\theta))'

title('

\it{-\pi\leq\theta\leq\pi的三角函数图}'

text(0,0,'

\bullet\it原点'

25)%文本的精确定位

%标注曲线的最大值和最小值

x=get(h,'

xdata'

);

%获得二维曲线的数据

y=get(h,'

ydata'

imin=find(min(y)==y);

imax=find(max(y)==y);

text(x(imin),y(imin),['

最小值='

num2str(y(imin))],...

horizontalalignment'

center'

verticalalignment'

bottom'

17)

text(x(imax),y(imax),['

最大值='

num2str(y(imax))],...

宋哲2011/8/1611:

07:

42

%AR,MA模型

a=load('

a=a([2,4],:

a=a'

;

a=a(:

%将数据税收展成按时间序列排列的

%plot(a,'

-p'

b=diff(a);

%plot(b,'

r1=autocorr(b)%计算自相关系数

r2=parcorr(b)%计算偏自相关系数

figure,subplot(121),autocorr(b)

subplot(122),parcorr(b)

cs1=ar(b,2)%AR模型,b必须是列向量

bhat=predict(cs1,[b;

20])%Discrete-timeIDPOLYmodel:

%A(q)=1-q^-1-q^-2

b15=bhat{1}(end)

bhat2=predict(cs1,[b;

b15;

-1])

27:

00

%用逻辑斯特预测

x0=a

(1);

tt=[1:

14]'

t0=1;

xt=@(cs,t)cs

(1)/(1+(cs

(1)/x0-1)*exp(-cs

(2)*(t-t0)));

cs=lsqcurvefit(xt,rand(2,1),tt(2,end),a(2:

end))

%以上程序为三维视图和等高线画图程序

clc,clear

amin=min(min(a)),amax=max(max(a))

x0=0:

5:

4000;

y0=0:

3000;

[xx0,yy0]=meshgrid(x0,y0);

mesh(xx0,yy0,a)

v=[-49,1,12,44,75,107,171,184:

80:

357,357:

100:

614,614];

figure,c=contour(x0,y0,a,v);

clabel(c)

宋哲2011-08-179:

32:

44

clc,clear%该程序计算最小面积

pp=csape({x0,y0},a)

x=0:

y=0:

z=fnval(pp,{x,y});

[m,n]=size(z);

s=0;

fori=1:

m-1

forj=1:

n-1

p1=[x(i),y(j),z(i,j)];

p2=[x(i+1),y(j),z(i+1,j)];

p3=[x(i+1),y(j+1),z(i+1,j+1)];

p4=[x(i),y(j+1),z(i,j+1)];

p12=norm(p1-p2);

p23=norm(p3-p2);

p13=norm(p3-p1);

p14=norm(p4-p1);

p34=norm(p4-p3);

ifall([z(i,j),z(i+1,j),z(i+1,j+1)]>

=12)

z1=(p12+p23+p13)/2;

s1=sqrt(z1*(z1-p12)*(z1-p23)*(z1-p13));

s=s+s1;

end

ifall([z(i,j),z(i+1,j+1),z(i,j+1)]>

z2=(p13+p14+p34)/2;

s2=sqrt(z2*(z2-p13)*(z2-p14)*(z2-p34));

s=s+s2;

end

s

57

%图3的Matlab程序如下

loadpdata

'

c=contour(x0,y0,a,v);

holdon

plot(P1

(1),P1

(2),'

S'

plot(P2

(1),P2

(2),'

D'

),plot(P3

(1),P3

(2),'

),plot(P4

(1),P4

(2),'

b=a'

801

601

txy=[(i-1)*5;

(j-1)*5;

b(i,j)];

td=norm(txy-Pz1);

iftd>

=995&

td<

=1000

plot((i-1)*5,(j-1)*5,'

o'

td=norm(txy-Pz2);

=495&

=500

td=norm(txy-Pz3);

td=norm(txy-Pz4);

宋哲2011-08-1716:

11:

05

[m,n]=size(z)

ifany([z(i,j),z(i+1,j),z(i+1,j+1)]>

ifany([z(i,j),z(i+1,j+1),z(i,j+1)]>

41:

37

%求4个特殊点的Matlab程序

i=[2500:

3700]/5;

j=[800:

2100]/5;

%求358高地的大致范围的地址

z0=a(i,j);

%求358高地的大致高程

zz1=max(max(z0))%求358高地的最高点高程

[i1,j1]=find(a==zz1);

%求358高地在全部数据矩阵a中的地址

P1=[(i1-1)*5;

(j1-1)*5]%求358高地的x坐标和y坐标

zz2=max(max(a))

[i2,j2]=find(a==zz2);

P2=[(i2-1)*5;

(j2-1)*5]%求615高地的最高点x坐标和y坐标

a0=a([800:

1100]/5,[600:

800]/5);

zz3=max(max(a0))%求185高地的最高点高程

[i3,j3]=find(a==zz3);

P3=[(i3-1)*5;

(j3-1)*5]%求185高地的最高点x坐标和y坐标

z4=a([2100:

2650]/5,[170:

580]/5);

zz4=max(max(z4))

[i4,j4]=find(a==zz4);

P4=[(i4-1)*5;

(j4-1)*5]

Pz1=[P1;

zz1+10];

Pz2=[P2;

zz2+3];

Pz3=[P3;

zz3+3];

Pz4=[P4;

zz4+3];

savepdataP1P2P3P4Pz1Pz2Pz3Pz4

48

plot(P1

(1),P1

(2),'

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 解决方案 > 学习计划

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1