plateform stringclasses 1
value | repo_name stringlengths 13 113 | name stringlengths 3 74 | ext stringclasses 1
value | path stringlengths 12 229 | size int64 23 843k | source_encoding stringclasses 9
values | md5 stringlengths 32 32 | text stringlengths 23 843k |
|---|---|---|---|---|---|---|---|---|
github | open-connectome-classes/StatConn-Spring-2015-Coursework-master | cluster_jl.m | .m | StatConn-Spring-2015-Coursework-master/project/submission/adjordan/cluster_jl.m | 5,658 | utf_8 | 3108b479bae1019b7f668d75a4b554a9 | % Iplementation : Antoine Scherrer
% antoine.scherrer@ens-lyon.fr
% Apply clustering after :
% "Fast unfolding of community hierarchies in large networks"
% Vincent D. Blondel, Jean-Loup Guillaume, Renaud Lambiotte,
% Etienne Lefebvre
% http://arxiv.org/abs/0803.0476
%
% NON ORIENTED VERSION USING SYMETRIC MATRIX A = M... |
github | open-connectome-classes/StatConn-Spring-2015-Coursework-master | biwsbm.m | .m | StatConn-Spring-2015-Coursework-master/project/proposal/Sandra's final project/SGR-Finalprojectdata/biwsbm.m | 6,708 | utf_8 | 445313583275a7a25c7d8263f445c118 |
function [Labels,Model] = biwsbm(E,K_0,K_1,types,varargin)
%BIWSBM finds latent community structure in bipartite networks.
%
% BIWSBM is a wrapper around the WSBM algorithm used for the special case
% of bipartite networks. It takes advantage of our prior knowledge of
% the bipartite sstructure.
% This algori... |
github | open-connectome-classes/StatConn-Spring-2015-Coursework-master | wsbm_driver.m | .m | StatConn-Spring-2015-Coursework-master/project/proposal/Sandra's final project/SGR-Finalprojectdata/wsbm_driver.m | 24,295 | utf_8 | f42d8b02abacff3f820f48f08f3a4415 | function [Model] = wsbm_driver(Raw_Data,R_Struct,varargin)
% See 'help wsbm.m' or 'type wsbm.m' for information
%-------------------------------------------------------------------------%
% WSBM_Driver
% Version 1.0 | December 2013 | Christopher Aicher
%
% Copyright 2013-2014 Christopher Aicher
%
% This program is... |
github | open-connectome-classes/StatConn-Spring-2015-Coursework-master | main_alg.m | .m | StatConn-Spring-2015-Coursework-master/project/proposal/Sandra's final project/SGR-Finalprojectdata/main_alg.m | 13,994 | utf_8 | 0d364cb89ee6f3a0fc4e94914a33b5b9 | function [Para,Flags] = main_alg(Data,W_Distr,E_Distr,R_Struct,Seed,Options)
%MAIN_ALG is a single run of a variational algorithm to infer the
% parameters of the WSBM using a specified weight (W_Distr) and
% edge (E_Distr) distribution and partitioning (R_Struct).
%
% The algorithm consists of two nested-loops.
... |
github | open-connectome-classes/StatConn-Spring-2015-Coursework-master | main_alg.m | .m | StatConn-Spring-2015-Coursework-master/project/proposal/Sandra's final project/SGR-Finalprojectdata/private/main_alg.m | 13,994 | utf_8 | 0d364cb89ee6f3a0fc4e94914a33b5b9 | function [Para,Flags] = main_alg(Data,W_Distr,E_Distr,R_Struct,Seed,Options)
%MAIN_ALG is a single run of a variational algorithm to infer the
% parameters of the WSBM using a specified weight (W_Distr) and
% edge (E_Distr) distribution and partitioning (R_Struct).
%
% The algorithm consists of two nested-loops.
... |
github | djoshea/matlab-auto-axis-master | testAutoAxisSubplot2.m | .m | matlab-auto-axis-master/testing/testAutoAxisSubplot2.m | 1,679 | utf_8 | d6e637fa2ed484822b21a17788d84612 | function testAutoAxisSubplot2()
import AutoAxis.PositionType;
import AutoAxis.AnchorInfo;
clf;
R = 2;
C = 2;
p = OuterPanel();
p.pack(R,C);
p.units = 'cm';
%p.margin = 0;
%p.de.margin = 0;
%p.margin = [2.2 2.2 1 1];
%p.de.margin = 0.4;
%p.setCallback(@callbackFn)... |
github | djoshea/matlab-auto-axis-master | testAutoAxisSubplot3.m | .m | matlab-auto-axis-master/testing/testAutoAxisSubplot3.m | 1,079 | utf_8 | 505aa96e147d14f42eedbf81119002b4 | function testAutoAxisSubplot()
import AutoAxis.PositionType;
import AutoAxis.AnchorInfo;
clf;
R = 2;
C = 2;
axh = nan(R,C);
au = cell(R,C);
idx = 0;
for r = 1:R
for c = 1:C
idx = idx + 1;
axh(r,c) = subplot(R,C,idx);
t =... |
github | djoshea/matlab-auto-axis-master | testAutoAxisPanel2.m | .m | matlab-auto-axis-master/testing/testAutoAxisPanel2.m | 1,487 | utf_8 | be1c56871d0930a31227623d7f8014db | function testAutoAxisPanel2()
import AutoAxis.PositionType;
import AutoAxis.AnchorInfo;
clf;
R = 1;
C = 2;
p = OuterPanel();
p.pack(R,C);
p.units = 'cm';
p.setCallback(@callbackFn);
axh = nan(R,C);
au = cell(R,C);
for r = 1:R
for c = 1:C
axh(r,c) ... |
github | djoshea/matlab-auto-axis-master | testAutoAxisSubplot.m | .m | matlab-auto-axis-master/testing/testAutoAxisSubplot.m | 1,586 | utf_8 | 6c1c20476b464091b0409cd0b79619d8 | function testAutoAxisSubplot()
import AutoAxis.PositionType;
import AutoAxis.AnchorInfo;
clf;
R = 3;
C = 3;
p = panel();
p.pack(R,C);
p.units = 'cm';
p.margin = 0;
p.de.margin = 0;
p.margin = [2.2 2.4 1 1];
p.de.margin = 0.4;
p.setCallback(@callbackFn);
axh = go... |
github | djoshea/matlab-auto-axis-master | closestNiceLimits.m | .m | matlab-auto-axis-master/autoaxis/+AutoAxisUtilities/closestNiceLimits.m | 1,992 | utf_8 | 304b5e9397debf36a916a15159737d5b | function [vals, increment] = closestNiceLimits(vals, allowUp, allowDown, scale)
% rounds to closest nice number like 0.1, 0.2, 0.5, 1 * 10^#
% allowUp and allowDown are logical the same size as vals and indiciate
% whether roundingUp and roundingDown are permitted
%
% scales is optional, and sets the "relevant scale" o... |
github | mattiasvillani/Talks-master | likBeta.m | .m | Talks-master/Melbourne2016/Code/GP/gpml-matlab-v3.6-2015-07-07/lik/likBeta.m | 4,830 | utf_8 | f017713f081b23ae468146232a0e8cf1 | function [varargout] = likBeta(link, hyp, y, mu, s2, inf, i)
% likBeta - Beta likelihood function for interval data y from [0,1].
% The expression for the likelihood is
% likBeta(f) = 1/Z * y^(mu*phi-1) * (1-y)^((1-mu)*phi-1) with
% mean=mu and variance=mu*(1-mu)/(1+phi) where mu = g(f) is the Beta intensity,
% f ... |
github | mattiasvillani/Talks-master | likT.m | .m | Talks-master/Melbourne2016/Code/GP/gpml-matlab-v3.6-2015-07-07/lik/likT.m | 4,775 | utf_8 | d551e9ce7f259d8929a9a9d9f10f90b2 | function [varargout] = likT(hyp, y, mu, s2, inf, i)
% likT - Student's t likelihood function for regression.
% The expression for the likelihood is
% likT(t) = Z * ( 1 + (t-y)^2/(nu*sn^2) ).^(-(nu+1)/2),
% where Z = gamma((nu+1)/2) / (gamma(nu/2)*sqrt(nu*pi)*sn)
% and y is the mean (for nu>1) and nu*sn^2/(nu-2) is ... |
github | mattiasvillani/Talks-master | likLaplace.m | .m | Talks-master/Melbourne2016/Code/GP/gpml-matlab-v3.6-2015-07-07/lik/likLaplace.m | 6,922 | iso_8859_13 | 7f5fd5418abdf573e28f68fff76fec84 | function [varargout] = likLaplace(hyp, y, mu, s2, inf, i)
% likLaplace - Laplacian likelihood function for regression.
% The expression for the likelihood is
% likLaplace(t) = exp(-|t-y|/b)/(2*b) with b = sn/sqrt(2),
% where y is the mean and sn^2 is the variance.
%
% The hyperparameters are:
%
% hyp = [ log(sn) ... |
github | mattiasvillani/Talks-master | likGaussWarp.m | .m | Talks-master/Melbourne2016/Code/GP/gpml-matlab-v3.6-2015-07-07/lik/likGaussWarp.m | 9,109 | utf_8 | db71c7f4569eb37a505d530f36c01284 | function [varargout] = likGaussWarp(warp, hyp, y, mu, varargin)
% likGaussWarp - Warped Gaussian likelihood for regression.
% The expression for the likelihood is
% likGaussWarp( y | t ) = likGauss( g(y) | t ) * g'(y),
% where likGauss is the Gaussian likelihood and g is the warping function.
%
% The hyperparamete... |
github | mattiasvillani/Talks-master | likNegBinom.m | .m | Talks-master/Melbourne2016/Code/GP/gpml-matlab-v3.6-2015-07-07/lik/likNegBinom.m | 4,709 | utf_8 | 0c9a80f26afbd6d14934d10c1592d19d | function [varargout] = likNegBinom(link, hyp, y, mu, s2, inf, i)
% likNegBinom - Negative binomial likelihood function for count data y.
% The expression for the likelihood is
% likNegBinom(f) = 1/Z * mu^y / (r+mu)^(r+y), Z = r^r*G(y+r)/(G(y+1)*G(r))
% with G(t)=gamma(t)=(t-1)!, mean=mu and variance=mu*(mu+r)/r, wh... |
github | mattiasvillani/Talks-master | likWeibull.m | .m | Talks-master/Melbourne2016/Code/GP/gpml-matlab-v3.6-2015-07-07/lik/likWeibull.m | 4,548 | utf_8 | 7c08c821ff3a643993b664273410e13f | function [varargout] = likWeibull(link, hyp, y, mu, s2, inf, i)
% likWeibull - Weibull likelihood function for strictly positive data y. The
% expression for the likelihood is
% likWeibull(f) = g1*ka/mu * (g1*y/mu)^(ka-1) * exp(-(g1*y/mu)^ka) with
% gj = gamma(1+j/ka), mean=mu and variance=mu^2*(g2/g1^2-1) where mu... |
github | mattiasvillani/Talks-master | likGamma.m | .m | Talks-master/Melbourne2016/Code/GP/gpml-matlab-v3.6-2015-07-07/lik/likGamma.m | 4,573 | utf_8 | c2695ecf87b97ec76b59b691427b4a2f | function [varargout] = likGamma(link, hyp, y, mu, s2, inf, i)
% likGamma - Gamma likelihood function for strictly positive data y. The
% expression for the likelihood is
% likGamma(f) = al^al*y^(al-1)/gamma(al) * exp(-y*al/mu) / mu^al with
% mean=mu and variance=mu^2/al where mu = g(f) is the Gamma intensity, f is... |
github | mattiasvillani/Talks-master | likInvGauss.m | .m | Talks-master/Melbourne2016/Code/GP/gpml-matlab-v3.6-2015-07-07/lik/likInvGauss.m | 4,679 | utf_8 | 9ecb3222b78164d8b602356da3a48adc | function [varargout] = likInvGauss(link, hyp, y, mu, s2, inf, i)
% likInvGauss - Inverse Gaussian likelihood function for strictly positive data
% y. The expression for the likelihood is
% likInvGauss(f) = sqrt(lam/(2*pi*y^3))*exp(-lam*(mu-y)^2/(2*mu^2*y)) with
% mean=mu and variance=mu^3/lam where mu = g(f) is th... |
github | mattiasvillani/Talks-master | likPoisson.m | .m | Talks-master/Melbourne2016/Code/GP/gpml-matlab-v3.6-2015-07-07/lik/likPoisson.m | 4,178 | utf_8 | 2d975f2bcb10e17f253ce4d36bd3ca78 | function [varargout] = likPoisson(link, hyp, y, mu, s2, inf, i)
% likPoisson - Poisson likelihood function for count data y. The expression for
% the likelihood is
% likPoisson(f) = mu^y * exp(-mu) / y! with mean=variance=mu
% where mu = g(f) is the Poisson intensity, f is a
% Gaussian process, y is the non-negativ... |
github | mattiasvillani/Talks-master | likLogistic.m | .m | Talks-master/Melbourne2016/Code/GP/gpml-matlab-v3.6-2015-07-07/lik/likLogistic.m | 6,137 | utf_8 | 527e5959fbb8bae3f9980e898ada4956 | function [varargout] = likLogistic(hyp, y, mu, s2, inf, i)
% likLogistic - logistic function for binary classification or logit regression.
% The expression for the likelihood is
% likLogistic(t) = 1./(1+exp(-t)).
%
% Several modes are provided, for computing likelihoods, derivatives and moments
% respectively, see... |
github | mattiasvillani/Talks-master | likSech2.m | .m | Talks-master/Melbourne2016/Code/GP/gpml-matlab-v3.6-2015-07-07/lik/likSech2.m | 8,514 | utf_8 | 669db149fc7157ab5834a447ecfdc501 | function [varargout] = likSech2(hyp, y, mu, s2, inf, i)
% likSech2 - sech-square likelihood function for regression. Often, the sech-
% square distribution is also referred to as the logistic distribution not to be
% confused with the logistic function for classification. The expression for the
% likelihood is
% li... |
github | mattiasvillani/Talks-master | likGumbel.m | .m | Talks-master/Melbourne2016/Code/GP/gpml-matlab-v3.6-2015-07-07/lik/likGumbel.m | 3,976 | utf_8 | 3ac9c17ecc01a2a501fb5eb5bafeea6c | function [varargout] = likGumbel(sign, hyp, y, mu, s2, inf, i)
% likGumbel - Gumbel likelihood function for extremal value regression.
% The expression for the likelihood is
% likGumbel(t) = exp(-z-exp(-z))/be, z = ga+s*(y-t)/be, be = sn*sqrt(6)/pi
% where s={+1,-1} is a sign switching between left and right skewed... |
github | mattiasvillani/Talks-master | priorSmoothBox1.m | .m | Talks-master/Melbourne2016/Code/GP/gpml-matlab-v3.6-2015-07-07/prior/priorSmoothBox1.m | 1,771 | utf_8 | 4fc9d6491b923568cc0b19a1894509a5 | function [lp,dlp] = priorSmoothBox1(a,b,eta,x)
% Univariate smoothed box prior distribution with linear decay in the log domain
% and infinite support over the whole real axis.
% Compute log-likelihood and its derivative or draw a random sample.
% The prior distribution is parameterized as:
%
% p(x) = 1/w*sigm... |
github | mattiasvillani/Talks-master | logphi.m | .m | Talks-master/Melbourne2016/Code/GP/gpml-matlab-v3.6-2015-07-07/util/logphi.m | 2,261 | utf_8 | 69fbcfc9d9913da15644d5f0a0368d5f | % Safe computation of logphi(z) = log(normcdf(z)) and its derivatives
% dlogphi(z) = normpdf(x)/normcdf(x).
% The function is based on index 5725 in Hart et al. and gsl_sf_log_erfc_e.
%
% Copyright (c) by Carl Edward Rasmussen and Hannes Nickisch, 2013-11-13.
function [lp,dlp,d2lp,d3lp] = logphi(z)
... |
github | mattiasvillani/Talks-master | gauher.m | .m | Talks-master/Melbourne2016/Code/GP/gpml-matlab-v3.6-2015-07-07/util/gauher.m | 2,245 | utf_8 | 441ef6c145fe66f1b7ca9da6207f6003 | % compute abscissas and weight factors for Gaussian-Hermite quadrature
%
% CALL: [x,w] = gauher(N)
%
% x = base points (abscissas)
% w = weight factors
% N = number of base points (abscissas) (integrates an up to (2N-1)th order
% polynomial exactly)
%
% p(x)=exp(-x^2/2)/sqrt(2*pi), a =-Inf, b = Inf
%
% Th... |
github | mattiasvillani/Talks-master | elsympol.m | .m | Talks-master/Melbourne2016/Code/GP/gpml-matlab-v3.6-2015-07-07/util/elsympol.m | 699 | utf_8 | 33e751b982c07eb890d26629bf71f595 | % Evaluate the order R elementary symmetric polynomial Newton's identity aka
% the Newton–Girard formulae: http://en.wikipedia.org/wiki/Newton's_identities
%
% Copyright (c) by Carl Edward Rasmussen and Hannes Nickisch, 2010-01-10.
function E = elsympol(Z,R)
% evaluate 'power sums' of the individual terms in Z
sz = si... |
github | mattiasvillani/Talks-master | minimize.m | .m | Talks-master/Melbourne2016/Code/GP/gpml-matlab-v3.6-2015-07-07/util/minimize.m | 11,191 | utf_8 | 69603a3c319cf5374483af20b033f10e | function [X, fX, i] = minimize(X, f, length, varargin)
% Minimize a differentiable multivariate function using conjugate gradients.
%
% Usage: [X, fX, i] = minimize(X, f, length, P1, P2, P3, ... )
%
% X initial guess; may be of any type, including struct and cell array
% f the name or pointer to the funct... |
github | mattiasvillani/Talks-master | minimize_v2.m | .m | Talks-master/Melbourne2016/Code/GP/gpml-matlab-v3.6-2015-07-07/util/minimize_v2.m | 11,952 | utf_8 | d8aad9cf50639371a892fbcc202eed7c | % minimize.m - minimize a smooth differentiable multivariate function using
% LBFGS (Limited memory LBFGS) or CG (Conjugate Gradients)
% Usage: [X, fX, i] = minimize(X, F, p, other, ... )
% where
% X is an initial guess (any type: vector, matrix, cell array, struct)
% F is the objective function (function poi... |
github | mattiasvillani/Talks-master | sq_dist.m | .m | Talks-master/Melbourne2016/Code/GP/gpml-matlab-v3.6-2015-07-07/util/sq_dist.m | 1,967 | utf_8 | 75b906d47729b33d7567f1353ced2f83 | % sq_dist - a function to compute a matrix of all pairwise squared distances
% between two sets of vectors, stored in the columns of the two matrices, a
% (of size D by n) and b (of size D by m). If only a single argument is given
% or the second matrix is empty, the missing matrix is taken to be identical
% to the fir... |
github | mattiasvillani/Talks-master | cov_deriv_sq_dist.m | .m | Talks-master/Melbourne2016/Code/GP/gpml-matlab-v3.6-2015-07-07/util/cov_deriv_sq_dist.m | 1,906 | utf_8 | 625e697b220630f920d967bce06884e7 | % Compute derivative k'(x^p,x^q) of a stationary covariance k(d2) (ard or iso)
% w.r.t. to squared distance d2 = (x^p - x^q)'*inv(P)*(x^p - x^q) measure. Here
% P is either diagonal with ARD parameters ell_1^2,...,ell_D^2 where D is the
% dimension of the input space or ell^2 times the unit matrix for isotropic
% covar... |
github | mattiasvillani/Talks-master | unwrap.m | .m | Talks-master/Melbourne2016/Code/GP/gpml-matlab-v3.6-2015-07-07/util/unwrap.m | 651 | utf_8 | 47d4deafec9cfdde0a4c291b3825c401 | % Extract the numerical values from "s" into the column vector "v". The
% variable "s" can be of any type, including struct and cell array.
% Non-numerical elements are ignored. See also the reverse rewrap.m.
function v = unwrap(s)
v = [];
if isnumeric(s)
v = s(:); % numeric values are re... |
github | mattiasvillani/Talks-master | glm_invlink_expexp.m | .m | Talks-master/Melbourne2016/Code/GP/gpml-matlab-v3.6-2015-07-07/util/glm_invlink_expexp.m | 427 | utf_8 | 99a5cdb9880a947109671401c7398199 | % Compute the log intensity for the inverse link function g(f) = exp(-exp(-f)).
%
% The function is used in GLM likelihoods such as likPoisson, likGamma, likBeta
% and likInvGauss.
%
% Copyright (c) by Hannes Nickisch, 2013-10-16.
function [lg,dlg,d2lg,d3lg] = glm_invlink_expexp(f)
lg = -exp(-f);
if nargout>1
... |
github | mattiasvillani/Talks-master | glm_invlink_logistic.m | .m | Talks-master/Melbourne2016/Code/GP/gpml-matlab-v3.6-2015-07-07/util/glm_invlink_logistic.m | 686 | utf_8 | b21f086f037b6560c290e0044e0beef5 | % Compute the log intensity for the inverse link function g(f) = log(1+exp(f))).
%
% The function is used in GLM likelihoods such as likPoisson, likGamma, likBeta
% and likInvGauss.
%
% Copyright (c) by Hannes Nickisch, 2013-10-16.
function [lg,dlg,d2lg,d3lg] = glm_invlink_logistic(f)
l1pef = max(0,f) + log(1+exp(-a... |
github | mattiasvillani/Talks-master | minimize_v1.m | .m | Talks-master/Melbourne2016/Code/GP/gpml-matlab-v3.6-2015-07-07/util/minimize_v1.m | 11,202 | utf_8 | cd58ba0b83b1121423ed9a53b33562a1 | function [X, fX, i] = minimize_old(X, f, length, varargin)
% Minimize a differentiable multivariate function using conjugate gradients.
%
% Usage: [X, fX, i] = minimize(X, f, length, P1, P2, P3, ... )
%
% X initial guess; may be of any type, including struct and cell array
% f the name or pointer to the f... |
github | mattiasvillani/Talks-master | rewrap.m | .m | Talks-master/Melbourne2016/Code/GP/gpml-matlab-v3.6-2015-07-07/util/rewrap.m | 1,014 | utf_8 | 64b6d7c0f51a8c77ddd012370a288b20 | % Map the numerical elements in the vector "v" onto the variables "s" which can
% be of any type. The number of numerical elements must match; on exit "v"
% should be empty. Non-numerical entries are just copied. See also unwrap.m.
function [s v] = rewrap(s, v)
if isnumeric(s)
if numel(v) < numel(s)
error('The ... |
github | mattiasvillani/Talks-master | solve_chol.m | .m | Talks-master/Melbourne2016/Code/GP/gpml-matlab-v3.6-2015-07-07/util/solve_chol.m | 994 | utf_8 | f4d6cd4b9e7b0a955c2c8709a4894dd3 | % solve_chol - solve linear equations from the Cholesky factorization.
% Solve A*X = B for X, where A is square, symmetric, positive definite. The
% input to the function is R the Cholesky decomposition of A and the matrix B.
% Example: X = solve_chol(chol(A),B);
%
% NOTE: The program code is written in the C language ... |
github | mattiasvillani/Talks-master | glm_invlink_logit.m | .m | Talks-master/Melbourne2016/Code/GP/gpml-matlab-v3.6-2015-07-07/util/glm_invlink_logit.m | 786 | utf_8 | b2fc9a03b835c7f6643f37b29eac8c0b | % Compute the log intensity for the inverse link function g(f) = 1/(1+exp(-f)).
%
% The function is used in GLM likelihoods such as likPoisson, likGamma, likBeta
% and likInvGauss.
%
% Copyright (c) by Hannes Nickisch, 2013-10-16.
function varargout = glm_invlink_logit(f)
varargout = cell(nargout, 1); % allocate th... |
github | mattiasvillani/Talks-master | minimize_lbfgsb_gradfun.m | .m | Talks-master/Melbourne2016/Code/GP/gpml-matlab-v3.6-2015-07-07/util/minimize_lbfgsb_gradfun.m | 2,390 | utf_8 | 0eca58fc12d068780d735fd5a83ebdfa | function G = minimize_lbfgsb_gradfun(X,varargin)
% extract input arguments
varargin = varargin{1}; strctX = varargin{2}; f = varargin{1};
% global variables serve as communication interface between calls
global minimize_lbfgsb_iteration_number
global minimize_lbfgsb_objective
global minimize_lbfgsb_gradie... |
github | mattiasvillani/Talks-master | minimize_lbfgsb.m | .m | Talks-master/Melbourne2016/Code/GP/gpml-matlab-v3.6-2015-07-07/util/minimize_lbfgsb.m | 4,476 | utf_8 | 10c2d1fef0bdc071cd35d3904c88f0ed | function [X, fX, i] = minimize_lbfgsb(X, f, length, varargin)
% Minimize a differentiable multivariate function using quasi Newton.
%
% Usage: [X, fX, i] = minimize_lbfgsb(X, f, length, P1, P2, P3, ... )
%
% X initial guess; may be of any type, including struct and cell array
% f the name or pointer to th... |
github | mattiasvillani/Talks-master | minimize_lbfgsb_objfun.m | .m | Talks-master/Melbourne2016/Code/GP/gpml-matlab-v3.6-2015-07-07/util/minimize_lbfgsb_objfun.m | 2,695 | utf_8 | d9bbd3614b193a06603c12f33f877104 | function y = minimize_lbfgsb_objfun(X,varargin)
% extract input arguments
varargin = varargin{1}; strctX = varargin{2}; f = varargin{1};
% global variables serve as communication interface between calls
global minimize_lbfgsb_iteration_number
global minimize_lbfgsb_objective
global minimize_lbfgsb_gradien... |
github | mattiasvillani/Talks-master | logsumexp2.m | .m | Talks-master/Melbourne2016/Code/GP/gpml-matlab-v3.6-2015-07-07/util/logsumexp2.m | 454 | utf_8 | aa7e4f12a67c8f2e12bc5d9113b9abd0 | % Compute y = log( sum(exp(x),2) ), the softmax in a numerically safe way by
% subtracting the row maximum to avoid cancelation after taking the exp
% the sum is done along the rows.
%
% Copyright (c) by Hannes Nickisch, 2013-10-16.
function [y,x] = logsumexp2(logx)
N = size(logx,2); max_logx = max(logx,[],2);
%... |
github | mattiasvillani/Talks-master | lik_epquad.m | .m | Talks-master/Melbourne2016/Code/GP/gpml-matlab-v3.6-2015-07-07/util/lik_epquad.m | 1,622 | utf_8 | 9f92aef26b02e08fcee8f74617ebd05d | % Compute infEP part of a likelihood function based on the infLaplace part using
% Gaussian-Hermite quadrature.
%
% The function is used in GLM likelihoods such as likPoisson, likGamma, likBeta
% and likInvGauss.
%
% Copyright (c) by Hannes Nickisch, 2013-10-16.
function varargout = lik_epquad(lik,hyp,y,mu,s2)
n = m... |
github | mattiasvillani/Talks-master | glm_invlink_exp.m | .m | Talks-master/Melbourne2016/Code/GP/gpml-matlab-v3.6-2015-07-07/util/glm_invlink_exp.m | 443 | utf_8 | af4bb74d42054f7b470ed8aecfcf4607 | % Compute the log intensity for the inverse link function g(f) = exp(f).
%
% The function is used in GLM likelihoods such as likPoisson, likGamma, likBeta
% and likInvGauss.
%
% Copyright (c) by Hannes Nickisch, 2013-10-16.
function [lg,dlg,d2lg,d3lg] = glm_invlink_exp(f)
lg = f;
if nargout>1
dlg = ones(size(f... |
github | mattiasvillani/Talks-master | covPeriodicNoDC.m | .m | Talks-master/Melbourne2016/Code/GP/gpml-matlab-v3.6-2015-07-07/cov/covPeriodicNoDC.m | 3,630 | utf_8 | 32d02bd08932f22fe8302ce97b797d39 | function K = covPeriodicNoDC(hyp, x, z, i)
% Stationary covariance function for a smooth periodic function, with period p:
%
% k(x,x') = sf^2 * [k0(pi*(x-x')/p) - f(ell)] / [1 - f(ell)]
% with k0(t) = exp( -2*sin^2(t)/ell^2 ) and f(ell) = \int 0..pi k0(t) dt.
%
% The constant (DC component) has been removed and... |
github | mattiasvillani/Talks-master | covGrid.m | .m | Talks-master/Melbourne2016/Code/GP/gpml-matlab-v3.6-2015-07-07/cov/covGrid.m | 10,069 | utf_8 | b869a274c1f4bc4a09e77a8424a1c57a | function [K,Mx,xe] = covGrid(cov, xg, hyp, x, z, i)
% covGrid - Kronecker covariance function based on a grid.
%
% The grid g is represented by its p axes xg = {x1,x2,..xp}. An axis xi is of
% size (ni,di) and the grid g has size (n1,n2,..,np,D), where D=d1+d2+..+dp.
% Hence, the grid contains N=n1*n2*..*np data point... |
github | mattiasvillani/Talks-master | covPERiso.m | .m | Talks-master/Melbourne2016/Code/GP/gpml-matlab-v3.6-2015-07-07/cov/covPERiso.m | 3,145 | utf_8 | 7308c3f2001744df0d77cd5dc190c637 | function K = covPERiso(cov, hyp, x, z, i)
% Stationary periodic covariance function for an isotropic stationary covariance
% function k0 such as covMaterniso, covPPiso, covRQiso and covSEiso.
% Isotropic stationary means that the covariance function k0(x,z) depends on the
% data points x,z only through the squared dis... |
github | mattiasvillani/Talks-master | covADD.m | .m | Talks-master/Melbourne2016/Code/GP/gpml-matlab-v3.6-2015-07-07/cov/covADD.m | 3,632 | utf_8 | 45875a6c0e52c3f98448f40f6b6fc599 | function K = covADD(cov, hyp, x, z, i)
% Additive covariance function using a 1d base covariance function
% cov(x^p,x^q;hyp) with individual hyperparameters hyp.
%
% k(x^p,x^q) = \sum_{r \in R} sf_r \sum_{|I|=r}
% \prod_{i \in I} cov(x^p_i,x^q_i;hyp_i)
%
% hyp = [ hyp_1
% hyp_2
% ...
... |
github | mattiasvillani/Talks-master | covPERard.m | .m | Talks-master/Melbourne2016/Code/GP/gpml-matlab-v3.6-2015-07-07/cov/covPERard.m | 3,588 | utf_8 | 47dfb8b9857ef5e9bc3693bb6e5c0aa9 | function K = covPERard(cov, hyp, x, z, i)
% Stationary periodic covariance function for a stationary covariance function
% k0 such as covMaternard, covPPard, covRQard and covSEard.
% Stationary means that the covariance function k0(x,z) depends on the
% data points x,z only through the squared distance
% dxz = (x-z)'*... |
github | mattiasvillani/Talks-master | infMCMC.m | .m | Talks-master/Melbourne2016/Code/GP/gpml-matlab-v3.6-2015-07-07/inf/infMCMC.m | 10,673 | utf_8 | 346201720f95a22a681c50bd2535b84c | function [post nlZ dnlZ] = infMCMC(hyp, mean, cov, lik, x, y, par)
% Markov Chain Monte Carlo (MCMC) sampling from posterior and
% Annealed Importance Sampling (AIS) for marginal likelihood estimation.
%
% The algorithms are not to be used as a black box, since the acceptance rate
% of the samplers need to be careful... |
github | mattiasvillani/Talks-master | infKL.m | .m | Talks-master/Melbourne2016/Code/GP/gpml-matlab-v3.6-2015-07-07/inf/infKL.m | 10,289 | utf_8 | ee84ea1fcf907fdd2798ef8dbc3f756d | function [post nlZ dnlZ] = infKL(hyp, mean, cov, lik, x, y)
% Approximation to the posterior Gaussian Process by minimization of the
% KL-divergence. The function is structurally very similar to infEP; the
% only difference being the local divergence measure minimised.
% In infEP, one minimises KL(p,q) whereas in inf... |
github | mattiasvillani/Talks-master | infFITC_EP.m | .m | Talks-master/Melbourne2016/Code/GP/gpml-matlab-v3.6-2015-07-07/inf/infFITC_EP.m | 12,117 | utf_8 | a2c1fccebe29502421d32ed7ab5fcd14 | function [post nlZ dnlZ] = infFITC_EP(hyp, mean, cov, lik, x, y)
% FITC-EP approximation to the posterior Gaussian process. The function is
% equivalent to infEP with the covariance function:
% Kt = Q + G; G = diag(g); g = diag(K-Q); Q = Ku'*inv(Kuu + snu2*eye(nu))*Ku;
% where Ku and Kuu are covariances w.r.t.... |
github | mattiasvillani/Talks-master | infFITC_Laplace.m | .m | Talks-master/Melbourne2016/Code/GP/gpml-matlab-v3.6-2015-07-07/inf/infFITC_Laplace.m | 11,371 | utf_8 | 4e61736cbd55afa355817d83a67a5929 | function [post nlZ dnlZ] = infFITC_Laplace(hyp, mean, cov, lik, x, y)
% FITC-Laplace approximation to the posterior Gaussian process. The function is
% equivalent to infLaplace with the covariance function:
% Kt = Q + G; G = diag(g); g = diag(K-Q); Q = Ku'*inv(Kuu + snu2*eye(nu))*Ku;
% where Ku and Kuu are covarian... |
github | mattiasvillani/Talks-master | infGrid.m | .m | Talks-master/Melbourne2016/Code/GP/gpml-matlab-v3.6-2015-07-07/inf/infGrid.m | 7,789 | utf_8 | c2914da2b9b077868f34920e50e778e7 | function [post nlZ dnlZ] = infGrid(hyp, mean, cov, lik, x, y, opt)
% Inference for a GP with Gaussian likelihood and covGrid covariance.
% The (Kronecker) covariance matrix used is given by:
% K = kron( kron(...,K{2}), K{1} ) = K_p x .. x K_2 x K_1.
%
% Compute a parametrization of the posterior, the negative log ma... |
github | mattiasvillani/Talks-master | infEP.m | .m | Talks-master/Melbourne2016/Code/GP/gpml-matlab-v3.6-2015-07-07/inf/infEP.m | 6,048 | utf_8 | 3f4172f21efbd130a1740a8ea07848ae | function [post nlZ dnlZ] = infEP(hyp, mean, cov, lik, x, y)
% Expectation Propagation approximation to the posterior Gaussian Process.
% The function takes a specified covariance function (see covFunctions.m) and
% likelihood function (see likFunctions.m), and is designed to be used with
% gp.m. See also infMethods.m.... |
github | mattiasvillani/Talks-master | infVB.m | .m | Talks-master/Melbourne2016/Code/GP/gpml-matlab-v3.6-2015-07-07/inf/infVB.m | 6,186 | utf_8 | 5a94d05020f0b3621de4ffc3561fb047 | function [post, nlZ, dnlZ] = infVB(hyp, mean, cov, lik, x, y, opt)
% Variational approximation to the posterior Gaussian process.
% The function takes a specified covariance function (see covFunctions.m) and
% likelihood function (see likFunctions.m), and is designed to be used with
% gp.m. See also infMethods.m.
%
% ... |
github | mattiasvillani/Talks-master | infLaplace.m | .m | Talks-master/Melbourne2016/Code/GP/gpml-matlab-v3.6-2015-07-07/inf/infLaplace.m | 7,948 | utf_8 | f67d900c253de6908511e37d2c482c56 | function [post nlZ dnlZ] = infLaplace(hyp, mean, cov, lik, x, y, opt)
% Laplace approximation to the posterior Gaussian process.
% The function takes a specified covariance function (see covFunctions.m) and
% likelihood function (see likFunctions.m), and is designed to be used with
% gp.m. See also infMethods.m.
%
% C... |
github | mattiasvillani/Talks-master | infGrid_Laplace.m | .m | Talks-master/Melbourne2016/Code/GP/gpml-matlab-v3.6-2015-07-07/inf/infGrid_Laplace.m | 13,627 | utf_8 | f3648192f78c2bc1e561e6fc692f2f3f | function [post nlZ dnlZ] = infGrid_Laplace(hyp, mean, cov, lik, x, y, opt)
% Laplace approximation to the posterior Gaussian process with covGrid
% covariance and (possibly) non-Gaussian likelihood.
% The (Kronecker) covariance matrix used is given by:
% K = kron( kron(...,K{2}), K{1} ) = K_p x .. x K_2 x K_1.
%
% T... |
github | csdms-contrib/slepian_alpha-master | penlift.m | .m | slepian_alpha-master/penlift.m | 2,911 | utf_8 | b9236b77bc221abb28f5c5adcb85a653 | function varargout=penlift(varargin)
% [X,Y,Z,p]=penlift(X,Y,Z,dlev)
% [X,Y]=penlift(X,Y,dlev)
% XYZ=penlift(XYZ,dlev)
%
% Lifts the pen by inserting NaNs where the jumps are deemed to big
%
% INPUT:
%
% X,Y,Z Coordinates (one Mx3 matrix may replace three Mx1 matrices)
% dlev Whatever exceeds the metric du j... |
github | csdms-contrib/slepian_alpha-master | grunbaum2.m | .m | slepian_alpha-master/grunbaum2.m | 5,104 | utf_8 | 38177b50157355ac78853d3b3526c1c3 | function [E,Vg,th,C,T,V]=grunbaum2(TH,L,m,nth,grd)
% [E,Vg,th,C,T,V]=GRUNBAUM2(TH,L,m,nth,grd)
%
% Eigenfunctions of the DOUBLE POLAR CAP concentration problem.
%
% Calculates the matrix the way Grunbaum et al. (1982) propose.
% Orders the eigenfunctions in decreasing order.
%
% INPUT:
%
% TH Angular extent of... |
github | csdms-contrib/slepian_alpha-master | fhanning.m | .m | slepian_alpha-master/fhanning.m | 762 | utf_8 | d1cb21ca677120d58d109a5ac5dd767c | function [w,wl,wr]=fhanning(n)
% [w,wl,wr]=fhanning(n)
%
% Calculates Hanning windows of a certain length
%
% INPUT:
%
% n The required length of the window
%
% OUTPUT:
%
% w The Hanning window for bandpass
% wl The left half of the window for lowpass
% wr The right half of the window for lowpass
... |
github | csdms-contrib/slepian_alpha-master | plotonsphere.m | .m | slepian_alpha-master/plotonsphere.m | 6,817 | utf_8 | 017f937c1faf4899e6ebbaa4cde1079d | function varargout=plotonsphere(data,rang,mygrid,conts)
% pc=PLOTONSPHERE(data,rang,mygrid,conts)
%
% Plots data as raised topography and colors onto a sphere. Has the option
% to add grid lines and continent outlines.
%
% INPUT:
%
% data Standard 2D geographic data; i.e. the first column is the
% Greenwic... |
github | csdms-contrib/slepian_alpha-master | christoffeldarboux.m | .m | slepian_alpha-master/christoffeldarboux.m | 2,868 | utf_8 | 6312098ab4827208ecd7c3244cb1b145 | function varargout=christoffeldarboux(ks,m,L,mu,mup)
% [m,L,D]=CHRISTOFFELDARBOUX(ks,m,L,mu,mup)
%
% Legendre versions of the Christoffel-Darboux formula as quoted by
% Simons, Dahlen and Wieczorek, SIAM Review. (2006), eqs (3.10) and (5.15)
%
% INPUT:
%
% ks 1 Standard formula with (mu-mup)
% 2 Modified formula... |
github | csdms-contrib/slepian_alpha-master | wigner3jm.m | .m | slepian_alpha-master/wigner3jm.m | 13,207 | utf_8 | 8d6befc8221d29a722f95c506aa16dca | function [w3j,j]=wigner3jm(L,l2,l3,m1,m2,m3)
% [w3j,j]=WIGNER3JM(L,l2,l3,m1,m2,m3)
%
% Calculates Wigner 3j symbols by recursion, for all values of j<=L
% allowed in the expression (L l2 l3)
% (m1 m2 m3)
% There is no truncation at any bandwidth - they are all returned
% Note the selection ru... |
github | csdms-contrib/slepian_alpha-master | klmlmp2rot.m | .m | slepian_alpha-master/klmlmp2rot.m | 4,302 | utf_8 | 305618a5e51d8142e46be68581214ae9 | function [K2,K1,K]=klmlmp2rot(Klmlmp,lonc,latc)
% [K2,K1,K]=KLMLMP2ROT(Klmlmp,lonc,latc)
%
% INPUT:
%
% Klmlmp A localization kernel coming out of, e.g. KERNELC, or SDWCAP
% lonc A "longitudinal" rotation parameter
% latc A "latitudinal" rotation parameter
%
% OUTPUT:
%
% K2 The same kernel ro... |
github | csdms-contrib/slepian_alpha-master | galphapto.m | .m | slepian_alpha-master/galphapto.m | 11,087 | utf_8 | 2635ce2e3148cb3533a7f5d413d0afa7 | function varargout=...
galphapto(TH,L,phi0,theta0,omega,theta,phi,J,irr,Glma,V,N,EL,EM)
% [Gar,V,N,J,phi0,theta0,omega,theta,phi,TH,L,Glma,EL,EM]=...
% GALPHAPTO(TH,L,phi0,theta0,omega,theta,phi,J,irr,Glma,V,N,EL,EM)
%
% This function returns an (alpha)X(r) matrix with the spatially
% expanded BANDLIMITED ... |
github | csdms-contrib/slepian_alpha-master | orthocheck.m | .m | slepian_alpha-master/orthocheck.m | 8,662 | utf_8 | 57d0b2fbb7b5cb182ddbb64fa6706337 | function [ngl1,ngl2,com,Vc,nofa,zmean]=orthocheck(C,V,TH,m,sord,ntw,cmean)
% [ngl1,ngl2,com,Vc,nofa,zmean]=ORTHOCHECK(C,V,TH,m,sord,ntw,cmean)
%
% Checks the orthonormality of a SINGLE-ORDER spherical harmonic
% expansion over the UNIT SPHERE and over a SINGLE or DOUBLE spherical CAP.
% If no EIGENVALUES are known, cal... |
github | csdms-contrib/slepian_alpha-master | localization.m | .m | slepian_alpha-master/localization.m | 12,357 | utf_8 | 013383b8238f0ec7ae1b243833f382bd | function varargout=localization(L,dom,N,J,rotb,anti)
% [V,C,dels,dems,XY,Klmlmp,G]=LOCALIZATION(L,dom,N,J,rotb,anti)
%
% Returns bandlimited spectral eigenfunctions and their associated
% eigenvalues localized to a closed domain on the unit sphere.
%
% INPUT:
%
% L Bandwidth, maximum angular spherical harmonic ... |
github | csdms-contrib/slepian_alpha-master | sdwdiagram.m | .m | slepian_alpha-master/sdwdiagram.m | 9,039 | utf_8 | 28da19311933ae258205d19d6b9efc2e | function sdwdiagram
% SDWDIAGRAM
%
% Makes a diagram of the spherical set-up of the program
% Simons, Dahlen and Wieczorek, Figure 1.
%
% Tested on 8.3.0.532 (R2014a)
% Last modified by fjsimons-at-alum.mit.edu, 06/21/2016
% Which vector to plot
ang=40;
% Down to this z level for the projection
lz=-0.2;
% Rotation of ... |
github | csdms-contrib/slepian_alpha-master | plm2rot.m | .m | slepian_alpha-master/plm2rot.m | 14,944 | utf_8 | 20e93bb2daa80cffaa97ecb900543474 | function varargout=plm2rot(lmcosi,alp,bta,gam,method,rlcp)
% [lmcosip,spec1,spec2]=PLM2ROT(lmcosi,alp,bta,gam,method,rlcp)
%
% Rotates a scalar FIELD expanded into real spherical harmonics on the
% unit sphere surface using Euler angles in an ACTIVE rotation convention
% (the inverse of DT pp 920-924). The results are ... |
github | csdms-contrib/slepian_alpha-master | sdwregions.m | .m | slepian_alpha-master/sdwregions.m | 11,266 | utf_8 | 91fa218667d4c962d4e7212ce6cbda28 | function varargout=sdwregions(par,fi,L)
% [ah,ha,bh,th]=SDWREGIONS(par,fi,L)
%
% INPUT:
%
% par 1 Eigenvalue plot [Simons et al. SIAM Review (2006) Fig 6.1]
% 3 Australia [Simons et al. SIAM Review (2006) Fig 6.2]
% 4 North America [Simons & Dahlen SPIE (2007) Fig 2]
% 5 Africa [Simons e... |
github | csdms-contrib/slepian_alpha-master | xyz2plm.m | .m | slepian_alpha-master/xyz2plm.m | 9,657 | utf_8 | b523627ac15a6eaf46ab22ae70dc8c58 | function [lmcosi,dw,L2err]=xyz2plm(fthph,L,method,lat,lon,cnd)
% [lmcosi,dw,L2err]=XYZ2PLM(fthph,L,method,lat,lon,cnd)
%
% Forward real spherical harmonic transform in the 4pi normalized basis.
%
% Converts a spatially gridded field into spherical harmonics.
% For complete and regular spatial samplings [0 360 -90 90].
... |
github | rudrapoudel/hello_ml-master | checkNumericalGradient.m | .m | hello_ml-master/stanford-tutorials/common/checkNumericalGradient.m | 1,982 | utf_8 | 689a352eb2927b0838af5dc508f6374d | function [] = checkNumericalGradient()
% This code can be used to check your numerical gradient implementation
% in computeNumericalGradient.m
% It analytically evaluates the gradient of a very simple function called
% simpleQuadraticFunction (see below) and compares the result with your numerical
% solution. Your num... |
github | rudrapoudel/hello_ml-master | sampleIMAGES.m | .m | hello_ml-master/stanford-tutorials/common/sampleIMAGES.m | 2,314 | utf_8 | 2f94a7fbac78641d56d0e33869769478 | function patches = sampleIMAGES(images, patchsize, numpatches)
% sampleIMAGES
% Returns 10000 patches for training
%load IMAGES; % load images from disk
images = load('IMAGES.mat');
images = images.IMAGES;
%patchsize = 8; % we'll use 8x8 patches
%numpatches = 10000;
% Initialize patches with zeros. Your code ... |
github | rudrapoudel/hello_ml-master | WolfeLineSearch.m | .m | hello_ml-master/stanford-tutorials/minFunc/WolfeLineSearch.m | 11,478 | utf_8 | d10187f2fedfa4143ebd6300537b6be4 | function [t,f_new,g_new,funEvals,H] = WolfeLineSearch(...
x,t,d,f,g,gtd,c1,c2,LS,maxLS,tolX,debug,doPlot,saveHessianComp,funObj,varargin)
%
% Bracketing Line Search to Satisfy Wolfe Conditions
%
% Inputs:
% x: starting location
% t: initial step size
% d: descent direction
% f: function value at st... |
github | rudrapoudel/hello_ml-master | minFunc_processInputOptions.m | .m | hello_ml-master/stanford-tutorials/minFunc/minFunc_processInputOptions.m | 3,704 | utf_8 | dc74c67d849970de7f16c873fcf155bc |
function [verbose,verboseI,debug,doPlot,maxFunEvals,maxIter,tolFun,tolX,method,...
corrections,c1,c2,LS_init,LS,cgSolve,qnUpdate,cgUpdate,initialHessType,...
HessianModify,Fref,useComplex,numDiff,LS_saveHessianComp,...
DerivativeCheck,Damped,HvFunc,bbType,cycle,...
HessianIter,outputFcn,useMex,use... |
github | juliamatlab/mexjulia-master | lmdif.m | .m | mexjulia-master/examples/lmdif.m | 478 | utf_8 | 4d84bdff7a0ba4e06708b9906cf2672c | % Levenberg-Marquardt solver with finite differencing for the Jacobian
function x = lmdif(f, x0)
% first time through, load the julia function
persistent loaded;
if isempty(loaded)
jl_file = fullfile(fileparts(mfilename('fullpath')), 'lmdif.jl');
jl.include(jl_file);
loaded = true;
end
sln = jl.callkw('lmdif', ... |
github | juliamatlab/mexjulia-master | lmdif_test.m | .m | mexjulia-master/examples/lmdif_test.m | 311 | utf_8 | a18f1ad3eb644ec390ade82c3b2ab7cf | function sln = lmdif_test(n)
if nargin < 1
n = 100;
end
% an example using handles to anonymous functions
kappa = 100;
f = @(x) rosenbrock(x, kappa);
x0 = rand(n,1);
sln = lmdif(f, x0);
end
function resid = rosenbrock(x, kappa)
resid = [ 1-x ; kappa.*diff(x) ];
end
|
github | juliamatlab/mexjulia-master | exception_tests.m | .m | mexjulia-master/test/exception_tests.m | 435 | utf_8 | 7c98ab77a954d40ba6c131c79dbb4b92 | function exception_tests()
% a julia exception passed back to matlab
try
jl.call('this_does_not_exist', 42)
catch e
disp(getReport(e))
end
% an example of a matlab exception caught in Julia and passed back to
% matlab (with the Julia backtrace appended)
try
jl.call('call', @(x) exn_thrower(x), 42)
catch e
di... |
github | juliamatlab/mexjulia-master | runtests.m | .m | mexjulia-master/test/runtests.m | 412 | utf_8 | 47897dea864778cad6b1e933a428c791 | function runtests
test simple_eval jleval 1+1
end
function test(name, varargin)
expr = strjoin(varargin, ' ');
try
if eval(expr)
fprintf('Test %s passed.\n', name);
else
fprintf('Test %s failed:\n', name);
fprintf('\t%s', expr);
end
catch exn
... |
github | jegonzal/ParallelGibbs-master | gibbs_sampler.m | .m | ParallelGibbs-master/matlab/gibbs_sampler.m | 7,881 | utf_8 | b30a403ab91276aaddafbcc244c31a05 | %% Parallel Gibbs sampler
% The parallel gibbs sampler is an optimized a c++ implementation of
% the discrete Gibbs samplers which uses multiple threads to
% accelerate the generation of a single sampling chain. The parallel
% Gibbs sampler implements two algorithms described in the paper:
%
% Parallel Gibbs Samplin... |
github | jegonzal/ParallelGibbs-master | table_factor.m | .m | ParallelGibbs-master/matlab/table_factor.m | 1,525 | utf_8 | 594788b85d9bb283d16d642095087db6 | %% Construct a discrete table factor
%
% factor = table_factor(vars, logP)
%
% vars: array of variable ids (e.g., [1,2,4] )
% logP: tensor representing the log potential values (e.g., ones(3,7,2)
% where variable 1 takes on 3 states variable 2 takes on 7 states and
% variable 4 takes on 2 states.
%
% A ta... |
github | jegonzal/ParallelGibbs-master | make_grid_model.m | .m | ParallelGibbs-master/matlab/tests/make_grid_model.m | 1,737 | utf_8 | 9310c056cecd8ce7e9e221ebe8730252 | %% This code generates a grid model
function [factors, img, noisy_img] = make_grid_model(rows, cols, states, ...
lambdaSmooth, noiseP)
% Create a virtual image
[u,v] = meshgrid(linspace(0,1,rows), linspace(0,1,cols));
img = (1 + cos(1./sqrt((u-.5).^2 + (v-.5).^2)) )/2 + u.^2;
img = (img - min(img(:)))/(max(img(:)) ... |
github | jdiedrichsen/dataframe-master | tapply.m | .m | dataframe-master/pivot/tapply.m | 3,010 | utf_8 | 0affd3d97c37fc9f1acc072f56f94840 | function T = tapply(D,categories,varargin)
% T = tapply(D,categories,{dependent 1},{dependent 2},...)
% Condenses a data structure into a new data structure
% EXAMPLE:
% tapply(D,{'Cond','Subcond'},{'RT','mean',subset',D.SN == 1,'name','mRT'},...,'subset',D.good)
% makes a new data frame with variables Cond, Su... |
github | jdiedrichsen/dataframe-master | drawpatch.m | .m | dataframe-master/graph/drawpatch.m | 765 | utf_8 | 8bebe6d4766c875690211f6c53e7571d | function drawpatch(x,p,color,range)
% drawpatch(x,p,color,range)
% x:vector of the x-axis
% p:indexes at which one want to draw the area
% color: color of area
% range is a ymin-ymax vector (set to [0 0.1] by default
if (nargin<4)
range=get(gca,'YLim');
end;
p(p>length(x))=[];
[r,c]=size(x);
if(r>... |
github | jdiedrichsen/dataframe-master | scatterplot.m | .m | dataframe-master/graph/scatterplot.m | 11,445 | utf_8 | e670bf670406e5ae6f27d6e7f9f80568 | function varargout=scatterplot(x,y,varargin)
% function scatterplot(x,y,varargin)
% Provides a scatterplot of the y-values against x-values
% INPUT:
% x: Nx1 vector of x-values
% y: Nx1 vector of y-values
% VARARGIN:
% Format options (for all symbols)
% 'markertype',{o s v ^...}
% 'marke... |
github | jdiedrichsen/dataframe-master | lineplot.m | .m | dataframe-master/graph/lineplot.m | 19,736 | utf_8 | ae0be8be199ffb76dec7a424494e470b | function [x_coord,PLOT,ERROR]=lineplot(xvar,y,varargin)
% Synopsis
% [xcoord,PLOT,ERROR]=lineplot(xvar,y,varargin)
% Description
% xvar: independent variables [N*c], with c>1 a hierarchical grouping is used
% Y: dependent variable [N*1]
% if Y is a N*p varaible, then different lines are plotted for
% differe... |
github | jdiedrichsen/dataframe-master | myboxplot.m | .m | dataframe-master/graph/myboxplot.m | 11,540 | utf_8 | 80e8e5030627665a0246f080d29629a2 | function myboxplot(group,y,varargin)
% myboxplot(group,y,varargin)
% group: one or more variables defining the x-axis
% y: Data to be plotted (one vector)
% Plots a boxplot of the data
% The midline of the box is the median of the data
% The box itself spans from the 25th to 75th percenti... |
github | jdiedrichsen/dataframe-master | testGroupPatternDiff.m | .m | dataframe-master/stats/testGroupPatternDiff.m | 3,786 | utf_8 | 846418da971eea9a106385aa2ed7fd46 | function p = testGroupPatternDiff(Y,g,varargin);
% function p = testGroupPatternDiff(Y,g,varargin);
% This function test for distributed differences between two groups of
% observations, very similar to an between-subejcts MANOVA. However, it
% uses permutation or randomisation statistiscs and cab therefore use dif... |
github | jdiedrichsen/dataframe-master | ancova.m | .m | dataframe-master/stats/ancova.m | 5,319 | utf_8 | e697375d81ebfa0c5e82fed2c40ccb45 | function [Fn,yr]=ancova(y,SN,X,varargin)
% function ancova(y,SN,X,varargin)
% One-way analysis of (co-)variance (ANCOVA).
% INPUTS:
% y: dependent data vector (Nx1)
% SN: Subject or grouping factor: data will be condensed over this factor
% first
% X: independent (grouping) variable (NxQ)
% VARARGIN
% 'subse... |
github | jdiedrichsen/dataframe-master | MANOVA2.m | .m | dataframe-master/stats/MANOVA2.m | 2,200 | utf_8 | a58cae493857284ecdf34085c9b9ad26 | function T = MANOVA2(F,y)
% One factorial repeated measures MANOVA
% Only for balanced designs
% function Table = MANOVArp(F,y)
% INPUT:
% F: Fixed factor(s) (Nx2) matrix
% y: N*P data series (N:trials P:variables)
% OUTPUT
% Result Table
% 1. Compute sum of squares and predicted effects
% a. M... |
github | jdiedrichsen/dataframe-master | RandIndex.m | .m | dataframe-master/stats/RandIndex.m | 1,662 | utf_8 | 5d251e24a80f1a5997dc747861bee777 | function [AR,RI,MI,HI]=RandIndex(c1,c2)
%RANDINDEX - calculates Rand Indices to compare two partitions
% ARI=RANDINDEX(c1,c2), where c1,c2 are vectors listing the
% class membership, returns the "Hubert & Arabie adjusted Rand index".
% [AR,RI,MI,HI]=RANDINDEX(c1,c2) returns the adjusted Rand index,
% the unadjusted R... |
github | jdiedrichsen/dataframe-master | MANOVA1.m | .m | dataframe-master/stats/MANOVA1.m | 1,850 | utf_8 | e437ff60c619e341a9ec655df62a04dd | function T = MANOVA1(F,y)
% One factorial MANOVA
% Only for balanced designs
% function Table = MANOVA1(F,y)
% INPUT:
% F: Fixed factor
% y: N*P data series
% OUTPUT
% Result Table
% 1. Compute sum of squares and predicted effects
% a. Mean
T=[];
yp1=repmat(mean(y),size(y,1),1);
D1=yp1'*yp1;... |
github | jdiedrichsen/dataframe-master | MANOVArp.m | .m | dataframe-master/stats/MANOVArp.m | 2,304 | utf_8 | 2280891d0ad479edde26a1775d24bf1f | function T = MANOVArp(R,F,y,varargin)
% One factorial repeated measures MANOVA
% Only for balanced designs
% function Table = MANOVArp(R,F,y)
% INPUT:
% R: Random factor
% F: Fixed factor(s)
% y: N*P data series
% OUTPUT
% Result Table
subset=[];
vararginoptions(varargin,{'subset'});
if (... |
github | jdiedrichsen/dataframe-master | anovaMixed.m | .m | dataframe-master/stats/anovaMixed.m | 15,987 | utf_8 | b336c2bec905441fb0ca715528ef8185 | function results=anovaMixed(data,subjects,varargin);
% results=anovaMixed(data,subjects,varargin);
% Carry out an a Mixed (within / between) factor anova.
% Only for balanced designs
%
% INPUT:
% The way I construct the input data are similar to SPSS. Assuming
% you have a dataset that works in SPSS ... |
github | jdiedrichsen/dataframe-master | MANOVA2rp.m | .m | dataframe-master/stats/MANOVA2rp.m | 2,754 | utf_8 | 7c8cec229b63090c2dbb93025d49c2a0 | function T = MANOVA2rp(R,F,y,varargin)
% Two-factorial repeated measures MANOVA
% Only for balanced designs
% function Table = MANOVArp(R,F,y)
% INPUT:
% R: Random factor
% F: Fixed factor (Nx2)
% y: N*P data series
% OUTPUT
% Result Table
subset=[];
vararginoptions(varargin,{'subset'});
if... |
github | jdiedrichsen/dataframe-master | dload.m | .m | dataframe-master/util/dload.m | 2,334 | utf_8 | 6b6c004ca522d5b44f1b7779f30606f0 | function Data=dload(filename)
% DLOAD: loads a column-oriented ascii-data file into memory
% synopsis
% Data=dload(filename)
% Description
% the file filename has to be tab or space delimited all-numeric or character datafile
% first row has to be a header file with valid variable names.
% if there is an outpu... |
github | HaizhaoYang/SynLab-master | varSSTns.m | .m | SynLab-master/Applications/SynCrystal/VarSSTmethod/demo/varSSTns.m | 10,316 | utf_8 | 33e11c9b2031edd38407fd9945920153 | % This code uses the second method in "Crystal image analysis via 2D
% synchrosqueezed tranforms" to extract grain boundary and orientation.
% Based on this information, a variational optimization is applied to obtain
% results with more physical meaning. The variational model is detailed in
% "Combining 2D synchro... |
github | HaizhaoYang/SynLab-master | varSSTTwoStep.m | .m | SynLab-master/Applications/SynCrystal/VarSSTmethod/demo/varSSTTwoStep.m | 10,547 | utf_8 | 448a08e113eb72fc833f4a10421abb26 | % In the first step, this code uses the first method in "Crystal image analysis via 2D
% synchrosqueezed tranforms" to extract grain boundary and orientation.
% Based on this information, this code applies the second method in
% the same paper to estimate crystal deformation and finer results of grain
% orientation... |
github | HaizhaoYang/SynLab-master | BregmanIter_FitL1Curl_PointGroup.m | .m | SynLab-master/Applications/SynCrystal/VarSSTmethod/src/srcOptPart/BregmanIter_FitL1Curl_PointGroup.m | 8,752 | utf_8 | bb7a03562df266689b53c85ef88d06f8 | function [G,curlG] = BregmanIter_FitL1Curl_PointGroup( waveVecs, masses, stencil, R, G, weights, lambda, nt, GPUflag )
% function [G,curlG] = BregmanIter_FitL1Curl_PointGroup( waveVecs, masses, stencil, R, G, weights, lambda, nt, GPUflag )
% assumes grid spacing of 1
% assumes origin in top left corner
% x-coordinate p... |
github | HaizhaoYang/SynLab-master | projFixedCurl.m | .m | SynLab-master/Applications/SynCrystal/VarSSTmethod/src/srcOptPart/projFixedCurl.m | 6,722 | utf_8 | 4f1a10eb9b6e4582eb49f2b60ae625b8 | function [projG,cache] = projFixedCurl( G, R, L, Curl, cache )
% G - 2D array of matrices, M x N x 2 x 2
% R - list of all point group elements (i.e. rotation matrices), 2 x 2 x H
% L - list of pixel pairs across which we use a nontrivial point group element, K x 4,
% row entries are row and column ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.