Description Usage Arguments Details Examples
Creates a marked point process model object with class "mpp"
.
1 
data 
a 
gif 
ground intensity function. See topic 
marks 
a 
params 
numeric vector of all model parameters. 
gmap 

mmap 

TT 
vector of length 2, being the time interval over which the integral of the ground intensity function is to be evaluated. 
Let lambda_g(tHt) denote the ground intensity function and f(yHt) denote the joint mark densities, where y in Y. The loglikelihood of a marked point process is given by
log L = sum{log lambda_g(tiHt)} + sum{log f(yiHt)}  integral{lambda_g(tHt) dt},
where the summation is taken over those events contained in the interval (TT[1], TT[2])
, and the integral is also taken over that interval. However, all events in the data frame data
before t, even those before TT[1]
, form the history of the process Ht. This allows an initial period for the process to reach a “steady state” or “equilibrium”.
The parameter spaces of the ground intensity function and mark distribution are not necessarily disjoint, and can have common parameters. Hence, when the model parameters are estimated, these relationships must be known, and are specified by the arguments gmap
and mmap
. The mapping expressions can also contain arithmetic expressions. The ith element in the params
argument is addressed in the expressions as params[i]
. Here is an example of a five parameter model, where the gif
has 4 parameters, and the mark distribution has 2, with mappings specified as:
1 2 3  gmap = expression(c(params[1:3], exp(params[4]+params[5])))
mmap = expression(c(log(params[2]/3), params[5]))

Note the inclusion of the combine (c
) function, because the expression
must create a vector of parameters. Care must be taken specifying these expressions are they are embedded directly into the code of various functions.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50  data(Tangshan)
# increment magnitudes a fraction so none are zero
Tangshan[,"magnitude"] < Tangshan[,"magnitude"] + 0.01
dmagn_mark < function(x, data, params){
# Gamma distribution
# exponential density when params[7]=0
# See topic "marks" for further discussion
lambda < etas_gif(data, x[,"time"], params=params[1:5])
y < dgamma(x[,"magnitude"], shape=1+sqrt(lambda)*params[7],
rate=params[6], log=TRUE)
return(y)
}
TT < c(0, 4018)
# params < c(0.0067, 1.1025, 1.0794, 0.0169, 0.9506, 1.9159, 0.4704)
params < c(0.007, 1.1, 1.08, 0.02, 0.95, 1.92, 0.47)
x < mpp(data=Tangshan,
gif=etas_gif,
marks=list(dmagn_mark, NULL),
params=params,
gmap=expression(params[1:5]),
mmap=expression(params[1:7]),
TT=TT)
allmap < function(y, p){
# one to one mapping, all p positive
y$params < exp(p)
return(y)
}
# Parameters must be positive. Transformed so that nlm
# can use entire real line (no boundary problems, see
# topic "neglogLik" for further explanation).
# Argument "iterlim" has been restricted to 2 to avoid
# excessive time in package checks, set much larger to
# ensure convergence.
z < nlm(neglogLik, log(params), object=x, pmap=allmap,
print.level=2, iterlim=2, typsize=abs(params))
x1 < allmap(x, z$estimate)
# print parameter estimates
print(x1$params)
print(logLik(x))
print(logLik(x1))
plot(x1, log=TRUE)

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.