用LS-SVM对下面一个叠加信号做预测
以下是:用LS-SVM对下面一个叠加信号做预测,由其中的1024点预测随后的200点数据。但是在运行时出现了错误,谁能帮忙具体指点一下!不胜感激。clear
clc
t=1/512:1/512:1024/512;
X=2*cos(8*pi*t)+0.5*cos(4*pi*t)+0.5*cos(pi*t);
XX=X(625:1024)';%生成模型的数据点,如果取全部数据点的话,会相当慢
plot(XX);
%以下是模仿LS-SVM说明书上的例子
delays = 20;
Xu = windowize(XX,1:delays+1);
Xtra = Xu(1:200,1:delays); Ytra = Xu(1:200,end);
Xval = Xu(201:380,1:delays); Yval = Xu(201:380,end);
%生成最优参数
= tunelssvm({Xu(:,1:delays),Xu(:,end),'f',10,002,'RBF_kernel'},[],...
'gridsearch',{},'validate',{Xtra, Ytra, Xval, Yval});
Xt=Xu(380,2:21);
%预测200点数据
nb=200; prediction = predict({Xu(:,1:delays),Xu(:,end),...
'f',gam,sig2,'RBF_kernel'},Xt,nb);
但是在运行时出现的错误如下:
??? Input argument "startvalues" is undefined.
Error in ==> gridsearch at 70
dim = size(startvalues,2);
Error in ==> tunelssvm>simanncostfun2 at 467
cost = feval(costfun,model,costargs{:});
Error in ==> tunelssvm>@(x)simanncostfun2(x,model,costfun,costargs) at 149
=
csa(rand(2,5),@(x)simanncostfun2(x,model,costfun,costargs));
Error in ==> csa at 22
e0 = feval(herrfunc,pn,varargin{:});
Error in ==> tunelssvm at 149
=
csa(rand(2,5),@(x)simanncostfun2(x,model,costfun,costargs));
Error in ==> Untitled at 17
= tunelssvm({Xu(:,1:delays),Xu(:,end),'f',10,002,'RBF_kernel'},[],
'gridsearch',{},'validate',{Xtra, Ytra, Xval, Yval});
谁能帮忙具体指点一下!不胜感激。
回复 1 # hewei204114 的帖子
个人水平有限, 不懂此专业! 但怎搜不到tunelssvm此函数?? (R2009a) >>help windowize
windowize.m not found.
Use the Help browser Search tab to search the documentation, or
type "help help" for help command options, such as help for methods.
>> helptunelssvm
tunelssvm.m not found.
Use the Help browser Search tab to search the documentation, or
type "help help" for help command options, such as help for methods.好像我的matlab2007a中也没有tunelsscm函数,也没有windowize函数! 是工具箱问题,你的工具箱不完整
页:
[1]