if (FALSE) {
# The computation of MPLEs takes a long CPU time in the minimization procedure,
# especially for the Inverse-power type and the Type A models.
### Thomas Model
#simulation
pars <- c(mu = 50.0, nu = 30.0, sigma = 0.03)
t.sim <- sim.cppm("Thomas", pars, seed = 117)
## estimation => Palm intensity
init.pars <- c(mu = 40.0, nu = 40.0, sigma = 0.05)
t.mple <- mple.cppm("Thomas", t.sim$offspring$xy, init.pars)
t.palm <- palm.cppm(t.mple, pars)
plot(t.palm)
### Inverse-Power Type Model
# simulation
pars <- c(mu = 50.0, nu = 30.0, p = 1.5, c = 0.005)
ip.sim <- sim.cppm("IP", pars, seed = 353)
## estimation => Palm intensity
init.pars <- c(mu = 55.0, nu = 35.0, p = 1.0, c = 0.01)
ip.mple <- mple.cppm("IP", ip.sim$offspring$xy, init.pars, skip = 100)
ip.palm <- palm.cppm(ip.mple, pars)
plot(ip.palm)
### Type A Model
# simulation
pars <- c(mu = 50.0, nu = 30.0, a = 0.3, sigma1 = 0.005, sigma2 = 0.1)
a.sim <- sim.cppm("TypeA", pars, seed=575)
## estimation => Palm intensity
init.pars <- c(mu=60.0, nu=40.0, a=0.5, sigma1=0.01, sigma2=0.1)
a.mple <- mple.cppm("TypeA", a.sim$offspring$xy, init.pars, skip=100)
a.palm <- palm.cppm(a.mple, pars)
plot(a.palm)
### Type B Model
# simulation
pars <- c(mu1 = 10.0, mu2 = 40.0, nu = 30.0, sigma1 = 0.01, sigma2 = 0.03)
b.sim <- sim.cppm("TypeB", pars, seed = 257)
## estimation => Palm intensity
init.pars <- c(mu1 = 20.0, mu2 = 30.0, nu = 30.0, sigma1 = 0.02, sigma2 = 0.02)
b.mple <- mple.cppm("TypeB", b.sim$offspring$xy, init.pars)
b.palm <- palm.cppm(b.mple, pars)
plot(b.palm)
### Type C Model
# simulation
pars <- c(mu1 = 5.0, mu2 = 9.0, nu1 = 30.0, nu2 = 150.0,
sigma1 = 0.01, sigma2 = 0.05)
c.sim <- sim.cppm("TypeC", pars, seed = 555)
## estimation => Palm intensity
init.pars <- c(mu1 = 10.0, mu2 = 10.0, nu1 = 30.0, nu2 = 120.0,
sigma1 = 0.03, sigma2 = 0.03)
c.mple <- mple.cppm("TypeC", c.sim$offspring$xy, init.pars)
c.palm <- palm.cppm(c.mple, pars)
plot(c.palm)
}
Run the code above in your browser using DataLab