# Frequentist's stochastic modelling via Python

Consider random variables $X$ and $Y$. $Z = f_a(X, Y)$ where $f(\cdot, \cdot)$ is a deterministic, not random function $f_a: \mathbb{R}^2 \to \mathbb{R}$ depending on a deterministic real parameter $a$. For example, let $f_a(X,Y)=aX+(1-a)Y$.

I've read a lot about Bayesian modelling and fitting with the help of pymc3 Python module. But how can I model $Z$ in a frequentist's manner? I am to calculate quantiles, optimize $a$ over setting $\mathbb{E}Z$ to $0$ etc.

What is the most convinient way to do this? I haven't found solution neither in scipy.optimize nor scipy.stats.

• Would you specify what the deterministic function is, please? It might give the question a broader appeal if more of us understand it.
– Carl
Commented Sep 13, 2016 at 16:17
• actually, any function. I try to find a general approach. Let, e.g. $f_a(X, Y) = aX + (1-a) Y$. Commented Sep 13, 2016 at 16:19
• OK, in that case the Bayesian priors would likely be independent for $X$ and $Y$ because there is no $XY$ covariance term and iff $0<a<1$, $aX+(1-a)Y$ is a mixture distribution, for which two independent processes are adding to the density. In other words, there are two distributions with no convolution chaining or cross-talk that are mixed with superpositioning to make final density function. With a different form, for example with an $XY$ term, that would not necessarily be the case, such that I am guessing that it may be necessary to divide up the problem into special cases.
– Carl
Commented Sep 13, 2016 at 16:47
• @Carl my question is mainly about Python modeling. I don't need to fit my model, I need to optimize distribution parameter $a$ Commented Sep 13, 2016 at 18:07
• @Carl could you write it in detail? Commented Sep 13, 2016 at 18:30