Reputation: 47
Disclaimer: I'm very new to spatstat and spatial point modeling in general... please excuse my naivete.
I have recently tried using spatstat to fit and simulate spatial point patterns related to weather phenomenon where the spatial pattern represents a set of eye-witness reports (for example, reports of hail occurrence) and the observational window and covariate is based on some meteorological parameter (eg. the window is area where moisture is at least X, and then the moisture variable is additionally passed as a covariate when training the model).
moistureMask = owin(mask=moisture>X)
moistureVar = im(moisture)
obsPPP = ppp(x=obsX,y=obsY,window=moistureMask)
myModel = ppm(obsPPP ~ moistureVar)
### then simulate
mySim = simulate(myModel,nsim=10)
My questions are the following:
update
function to switch out the window and covariate fields from the trained model, but haven't actually tried it yet. If the answer is yes... its a little unclear to me how to actually do this, programmaticallyupdate
function here as well, but it was unclear if the new model would simply be based ONLY on the new data, or a combination of the original and new data.Please let me know if I'm going the completely wrong direction with this. References and resources appreciated.
Upvotes: 0
Views: 253
Reputation: 2973
If you have fitted a model using ppm
and you update it by specifying new data and/or new covariates, then the new data replace the old data; the updated model's parameters are determined using only the new data that you gave when you called update
.
The syntax for the update
command is described in the online help for update.ppm
(the method for the generic update
for an object of class ppm
).
It seems that what you really want to do is to fit a point process model to many replicate datasets, each dataset consisting of a predictor moistureVar
and a point pattern obsPPP
. In that case, you should use the function mppm
which fits a point process model to replicated data.
To do this, first make a list A
containing the moisture regions for each day, and another list B
containing the hail report location patterns for each day. That is, A[[1]]
is the moisture region for day 1, and B[[1]]
is the point pattern of hail report locations for day 1, and so on. Then do
h <- hyperframe(moistureVar=A, obsPPP=B)
m <- mppm(obsPPP ~ moistureVar, data=h)
This will fit a single point process model to the full set of data.
Finally can I point out that the model
obsPPP ~ moistureVar
is very simple, because moistureVar
is a binary predictor. The model will simply say that the intensity of hail reports takes one value inside the high-moisture region, and another value outside that region. As an alternative, you could consider use the moisture content (eg humidity) as a predictor variable.
See Chapters 9 and 16 of the spatstat book for more detail.
Upvotes: 0