brian-lau / MatlabStan

Matlab interface to Stan, a package for Bayesian inference
BSD 3-Clause "New" or "Revised" License
79 stars 47 forks source link

Octave compatibility #1

Open brian-lau opened 9 years ago

brian-lau commented 9 years ago

Some notes from Aki:

If you happen to test MatlabStan with Octave: Our GPstuff package works in Matlab and Octave. Here's example how InputParser syntax differs (and Octave syntax does not work in Matlab). This difference comes from the limited object system implementation. At that time there seemed to be no-one working on necessary changes to object system implementation to get it work as in Matlab.

Matlab ip=inputParser; ip.FunctionName = 'GP_SET'; ip.addOptional('gp', [], @isstruct); ip.addParamValue('cf',[], @(x) isempty(x) || isstruct(x) || iscell(x)); ... ip.parse(varargin{:}); gp=ip.Results.gp;

Octave ip=inputParser; ip.FunctionName = 'GP_SET'; ip=iparser(ip,'addOptional','gp', [], @isstruct); ip=iparser(ip,'addParamValue','cf',[], @(x) isempty(x) || isstruct(x) || iscell(x)); ... ip=iparser(ip,'parse',varargin{:}); gp=ip.Results.gp;

To get all things to work we also made some changes to InputParser code, but due to difficulties in the process to get changes into Octave, it's possible that some of the changes are not in the official distribution. So if you get some errors I might know where the problem is

fgnievinski commented 9 years ago

you might be interested in https://github.com/fgnievinski/inputParser2