pints icon indicating copy to clipboard operation
pints copied to clipboard

sigma0 in MCMCController and OptimisationController mean different things

Open chonlei opened this issue 5 years ago • 3 comments

I know we'd run out of symbols at some point, but the sigma0s in MCMCController and OptimisationController mean subtly different things, one is covariance matrix $\Sigma$ and the other is standard deviation $\sigma$.

Would it be better to call the covariance matrix cov0, C0 or something? Or simply capitalise Sigma0 in the MCMCController to distinguish the two?!

chonlei avatar Jul 05 '20 04:07 chonlei

I like the idea of calling it cov0 or just cov or something!

MichaelClerx avatar Jul 05 '20 11:07 MichaelClerx

Sounds good, if we are to change this, how are we going for the deprecated alias phase? Just change it directly?

chonlei avatar Sep 29 '20 06:09 chonlei

That's an interesting question!

If we wanted to be really careful, I guess we could do this

def __init__(self, log_pdf, chains, x0, sigma0=None, transform=None, method=None):
-->
def __init__(self, log_pdf, chains, x0, cov0=None, transform=None, method=None, **kwargs):

and then:

# Deprecated: sigma0 was renamed to cov0 on 2020-09-29
if 'sigma0' in kwargs:
  if cov0 is None:
    cov0 = kwargs['sigma0']
    warnings.warn(...)
    del(kwargs['sigma0'])
  else:
    raise ValueError('...')
if len(kwargs) > 0:
  raise ValueError('Unknown keyword argument: "' + str(kwargs.pop()) + '".')

Apart from the 10 lines needed to implement this, I don't think that has downsides?

MichaelClerx avatar Sep 29 '20 09:09 MichaelClerx