| 查看: 1013 | 回复: 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. 还请给位大神赐教!!!拜托拜托了。 |
» 猜你喜欢
2025冷门绝学什么时候出结果
已经有3人回复
天津工业大学郑柳春团队欢迎化学化工、高分子化学或有机合成方向的博士生和硕士生加入
已经有4人回复
康复大学泰山学者周祺惠团队招收博士研究生
已经有6人回复
AI论文写作工具:是科研加速器还是学术作弊器?
已经有3人回复
孩子确诊有中度注意力缺陷
已经有6人回复
2026博士申请-功能高分子,水凝胶方向
已经有6人回复
论文投稿,期刊推荐
已经有4人回复
硕士和导师闹得不愉快
已经有13人回复
请问2026国家基金面上项目会启动申2停1吗
已经有5人回复
同一篇文章,用不同账号投稿对编辑决定是否送审有没有影响?
已经有3人回复

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













回复此楼