Regression when $X$ is random and unobservable

I am trying to fit a curve to empirical data where I know that uncertainty is in the predictors ($$X$$) (there could be also an uncertainty in $$Y$$, but let's keep things simple for the start). In other words, I know only the expected values, but not the true values of $$X$$.

My model is somewhat complicated, but I'll try to use a simplification as an example. Say I want to determine the rate of the decay b of a compound. Based on my domain knowledge I assume the following model:

$$N_t = N \cdot e^{-bt}$$

I set up the experiment in which I start with theoretically always the same amount N0 of the compound, wait some pre-defined time t0, which I vary over the repeated runs of the experiment, and measure the actual remaining amount Nt of the compound. However, I have errors both in N0 and in t0, so that the actual (but unobserved!) starting amount N and the waiting time t are random variables, say, normally distributed around N0 and t0, respectively.

In code:

    import numpy as np
import matplotlib.pyplot as plt

np.random.seed(1)
b = .2345
N0 = 10
N  = N0 + np.random.randn(10)
t0 = np.linspace(0, 10, 10)
t  = t0 + np.random.randn(10)
Nt = N * np.exp(-b * t)
plt.plot(t0, Nt, '.', label='empirical')
plt.plot(t0, N0 * np.exp(-b * t0), label='theoretical')
plt.legend(loc='upper right')
plt.gca().set_xlabel("t")
plt.gca().set_ylabel("N(t)")


How would I determine b in a maximum likelihood manner?

I have read Simple linear regression model with random x, Regression with random X, Find P(Y=y | X=x) when X is a continuous random variable, and What are the Differences in Linear Regression of Y vs X when both Y,X are Random and Regressing Y vs X when X is Mathematical, but they don't seem to answer my specific question (or in an abstract way which I was unable to comprehend).

• Are you asking about nonlinear regression sthda.com/english/articles/40-regression-analysis/… ? – user2974951 Jun 24 '20 at 8:32
• @user2974951: Nonlinearity is a part of the question, but a minor one. I'd know how to deal with non-linearities if the errors were in $Y$. What bugs me is that $X$ is random. – Igor F. Jun 24 '20 at 8:35
• $X$ being random is less of an issue (unless $X$ is related to the errors in $Y$) than $X$ being measured with errors – Henry Jun 24 '20 at 8:40
• If measurement error is the issue, such references might be a point of departure (to a vast literature): onlinelibrary.wiley.com/doi/abs/10.1002/jae.648 – Christoph Hanck Jun 24 '20 at 9:06
• I would not say that it is too broad for CV. I was rather saying I could not come up with a concise answer right now that directly addresses your issues and wanted to point out that I was also not providing a reference that does so precisely either, but rather is a broad introduction of the topic of measurement error. – Christoph Hanck Jun 24 '20 at 11:16
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 4, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.7379451394081116, "perplexity": 515.5328849015478}, "config": {"markdown_headings": false, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 20, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-21/segments/1620243992516.56/warc/CC-MAIN-20210516075201-20210516105201-00164.warc.gz"}