Estimate parameter with result and another parameter(s) #1279
Replies: 2 comments 7 replies
-
Are you asking if you can do optimisation to find a point estimate, or Bayesian inference to find a distribution? (Your diagram appears truncated by the way) It would help me to understand better if you could give a mathematical description of your problem with a toy example, or link to an example implementation with another library. |
Beta Was this translation helpful? Give feedback.
-
Ok, let's assume import aesara.tensor as at
srng = at.random.RandomStream(0)
n_t = snrg.normal(mu_n, sigma2_n)
c_p = srng.normal(mu_c, sigma2_c)
# We need an extra assumption about the distribution of `C`, say normal:
mu_rv = srng.normal(0, 1) # adjust this prior to your data
sigma_rv = srng.halfnomal(1.) # same
c = srng.normal(mu_rv, sigma_rv)
# We assume that the parameter of the Poisson distribution
# follows a Gamma distribution (conjugate prior)
n_p = c / (c_p * n_p) To perform bayesian inference you will need to compute the joint probability of this model conditioned on your data, and the test value of import aeppl
# `n_t` and `c_p` are stochastic variables since you use a distribution fitted to the data,
# so are not conditioned on.
# Let us define a variable that will hold the values taken by `c`
mu_vv = mu_rv.clone()
sigma_vv = sigma_rv.clone()
logprob = aeppl.joint_logprob({c: c_data, sigma_rv: sigma_vv, mu_rv: mu_vv})
import aesara
# We want to compute the value of `logprob` given the values`n_p_vv`
logprob_fn = aesara.function((sigma_vv, mu_vv), logprob)
print(logprob_fn(1., 1.))
# scalar value You can use any optimization algorithm on this function in python to find the most likely value for Assume you went the optimization route, so you have two values sample_n_p_fn = aesara.function((mu_rv, sigma_rv), n_p)
sample_n_p_fn(mu_val, sigma_val) |
Beta Was this translation helpful? Give feedback.
-
Hello everybody,
I wanted to know if it was possible with Aesara to estimate a parameter (dataset or associated distribution) by knowing a parameter and the result.
I illustrate with a drawing. For example, in the diagram below, I would like to know if with the result box (in red) and the box on the bottom right (all the points of a parameter), it was possible to estimate the other parameter (box on the bottom left). The estimation of this box could possibly be points in space or a probability distribution. The idea is that the parameters (the two black boxes) give the result (the red box) when combined together
Beta Was this translation helpful? Give feedback.
All reactions