Path: blob/master/notebooks/book2/12/rjmcmc_rbf/rjGaussian.m
1193 views
function [y] = rjGaussian(mu,x);1% PURPOSE : Gaussian basis function.2% INPUTS : - mu: The basis centre.3% - x: The evaluation point in the domain.4% OUTPUTS : - y: The value of the Gaussian at x.5% AUTHOR : Nando de Freitas - Thanks for the acknowledgement :-)6% DATE : 21-01-9978if nargin < 2, error('Not enough input arguments.'); end910[N,d] = size(x); % N = number of data, d = dimension of x.11y=zeros(N,1);12for j=1:N,13z=norm(x(j,:)-mu(1,:)); % Euclidean distance.14y(j,1)=exp(-(16*16)*z.^(2)); % Gaussian with fixed width for exp. 1.15% y(j,1)=exp(-(0.5)*inv(.00001)*z.^(2)); % Gaussian.16end;1718192021222324252627