diff options
author | leochanj105 <leochanj@live.unc.edu> | 2020-10-19 23:09:30 -0400 |
---|---|---|
committer | leochanj105 <leochanj@live.unc.edu> | 2020-10-20 02:40:39 -0400 |
commit | f618466c25d43f3bae9e40920273bf77de1e1149 (patch) | |
tree | 460e739e2165b8a9c37a9c7ab1b60f5874903543 /SD-VBS/benchmarks/localization/src/matlab/get3DGaussianProb.m | |
parent | 47ced4e96bbb782b9e780e8f2cfc637b2c21ff44 (diff) |
initial sd-vbs
initial sd-vbs
add sd-vbs
sd-vbs
Diffstat (limited to 'SD-VBS/benchmarks/localization/src/matlab/get3DGaussianProb.m')
-rw-r--r-- | SD-VBS/benchmarks/localization/src/matlab/get3DGaussianProb.m | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/SD-VBS/benchmarks/localization/src/matlab/get3DGaussianProb.m b/SD-VBS/benchmarks/localization/src/matlab/get3DGaussianProb.m new file mode 100644 index 0000000..6a54530 --- /dev/null +++ b/SD-VBS/benchmarks/localization/src/matlab/get3DGaussianProb.m | |||
@@ -0,0 +1,22 @@ | |||
1 | function p=get3DGaussianProb(data, mean, A) | ||
2 | n_data=size(data,1); | ||
3 | n_channel=size(data,2); | ||
4 | |||
5 | p=zeros(n_data,1); | ||
6 | diff=(data)-ones(n_data,1)*mean; | ||
7 | detA = 1; %detA = det(A) | ||
8 | dotA = randWrapper(size(diff,1),1); %dotA = dot(diff*A, diff, 2) | ||
9 | p=sqrt(detA/((2*pi)^n_channel))*exp(-0.5*dotA); | ||
10 | |||
11 | %% KVS If the above doesnt work, try uncommenting these lines below | ||
12 | |||
13 | %%temp = (det(A)/((2*pi)^n_channel)); | ||
14 | %temp = (1.0/((2*pi)^n_channel)); | ||
15 | %temp1 = dot(diff*A,diff,2); | ||
16 | %%temp1 = rand(1000,1); | ||
17 | %temp2 = exp(-0.5*temp1); | ||
18 | %p = sqrt(temp) * exp(temp2); | ||
19 | % | ||
20 | |||
21 | |||
22 | |||