ParaMonte MATLAB 3.0.0
Parallel Monte Carlo and Machine Learning Library
See the latest version documentation.
getLogFunc.m
Go to the documentation of this file.
1%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3%%%% %%%%
4%%%% ParaMonte: Parallel Monte Carlo and Machine Learning Library. %%%%
5%%%% %%%%
6%%%% Copyright (C) 2012-present, The Computational Data Science Lab %%%%
7%%%% %%%%
8%%%% This file is part of the ParaMonte library. %%%%
9%%%% %%%%
10%%%% LICENSE %%%%
11%%%% %%%%
12%%%% https://github.com/cdslaborg/paramonte/blob/main/LICENSE.md %%%%
13%%%% %%%%
14%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
15%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
16
17function logFunc = getLogFunc(point)
18
19% This function returns the probability density function of the standard multivariate normal distribution of ndim dimensions.
20
21 % Standard MultiVariate Normal (SMVN) specifications: https://en.wikipedia.org/wiki/Multivariate_normal_distribution
22
23%----------------------------------------------------------------------
24
25% LOG_SMVN_COEF = length(Point) * log( 1/sqrt(2*pi) );
26% logFunc = LOG_SMVN_COEF - 0.5 * sum(Point.^2);
27
28%----------------------------------------------------------------------
29
30 logFunc = -0.5 * sum(point.^2);
31
32%----------------------------------------------------------------------
33
34 % Rosenbrock test function
35% logFunc = -( 100.0 * (point(2)-point(1)^2)^2 + (point(1)-1.0)^2 )/20;
36%----------------------------------------------------------------------
37
38end
39
40%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
41%%%%%%%%%%%%%%%%% PYTHON-getLogFunc %%%%%%%%%%%%%%%%%%%%%%
42%%%% %%%%
43%%%% def getLogFunc(Point): %%%%
44%%%% %%%%
45%%%% return -0.5 * np.sum( np.double( Point )**2 ) %%%%
46%%%% %%%%
47%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
48%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function getLogFunc(in point)