clc,clear
load lilv.txt %原始数据以列向量的方式存放在纯文本文件中
yt=dianqi; n=length(yt);
alpha=[0.2 0.5 0.8];m=length(alpha);
yhat(1,1:m)=(yt(1)+yt(2))/2;
for i=2:n
yhat(i,:)=alpha*yt(i-1)+(1-alpha).*yhat(i-1,:);
end
yhat
err=sqrt(mean((repmat(yt,1,m)-yhat).^2))
xlswrite('lilv.xls',yhat)
yhat2014=alpha*yt(n)+(1-alpha).*yhat(n,:)
我有一组数据:
x=1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013
y=0.03 0.14 0.01 0.20 0.09 0.12 0.11 0.20 0.23 0.20 0.14 0.12 0.17 0.13 0.07 0.10
我想知道写在什么地方,以及每一句的意思。