| 4 | 1/1 | 返回列表 |
| 查看: 1116 | 回復: 3 | |||
SimpleGirl金蟲 (正式寫手)
|
[求助]
LS-SVM參數(shù)辨識小測試,歡迎各位大神入貼交流
|
|
本人近期在用ls-SVM對線性系統(tǒng)做參數(shù)辨識,因為是線性系統(tǒng)所以采用線性核函數(shù),然后根據(jù)得到的model.alpha與輸入數(shù)據(jù)相乘得到辨識參數(shù)。但結果與實際的誤差過大,不明白什么原因?還請各位大神給些意見。 matlab版本為:R2014b, ls-svm的版本為:Matlab R2009b - R2013a: LS-SVMlab1.8 - Linux and Windows (32 and 64 bit) 電腦系統(tǒng):windows 8.1 為測試ls-svm,寫了如下代碼: %%%%%%%%% %% 辨識 y(k+1) = Ay(k) + Bx(k)的系數(shù)A和B %% 為測試lssvm的參數(shù)辨識功能,在假定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); % 模型參數(shù)優(yōu)化 %% ======================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是用來計算辨識系數(shù)的,出來的結果達到了十位數(shù)了,但原始值才為1. 還請給位大神賜教。。“萃邪萃辛。 |

| 4 | 1/1 | 返回列表 |
| 最具人氣熱帖推薦 [查看全部] | 作者 | 回/看 | 最后發(fā)表 | |
|---|---|---|---|---|
|
[考研]
|
Gymno 2026-03-30 | 4/200 |
|
|---|---|---|---|---|
|
[考研] 311求調(diào)劑 +7 | 藍月亮亮 2026-03-30 | 7/350 |
|
|
[考研] 329求調(diào)劑,一志愿西北工業(yè)大學,材料工程(085601) +5 | 小小機靈蟲 2026-03-29 | 11/550 |
|
|
[考研] 環(huán)境科學與工程334分求調(diào)劑 +6 | 王一一依依 2026-03-30 | 8/400 |
|
|
[考研] 290求調(diào)劑 +3 | dfffsar 2026-03-29 | 3/150 |
|
|
[考研] 070305高分子化學與物理 304分求調(diào)劑 +12 | c297914 2026-03-28 | 12/600 |
|
|
[考研] 349求調(diào)劑 +6 | 李木子啊哈哈 2026-03-25 | 6/300 |
|
|
[考研] 299求調(diào)劑 +7 | 嗯嗯嗯嗯2 2026-03-27 | 7/350 |
|
|
[考研] 085405 考的11408求各位老師帶走 +3 | Qiu學ing 2026-03-28 | 3/150 |
|
|
[考研] 266求調(diào)劑 +11 | 陽陽哇塞 2026-03-27 | 12/600 |
|
|
[考研] 化學調(diào)劑 +4 | 愛吃番茄的旭 2026-03-24 | 5/250 |
|
|
[考研] 279 分 求調(diào)劑 +4 | 睡個好覺_16 2026-03-24 | 4/200 |
|
|
[考研] 調(diào)劑推薦 +5 | 清酒714 2026-03-26 | 6/300 |
|
|
[考研] 考研調(diào)劑 +9 | 小蠟新筆 2026-03-26 | 9/450 |
|
|
[考研] 0703化學338求調(diào)劑! +6 | Zuhui0306 2026-03-26 | 7/350 |
|
|
[考研] 321求調(diào)劑 +6 | wasdssaa 2026-03-26 | 6/300 |
|
|
[考研] 考研一志愿蘇州大學初始315(英一)求調(diào)劑 +3 | sbdksD 2026-03-24 | 4/200 |
|
|
[考研] 347求調(diào)劑 +4 | L when 2026-03-25 | 4/200 |
|
|
[考研] 調(diào)劑 +4 | 13853210211 2026-03-24 | 4/200 |
|
|
[考研] 080500求調(diào)劑 +3 | zzzzfan 2026-03-24 | 3/150 |
|