Description Usage Arguments Value Author(s) References Examples
View source: R/cross_pcf_ratio.R
This is a method to estimate cross PCF ratios non-parametrically
1 |
X |
A multivariate point process. X must be of class ppp. |
covariate |
Covariates. The covariates must be a matrix. The rows corresponds to the points in the point pattern and the columns indicates the corresponding covariates that are observed at the location of the point pattern. |
Beta |
Estimated first order parameters. Beta must be a matrix. The number of rows must correspond to the number of covariates. The number of columns must correspond to the number of point types. |
r |
A vector of distances |
bwd |
The bandwidth used |
kern |
The kernel function. Default is Epanechnikov. Alternatively, the kernel function can be Indicator. |
cut |
For refined cross PCF ratio estimator. Default cut = NULL. If cut = NULL, the parameter R^* for the constraint is chosen manually using the function ChooseRange |
Return estimated cross PCF ratios, r distances used, bandwidth used, refined cross PCF ratios and R^*
Kristian Bjørn Hessellund, Ganggang Xu, Yongtao Guan and Rasmus Waagepetersen.
Hessellund, K. B., Xu, G., Guan, Y. and Waagepetersen, R. (2020) Second order semi-parametric inference for multivariate log Gaussian Cox processes.
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 | ### First order analysis of Washington D.C. street crimes ###
nspecies <- length(unique(markedprocess$marks))
ncovs <- dim(Z_process)[2]
# Initial parameters for street crime data
Beta0=matrix(runif(nspecies*ncovs,-0.5,0.5),nrow =nspecies)
# Choosing the last type of street crime as the baseline
Beta0 <- as.matrix(t(scale(Beta0,center=Beta0[nspecies,],scale=FALSE)))
# Parameter estimation
Betahat=FirstOrderCCL(X=markedprocess,Beta0 = Beta0,covariate = Z_process)
# Parameter estimates
colnames(Betahat$betahat)=c("Burglary", "Assault w. weapon", "Motor v. theft",
"Theft f. auto", "Robbery", "Other theft (baseline)")
rownames(Betahat$betahat)=c("Intercept", "%African", "%Hispanic", "%Males",
"Median income", "%Household","%Bachelor", "Distance to police station")
Betahat
### Non-parametric estimates of cross PCF ratios ###
rseq = seq(0,3000,length=100)
cpcf=CrossPCF(X = markedprocess,covariate = Z_process,Beta = Betahat$betahat,r = rseq
,bwd = 200,cut = NULL)
plot(rseq,rep(1,100),type="l",col=1,ylim=c(0,2),xlab="r",ylab="",main="PCFs")
for(i in 1:(nspecies-1)){
lines(rseq,cpcf$cPCF.m[i,i,],,col=i)
}
plot(rseq,rep(1,100),type="l",col=1,ylim=c(0,2),xlab="r",ylab="",main="PCFs")
for(i in 1:(nspecies-1)){
for(j in 1:(nspecies-1)){
if(i==j){next}
lines(rseq,cpcf$cPCF.m[i,j,],,col=1)
}
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.