-
大小: 746B文件類(lèi)型: .rar金幣: 2下載: 0 次發(fā)布日期: 2021-06-05
- 語(yǔ)言: Matlab
- 標(biāo)簽:
資源簡(jiǎn)介
應(yīng)用matlab實(shí)現(xiàn)的高等數(shù)理統(tǒng)計(jì)最小二乘估計(jì)源碼
Matlab implementation of higher application of mathematical statistics source least squares estimation

代碼片段和文件信息
%------begin?computing?the?Least?Square?Estimate?of?intensity?coefficients
frequency=[20;200;2000;20000];
timeIntvl=0:0.025:24.975;
timeIntvl=timeIntvl*(10^-3);??%?transform?the?ms?unit?of?time?into?s?unit?
ctrlVarMatrix=sin(2*pi*(frequency*timeIntvl));???%?compute?the?matrix?of?the?control?variables
fid=fopen(‘observationsOfSample.txt‘‘r‘);
obstnVector_Y=fscanf(fid‘%f‘);?%?read?observations?of?sample?from?file
fclose(fid);
obstnVector_Y=obstnVector_Y*(10^-3);??%?transform?the?mV?unit?of?voice?into?V?unit
factorLSE1=ctrlVarMatrix*transpose(ctrlVarMatrix);
if(rank(factorLSE1) ????factorLSE2=inv(factorLSE1+eye(44)*(10^-7));??%?modify?the?factorLSE1:add?up?factorLSE1?and?a?unit?matrix?that?multiled?by?a?tiny?value??
else
????factorLSE2=inv(factorLSE1);??%?compute?the?generalized?inverse?matrix?of?factorLSE1?
end
factorLSE=factorLSE2*ctrlVarMatrix*obstnVector_Y;??%?compute?the?Least?Square?Estimate?of?intensity?coefficients???
%------end?computing?the?Least?Square?Estimate?of?intensity?coefficients
%------begin?computing?the?Least?Square?Estimate?of?variance
Qe=0;
for?i=1:size(obstnVector_Y1)
????Qe=Qe+(obstnVector_Y(i)-(transpose(ctrlVarMatrix(:i))*factorLSE))^2;
end
varianceLSE=Qe/(size(obstnVector_Y1)-size(frequency1)-1);
%------end?computing?the?Least?Square?Estimate?of?variance
%------output?the?result?of?Least?Square?Estimate
disp([‘the?LSE?of?factors?from?1?to?‘num2str(size(factorLSE1))‘?as?follow?:?‘])
disp(vpa(factorLSE4))
disp(‘the?LSE?of?variance?as?follow?:?‘)
disp(vpa(varianceLSE4))
plot(timeIntvlobstnVector_Y)
?屬性????????????大小?????日期????時(shí)間???名稱(chēng)
-----------?---------??----------?-----??----
?????文件???????1611??2008-12-21?19:58??LSETest.m
-----------?---------??----------?-----??----
?????????????????1611????????????????????1
- 上一篇:DCT系數(shù)直方圖
- 下一篇:OFDM MATLAB源碼
評(píng)論
共有 條評(píng)論