SHARE
TWEET

Untitled

a guest Jul 22nd, 2019 61 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. library(spatstat)
  2. window <- as.owin(bei)
  3.  
  4. # Pilot model
  5. D_pilot <- runifpoint(1e4, window)
  6. Q_pilot <- quadscheme.logi(bei, D_pilot)
  7. fit_pilot <- ppm(Q_pilot  ~ polynom(elev, grad, 2),
  8.                  data = bei.extra, method = "logi")
  9.  
  10. # Pilot intensity estimate
  11. lambda_pilot <- predict(fit_pilot, locations = window)
  12. lambda_pilot <- 1e4 * lambda_pilot / integral(lambda_pilot)
  13.  
  14. # Second-stage model
  15. D_local <- rpoint(1e4, lambda_pilot)
  16. Q_local <- quadscheme.logi(bei, D_local)
  17. rho <- Q_local$param$rho
  18. fit_local <- ppm(Q_local ~ polynom(elev, grad, 2) +
  19.                    offset(-log(lambda_pilot) + log(rho)),
  20.                  data = bei.extra, method = "logi")
  21.  
  22. # Final intensity estimate
  23. plot(predict(fit_local, locations = window) * lambda_pilot)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top