shogun-toolbox/shogun — pull request #2129 by yorkerlin (2014-04-11 22:46:39+00:00)
Title: add the variaitonal example program

@karlnapf
Since this example program does not depend on the previous PR, I send it before the previous PR become merged.
Note that this program needs to load data from files for test the concreteness therefore I add the dataset in shogun-data

Once you think this program is correct, I will remove the load functions so that travis will be fine.
In order to verify the correctness, you need to download or generated data from the provided Matlab code.
For downloading:
Please copy the files from
https://github.com/yorkerlin/shogun-data/tree/master/toy/variational

to shogun/data/variational directory
For generating
https://github.com/yorkerlin/VariationalApproxExample/blob/master/example.m and then copy the generated files to shogun/data/variational directory.

I have tested using the following six datasets
I also print out the m vector.
Let me know if you need to see the result of m.
In general, the relative error between each elements of m is less than 0.00001.

The result of these six datasets are:
For dataset 1
num_samples:1000 num_dimensions:20
logLik from Shogun =106.5732516380 from Matlab =106.5732512165

For dataset 2
num_samples:500 num_dimensions:10
logLik from Shogun =111.6166380205 from Matlab =111.6166377623

For dataset 3
num_samples:800 num_dimensions:40
logLik from Shogun =65.1112812045 from Matlab =65.1112808901

For dataset 4
num_samples:200 num_dimensions:100
logLik from Shogun =15.5989340083 from Matlab =15.5989338981

For dataset 5
num_samples:100 num_dimensions:5
logLik from Shogun =13.3364206234 from Matlab =13.3364205385

For dataset 6
num_samples:20 num_dimensions:5
logLik from Shogun =3.9788173074 from Matlab =3.9788172933