Maximum-likelihood-parameter-estimation.zip

  • PUDN用户
    了解作者
  • matlab
    开发工具
  • 1KB
    文件大小
  • zip
    文件格式
  • 0
    收藏次数
  • 10 积分
    下载积分
  • 37
    下载次数
  • 2011-04-03 16:35
    上传日期
this code is or estimation Maximum likelihood parameter
Maximum-likelihood-parameter-estimation.zip
  • Maximum likelihood parameter estimation.m
    1.4KB
内容介绍
% Maximum likelihood parameter estimation clear all close all clc load('data_33rpz_cv04.mat'); %% x = 1:100; interval = [20 40 60 80]; c = binaryClassify(x,interval) %% uceni a klasifikace trns = [trn_20 trn_200 trn_2000] errors = []; for trn = 1:length(trns) % LEARNING SECTION % ---------------- % probA = estimateProb(trns(trn), 'A', Alphabet); probC = estimateProb(trns(trn), 'C', Alphabet); prob = [probA probC]; model = c2s({'Prior',prob(1,:),'Mean',prob(2,:),'Cov',prob(3,:)}); % CLASSIFICATION SECTION % ---------------------- xt = featureVector(tst); [risk,eps1,eps2,inter1] = bayeserr(model); c = binaryClassify(xt,inter1); err = (c ~= tst.labels); errors = [errors; sum(err)/length(err)]; % PLOTTING SECTION % ---------------- % obtain feature vector x = featureVector(trns(trn)); xa = x(find(trns(trn).labels==1)); % histogram [N, u] = hist(x,50); N = N / ( sum(N)*(u(2)-u(1)) ); % normalizace % distribuce % plotting figure subplot(2,1,1) bar(u,N,'r'); hold on pgmm(model) grid on % LOG-LIKELIHOOD FUNCTION % ----------------------- sigmas = [1:1000]; La = []; for i = sigmas La = [La logLikelihood(xa,probA(2),i)]; end subplot(2,1,2) semilogx(sigmas,La) grid on end errors = 100*errors
评论
    相关推荐