PYMC Model() MCMC strange parameter inference

27 Views Asked by At

I'm trying to write and MCMC model to infer the parameters of the data set but I'm getting weird results.

with pm.Model() as model:
    # Paramaerters
    noise=pm.Normal("Noise", mu=0, sigma=5)

    amplitude=pm.Normal("Amplitude", mu=0, sigma=5)
    lambda_0=pm.Normal("Central Wavelength", mu=0, sigma=5)
    width=pm.Normal("Width", mu=0, sigma=5)

    # Expected value
    mu=(amplitude/(1+((lambda_1-lambda_0)/width)**2))

    # Likelyhood
    LikelyhoodS1=pm.Cauchy('Spectrum 1', alpha=mu, beta=noise, observed=amplitude_1)

with model:
    LikelyhoodS1=sample(1000, tune=2000, chains=4)

enter image description here

The image it the out put parameters.

I'm not sure what I'm doing wrong or why I'm getting two peaks for the width.

I'm expecting to get the parameter curves to line up.

I've tried switching to Cauchy dictations for the amplitude and lambda_0 and width

0

There are 0 best solutions below