|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?我要加入
x
以下是:用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);
%生成最优参数
[gam,sig2] = 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
[par,fval] =
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
[par,fval] =
csa(rand(2,5),@(x)simanncostfun2(x,model,costfun,costargs));
Error in ==> Untitled at 17
[gam,sig2] = tunelssvm({Xu(:,1:delays),Xu(:,end),'f',10,002,'RBF_kernel'},[],
'gridsearch',{},'validate',{Xtra, Ytra, Xval, Yval});
谁能帮忙具体指点一下!不胜感激。
|
|