Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[HGF] Add _namep.m for hgf_binary_mab #245

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Contributor-License-Agreement.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Benoît Béranger | CENIR, ICM | Paris | FR
Stephan Heunis | Eindhoven University of Technology | Eindhoven | NL | jsheunis
Niklas Bürgi | SNS, University of Zurich | Zurich | CH | nbuergi
Alexandre Sayal | CIBIT, University of Coimbra | Coimbra | PT | alexsayal
Filippo Ferrari | ANC, University of Edinburgh | Edinburgh | UK | filippoferrari
**- Add Entry here -** | **- Add Entry here -** | **Add** | **Add** | **Add**

(hereinafter referred to as "Contributor")
Expand Down
9 changes: 8 additions & 1 deletion HGF/tapas_hgf_binary_mab.m
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,14 @@

% Add dummy "zeroth" trial
u = [0; r.u(:,1)];
y = [1; r.y(:,1)];
try % For estimation
y = [1; r.y(:,1)];
r.irr = r.irr;
catch % For simulation
y = [1; r.u(:,2)];
r.irr = find(isnan(r.u(:,2)));
end


% Number of trials (including prior)
n = size(u,1);
Expand Down
25 changes: 25 additions & 0 deletions HGF/tapas_hgf_binary_mab_namep.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
function pstruct = tapas_hgf_binary_mab_namep(pvec)
% --------------------------------------------------------------------------------------------------
% Copyright (C) 2012-2013 Christoph Mathys, TNU, UZH & ETHZ
%
% This file is part of the HGF toolbox, which is released under the terms of the GNU General Public
% Licence (GPL), version 3. You can redistribute it and/or modify it under the terms of the GPL
% (either version 3 or, at your option, any later version). For further details, see the file
% COPYING or <http://www.gnu.org/licenses/>.


pstruct = struct;

l = (length(pvec)+1)/5;

if l ~= floor(l)
error('tapas:hgf:UndetNumLevels', 'Cannot determine number of levels');
end

pstruct.mu_0 = pvec(1:l);
pstruct.sa_0 = pvec(l+1:2*l);
pstruct.rho = pvec(2*l+1:3*l);
pstruct.ka = pvec(3*l+1:4*l-1);
pstruct.om = pvec(4*l:5*l-1);

return;