I’m trying to model my data with an equation that has a logarithm: y = A+B*log10(x-C)
x- is a predictor variable
A, B & C are parameters I want to predict with a posterior. The model works if I use a constant value for C, but once I replace it with a prior probability, it breaks down. (I even truncated the C prior distribution, below the minimum value of x so not to have a negative in the log10().)
MY CODE:
curve_model = pm.Model()
with curve_model:
# Define Prior Probabilities
A = pm.Normal('A', mu=7.4, sd=2)
B = pm.Normal('B', mu=-2, sd=2)
C = pm.TruncatedNormal('C', mu=34, sd=2, upper=38)
sd_y = pm.InverseGamma('t', mu=0.5, sd=0.25)
mu_y = A+B*np.log10(x - C)
# Write parameters for posterior
post_fatigue = pm.Normal('post_fatigue', mu=mu_y , sd=sd_y, observed=y)
Oh, And I should probably mention that I have been ignoring warnings that I can’t run theano:
WARNING (theano.configdefaults): g++ not available, if using conda: conda install m2w64-toolchain
C:\Users\Tazzy\Anaconda3\lib\site-packages\theano\configdefaults.py:560: UserWarning: DeprecationWarning: there is no c++ compiler.This is deprecated and with Theano 0.11 a c++ compiler will be mandatory
warnings.warn(“DeprecationWarning: there is no c++ compiler.”
WARNING (theano.configdefaults): g++ not detected ! Theano will be unable to execute optimized C-implementations (for both CPU and GPU) and will default to Python implementations. Performance will be severely degraded. To remove this warning, set Theano flags cxx to an empty string.
WARNING (theano.tensor.blas): Using NumPy C-API based implementation for BLAS functions.
I understood that theano makes my computer run more efficiently, Is this something that is required or optional?
Glad you find a solution - I think the problem is likely that x is a pandas serie
Also, you should get the warning fix otherwise your pymc3 model will be quite slow - installing from Conda (Anaconda or Miniconda) is usually recommended