text: # Approximating the first moment of $h(x)$ where $x$ ~${\rm log\,normal}(\mu, \sigma)$ [closed]
  
  What is the best way to approximate $$E(h(X))$$, where $$X$$ ~ Lognomal($$\mu, \sigma$$)?
  
  So far, I can think of Monte Carlo Methods and Gaussian Hermite quadrature as below: \begin{align} E(h(X)) &= \int_{0}^{\infty} h(x) \frac 1 x \cdot \frac 1 {\sigma\sqrt{2\pi\,}} \exp\left( -\frac{(\ln x-\mu)^2}{2\sigma^2} \right) dx \\[8pt] \end{align} using a change of variable $$y = ln(x)$$: \begin{align} &= \int_{-\infty}^{\infty} h(e^y) \frac 1 {e^y} \cdot \frac 1 {\sigma\sqrt{2\pi\,}} \exp\left( -\frac{(y -\mu)^2}{2\sigma^2} \right) e^y dy \\ &= \int_{-\infty}^{\infty} h(e^y) \cdot \frac 1 {\sigma\sqrt{2\pi\,}} \exp\left( -\frac{(y -\mu)^2}{2\sigma^2} \right)dy \end{align} having $$h(e^y) = g(y)$$ $$= \int_{-\infty}^{\infty} g(y) \cdot \frac 1 {\sigma\sqrt{2\pi\,}} \exp\left( -\frac{(y -\mu)^2}{2\sigma^2} \right) dy.$$ Using the Gauss-Hermite quadrature from this link in Wikipedia: \begin{align} \int_{-\infty}^{\infty} g(y) \cdot \frac 1 {\sigma\sqrt{2\pi\,}} \exp\left( -\frac{(y -\mu)^2}{2\sigma^2} \right) dy &\approx \frac{1}{\sqrt{\pi}} \sum_{i=1}^n w_i g(\sqrt{2} \sigma x_i + \mu) \\ &= \frac{1}{\sqrt{\pi}} \sum_{i=1}^n w_i h(e^{(\sqrt{2} \sigma x_i + \mu)}). \end{align} Is what I am doing here fine? Or this would produce approximation errors?
  
  • Minor comment about your question: When you do change of variables, the integration limits should also change, i.e., it should be from $0$ to $\infty$ instead of $-\infty$ to $\infty$. Oct 30, 2018 at 18:20
  • The change of variable is $y = ln(x)$, so the new variable $-\infty <y < \infty$.
  – AIM
  Oct 30, 2018 at 19:07
  • Since $h$ is not stipulated, it doesn't matter what distribution you assume for $X.$ That's because, letting $F$ be the distribution function of $X$ (which is invertible) and letting $G$ be any other invertible continuous distribution function, $$h(X)=h(F^{-1}G(G^{-1}((F(X)))))=(h\circ F^{-1}\circ G)(Y)$$ where $Y$ has $G$ for its distribution and now $h\circ F^{-1}\circ G$ plays the role of $h.$ That makes this question too broad to be answerable.
  – whuber
  Jun 25, 2021 at 19:03
explanation: The document contains a math question about approximating the first moment of a function \( h(x) \) where \( x \) is log-normally distributed. The user provides a detailed derivation using Monte Carlo methods and Gaussian Hermite quadrature and asks if their approach is correct or if it would produce approximation errors. There is no provided answer to the question.
distilabel_metadata.content: Evaluate the user given text extract and determine if it contains a math question and optionally and answer to this question.
  
  Output rules:
  
  1. Briefly describe the document and mention if it contains a question or a question and answer.
  2. Finalize the output with: Label: no-question,question,question-and-answer,multiple-question,multiple-question-and-answer
distilabel_metadata.role: system
distilabel_metadata.content: # Approximating the first moment of $h(x)$ where $x$ ~${\rm log\,normal}(\mu, \sigma)$ [closed]
  
  What is the best way to approximate $$E(h(X))$$, where $$X$$ ~ Lognomal($$\mu, \sigma$$)?
  
  So far, I can think of Monte Carlo Methods and Gaussian Hermite quadrature as below: \begin{align} E(h(X)) &= \int_{0}^{\infty} h(x) \frac 1 x \cdot \frac 1 {\sigma\sqrt{2\pi\,}} \exp\left( -\frac{(\ln x-\mu)^2}{2\sigma^2} \right) dx \\[8pt] \end{align} using a change of variable $$y = ln(x)$$: \begin{align} &= \int_{-\infty}^{\infty} h(e^y) \frac 1 {e^y} \cdot \frac 1 {\sigma\sqrt{2\pi\,}} \exp\left( -\frac{(y -\mu)^2}{2\sigma^2} \right) e^y dy \\ &= \int_{-\infty}^{\infty} h(e^y) \cdot \frac 1 {\sigma\sqrt{2\pi\,}} \exp\left( -\frac{(y -\mu)^2}{2\sigma^2} \right)dy \end{align} having $$h(e^y) = g(y)$$ $$= \int_{-\infty}^{\infty} g(y) \cdot \frac 1 {\sigma\sqrt{2\pi\,}} \exp\left( -\frac{(y -\mu)^2}{2\sigma^2} \right) dy.$$ Using the Gauss-Hermite quadrature from this link in Wikipedia: \begin{align} \int_{-\infty}^{\infty} g(y) \cdot \frac 1 {\sigma\sqrt{2\pi\,}} \exp\left( -\frac{(y -\mu)^2}{2\sigma^2} \right) dy &\approx \frac{1}{\sqrt{\pi}} \sum_{i=1}^n w_i g(\sqrt{2} \sigma x_i + \mu) \\ &= \frac{1}{\sqrt{\pi}} \sum_{i=1}^n w_i h(e^{(\sqrt{2} \sigma x_i + \mu)}). \end{align} Is what I am doing here fine? Or this would produce approximation errors?
  
  • Minor comment about your question: When you do change of variables, the integration limits should also change, i.e., it should be from $0$ to $\infty$ instead of $-\infty$ to $\infty$. Oct 30, 2018 at 18:20
  • The change of variable is $y = ln(x)$, so the new variable $-\infty <y < \infty$.
  – AIM
  Oct 30, 2018 at 19:07
  • Since $h$ is not stipulated, it doesn't matter what distribution you assume for $X.$ That's because, letting $F$ be the distribution function of $X$ (which is invertible) and letting $G$ be any other invertible continuous distribution function, $$h(X)=h(F^{-1}G(G^{-1}((F(X)))))=(h\circ F^{-1}\circ G)(Y)$$ where $Y$ has $G$ for its distribution and now $h\circ F^{-1}\circ G$ plays the role of $h.$ That makes this question too broad to be answerable.
  – whuber
  Jun 25, 2021 at 19:03
distilabel_metadata.role: user
distilabel_metadata.raw_output_q_a_detector_0: The document contains a math question about approximating the first moment of a function \( h(x) \) where \( x \) is log-normally distributed. The user provides a detailed derivation using Monte Carlo methods and Gaussian Hermite quadrature and asks if their approach is correct or if it would produce approximation errors. There is no provided answer to the question.
  
  Label: question