-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
what's wrong with my model? #129
Comments
It would be useful if you posted your model. Its difficult to diagnose the problem from what you have posted. |
thank you for your answer :) |
I am waiting for your answer @_@...., @fonnesbeck |
You want to let PyMC automatically tune the proposal so that it can achieve a good acceptance rate. Its best not to interfere with this, particularly for a beginner. If you read the user's guide, it gives you some details about this. Modeling your parameters as a Uniform random variable works in some situations, yes. You have to make sure that it does not exclude regions of the state space that might be part of the support of the true variable. Your model looks okay, but I dont know what your function |
Hi:
I'm a beginner in learning MCMC and I only know some concept of Metropolis step methods(I take it as random walk with a multivariate normal distribution)
I notice that I must define ALL the variables as some distribution, for example, I want to fit a function with some parameters but i know nothing about them, so I define them with Uniform('someParameter',lower = MyEstimation, upper = MyEstimation), and define MyModel = Normal('MyModel', mu=functionWithParameters, tau = Observe_data_stds, value = Observe_datas, observed=True), then use M=MCMC('MyModel') and begin to fit, but the trace of the parameters are just like "WWWWWWWW" and the hist "IIIIIII". They are not stable at all and seem to be random sampled from the Uniform distribution they are defined as. Of course the chain can not satisfy the Normal distribution, what's wrong with my model?
-----------------------------------mymodel.py-------------------------------------
Oh, there is another question about the EXAMPLE StraightLineFit(https://github.com/pymc-devs/pymc/wiki/StraightLineFit)
(I can't get the right result to fit the StraightLineFit by pymc.MCMC and
M.sample(iter=10000,burn=2000))
Is it always right to define the parameters with uniform distributions when I know nothing about it???
will this has a bad effect on the MCMC process??
can I define the cov matrix of the Metropolis step methods(I think it as a random walk with a multivariate normal distribution, so it can have a cov matrix?)
Oh, sorry for SO many questions.....I need to do some work Using the MCMC, and I actually have done it by numpy only and have a not bad result, but now i want to try Pymc, I'm eager to understand it
------------update at 3pm----------
I have tried to change the parameter of pymc to fit my model, but I still can't understand how it works
the posterior distribution of the 3 parameters is "monoclonal peak"
and the union distribution of the 2 parameters Omiga_m, Omiga_lamuda is just like a bivariate normal distribution
before that, I finished my work using numpy like this:
this program gives me a not bad result
i have the acception rate of about 40%
the chain of the parameters vibrate near the best point
and the hists are like Normal distributions
while in Pymc
the chain of the parameters vibrate violently(actually the plot range is full with the chain....)
the hists are not Normal-like
I don't understand how Pymc 'tune' the std, can I set it stable just like the above program?
Or I set the wrong args to fail my work?
thank you for your answer~
The text was updated successfully, but these errors were encountered: