DiscretizeObsModelPURPOSEDiscretizes the observation model on the observation side.
SYNOPSISfunction CS_DO_OM=DiscretizeObsModel(CS_CO_OM,V,ba,nSamples)
DESCRIPTIONDiscretizes the observation model on the observation side. Implementation of the lossless discretization of the observation model defined in section 6.2 of the paper. The output is an observation model on a continuous state space but on a discrete a observation space. The dimensionality of this observation space is given by the number of elements in V (number of alpha elements in the previous iteration policy). This is only use in the experiment in Figure 11. See also MakeFigure11. CROSS-REFERENCE INFORMATIONThis function calls:
SOURCE CODE0001 function CS_DO_OM=DiscretizeObsModel(CS_CO_OM,V,ba,nSamples) 0002 % Discretizes the observation model on the observation side. 0003 % 0004 % Implementation of the lossless discretization of the observation model 0005 % defined in section 6.2 of the paper. 0006 % The output is an observation model on a continuous state space but on a 0007 % discrete a observation space. The dimensionality of this observation 0008 % space is given by the number of elements in V (number of alpha elements 0009 % in the previous iteration policy). 0010 % This is only use in the experiment in Figure 11. 0011 % 0012 % See also MakeFigure11. 0013 0014 nj=size(V); % number of synthetic observations 0015 oData=cell(1,nj); %Weights for the GMixtures in 's' (one for each element in 'V') 0016 0017 0018 % Sample the observations 0019 % Caution: 0020 % To actually get a good discrete observation model 0021 % we must have p(s)=\sum_o p(s|o) p(o) = ct 0022 % This is a strong assumption make in Section 5.1, page 14. 0023 % If this is not this way the whole system breaks. 0024 % Even with acarefully defined p(o,s) in the CS_CO_ObsModel 0025 % p(s) would only be constant if we discretize the obs model with 0026 % a uniform sampling on the observation space. 0027 % This can only be achieved by carefully selecting the samples 0028 % (this is what we do for one-dimensional obs. spaces) or using 0029 % a very large number of uniformly sampled observations (that is 0030 % what it should be done in higher dimensional observations). 0031 % The number of observations to sample is probably so large that 0032 % could make this approach not very useful. 0033 % 0034 if dim(CS_CO_OM.O)==1 0035 oMin=min(CS_CO_OM.O); 0036 oMax=max(CS_CO_OM.O); 0037 oStep=(oMax-oMin)/(nSamples-1); 0038 os=oMin:oStep:oMax; 0039 else 0040 DO=Discretize(CS_CO_OM.O,nSamples); 0041 os=zeros(dim(DO),nSamples); 0042 for i=1:nSamples 0043 os(:,i)=DO{i}; 0044 end 0045 end 0046 0047 nm=zeros(1,nj); 0048 po=UniformProbability(CS_CO_OM.O); 0049 0050 for i=1:nSamples 0051 o=os(:,i); 0052 0053 [bao Os]=Update(CS_CO_OM,ba,o,CS_CO_OM.S); 0054 [v j]=max(Values(V,bao)); 0055 0056 if nm(j)==0 0057 oData{j}=get(Os,'w')/po; 0058 else 0059 oData{j}=oData{j}+get(Os,'w')/po; 0060 end 0061 nm(j)=nm(j)+1; 0062 end 0063 0064 % Obs models are defined giving p(o,s) and 0065 % oData is a kind of p(o|s). 0066 % We use the fact that p(o,s)=p(o|s)*p(s) 0067 ps=UniformProbability(CS_CO_OM.S); 0068 for i=1:nj 0069 if nm(i)==0 0070 oData{i}=GMixture(); 0071 else 0072 oData{i}=GMixture(oData{i}*(ps/nSamples),CS_CO_OM.gS); 0073 end 0074 end 0075 0076 CS_DO_OM=CS_DO_ObsModel(CS_CO_OM.S,DSpace(nj),oData); 0077 |