6 Day 6 (February 6)

6.1 Announcements

  • Please read (and re-read) Ch. 4 and 6 in BBM2L book.

  • Final project is posted

  • Questions about activity 2?

  • Selected questions/clarifications from journals

6.2 Building our first statistical model

  • The backstory
  • Building a statistical model using a Bayesian approach
    • Specify (write out) the likelihood/data model
    • Specify the parameter model (or prior) including hyper-parameters
    • Select an approach to obtain the posterior distribution
      • Analytically (i.e., pencil and paper)
      • Deterministic numerical algorithm
      • Simulation-based or stochastic algorithm (e.g., Metropolis-Hastings, MCMC, importance sampling, ABC, etc)

6.3 Monte Carlo Integration

  • Deterministic vs stochastic methods to approximate integrals

    • Work well for high-dimensional multiple integrals
    • Easy to program
  • Monte Carlo integration

    • E(g(y))=g(y)[y|θ]dy1QQq=1g(yq)
    • Examples:
    1. E(y)=y12πσ2e12σ2(yμ)2dy
    y <- rnorm(n = 10^6, mean = 2, sd = 3)
    mean(y)
    ## [1] 2.000739
    1. E((yμ)2)=(yμ)212πσ2e12σ2(yμ)2dy
    y <- rnorm(n = 10^6, mean = 2, sd = 3)
    mean((y - 2)^2)
    ## [1] 8.987738
    1. E(1y)=1y12πσ2e12σ2(yμ)2dy
    y <- rnorm(n = 10^6, mean = 2, sd = 4)
    mean(1/y)
    ## [1] -2.855014
  • Questions about activity 2?

  • Live example using bat model