grinsted / gwmcmc

An implementation of the Goodman & Weare MCMC sampler for matlab
Other
51 stars 24 forks source link

Octave support #1

Closed mrquincle closed 9 years ago

mrquincle commented 9 years ago

Hi,

On Matlabcentral I was pointed to http://www.mathworks.com/matlabcentral/fileexchange/49820-grinsted-gwmcmc from http://nl.mathworks.com/matlabcentral/fileexchange/47912-markov-chain-monte-carlo-sampling-of-posterior-distribution.

Then I found your github repos.

The older version is nicely compatible with octave, but the new one is not. In particular the addParameter function on inputParser has been updated in matlab, making it incompatible with the old one in octave.

Is it possible to rewrite it a bit, so it can be used for both matlab as well as octave?

Thanks!

grinsted commented 9 years ago

Hi

i have very little experience with octave, but i found that inputParser is part of the octave general package.

When i test then i get an error when i do "p=inputParser". But it works if i change directory into octave/packages/general-1.3.2

Ideally i would like to use inputParser also in octave to keep things simple, -but i dont know why it does not work out of the box, when it apparently is in the general package.

mrquincle commented 9 years ago

Yes, it is. However, the addParameter function is not. I tried to replace it with addOptional, but no success as well.

On my fork I just skip the arguments for now: https://github.com/grinsted/gwmcmc/compare/master...mrquincle:master

grinsted commented 9 years ago

I found this: http://savannah.gnu.org/bugs/?45367

I guess i could use addParamValue instead of addParameter in octave. The matlab documentation says "not recommended" about addParamValue, but it is still supported, and i dont see any significant difference is. I could change it to addParamValue if that works. Could you check?

mrquincle commented 9 years ago

Sure, I will check

grinsted commented 9 years ago

I have changed to addParamValue and hope it works in octave. please reopen this issue if not.