| 查看: 1049 | 回复: 3 | ||
SimpleGirl金虫 (正式写手)
|
[求助]
LS-SVM参数辨识小测试,欢迎各位大神入贴交流
|
|
本人近期在用ls-SVM对线性系统做参数辨识,因为是线性系统所以采用线性核函数,然后根据得到的model.alpha与输入数据相乘得到辨识参数。但结果与实际的误差过大,不明白什么原因?还请各位大神给些意见。 matlab版本为:R2014b, ls-svm的版本为:Matlab R2009b - R2013a: LS-SVMlab1.8 - Linux and Windows (32 and 64 bit) 电脑系统:windows 8.1 为测试ls-svm,写了如下代码: %%%%%%%%% %% 辨识 y(k+1) = Ay(k) + Bx(k)的系数A和B %% 为测试lssvm的参数辨识功能,在假定A=B=1的情况下进行以下测试试验 clc clear all close all y = randperm(101); input1 = y(1:100); output = y(2:101); x = output - input1; input2 = x; input = zeros(length(input1),2); input(:,1) = input2'; input(:,2) = input1'; output = output'; %%%%%%%%%%%%%% type = 'function estimation'; kernel= 'lin_kernel'; gam = 100; % Regularization parameter sig= []; %% =====================optimizate parameters====================== costfun = 'crossvalidatelssvm'; costfun_args = {10,'mse'}; optfun = 'gridsearch'; model = initlssvm(input,output,type,gam,sig,kernel); % 模型初始化 model = tunelssvm(model,optfun,costfun,costfun_args); % 模型参数优化 %% ======================test data======================= model = trainlssvm(model); % 训练 outputPre = simlssvm(model,input); %%%error%%%% error = zeros(size(outputPre)); error = output - outputPre; % figure(3); subplot(2,1,1); plot(1:length(output),output,'r+:',1:length(outputPre),outputPre,'bo:'); legend('test','predict'); subplot(2,1,2); plot(1:length(error),error); sumc=zeros(1,2); for i = 1:1:length(input) sumc(1,1) = sumc(1,1) + model.alpha(i)*input(i,1); sumc(1,2) = sumc(1,2) + model.alpha(i)*input(i,2); end sumc是用来计算辨识系数的,出来的结果达到了十位数了,但原始值才为1. 还请给位大神赐教!!!拜托拜托了。 |
» 猜你喜欢
假如你的研究生提出不合理要求
已经有12人回复
实验室接单子
已经有7人回复
全日制(定向)博士
已经有5人回复
萌生出自己或许不适合搞科研的想法,现在跑or等等看?
已经有4人回复
Materials Today Chemistry审稿周期
已经有4人回复
参与限项
已经有3人回复
对氯苯硼酸纯化
已经有3人回复
所感
已经有4人回复
要不要辞职读博?
已经有7人回复
北核录用
已经有3人回复

2楼2018-01-10 21:39:15
3楼2018-01-10 21:46:43
4楼2018-08-21 09:17:07












回复此楼