|
3 | 3 | #' |
4 | 4 | #' Experimental |
5 | 5 | #' |
6 | | -#' $Revision: 1.11 $ $Date: 2023/09/11 04:13:58 $ |
| 6 | +#' $Revision: 1.12 $ $Date: 2025/04/18 08:13:38 $ |
7 | 7 | #' |
8 | 8 |
|
9 | 9 | zclustermodel <- function(name="Thomas", ..., mu, kappa, scale) { |
@@ -83,7 +83,7 @@ Kmodel.zclustermodel <- function(model, ...) { |
83 | 83 | } |
84 | 84 |
|
85 | 85 | intensity.zclustermodel <- function(X, ...) { |
86 | | - X$par[["kappa"]] * X$mu |
| 86 | + X$par.std[["kappa"]] * X$mu |
87 | 87 | } |
88 | 88 |
|
89 | 89 | predict.zclustermodel <- function(object, ..., |
@@ -122,3 +122,57 @@ reach.zclustermodel <- function(x, ..., epsilon) { |
122 | 122 | } |
123 | 123 |
|
124 | 124 | is.poissonclusterprocess.zclustermodel <- function(model) { TRUE } |
| 125 | + |
| 126 | +simulate.zclustermodel <- function(object, nsim=1, ..., win=unit.square()) { |
| 127 | + with(object, { |
| 128 | + switch(name, |
| 129 | + Thomas = { |
| 130 | + rThomas(kappa=par.std[["kappa"]], |
| 131 | + scale=par.std[["scale"]], |
| 132 | + mu=mu, |
| 133 | + win=win, |
| 134 | + nsim=nsim, |
| 135 | + ...) |
| 136 | + }, |
| 137 | + MatClust = { |
| 138 | + rMatClust(kappa=par.std[["kappa"]], |
| 139 | + scale=par.std[["scale"]], |
| 140 | + mu=mu, |
| 141 | + win=win, |
| 142 | + nsim=nsim, |
| 143 | + ...) |
| 144 | + }, |
| 145 | + Cauchy = { |
| 146 | + rCauchy(kappa=par.std[["kappa"]], |
| 147 | + scale=par.std[["scale"]], |
| 148 | + mu=mu, |
| 149 | + win=win, |
| 150 | + nsim=nsim, |
| 151 | + ...) |
| 152 | + }, |
| 153 | + VarGamma = { |
| 154 | + do.call(rVarGamma, |
| 155 | + resolve.defaults( |
| 156 | + list(kappa=par.std[["kappa"]], |
| 157 | + scale=par.std[["scale"]], |
| 158 | + mu=mu, |
| 159 | + win=win, |
| 160 | + nsim=nsim, |
| 161 | + ...), |
| 162 | + clustargs)) |
| 163 | + }, |
| 164 | + LGCP = { |
| 165 | + do.call(rLGCP, |
| 166 | + resolve.defaults( |
| 167 | + list(kappa=par.std[["kappa"]], |
| 168 | + scale=par.std[["scale"]], |
| 169 | + mu=mu, |
| 170 | + win=win, |
| 171 | + nsim=nsim, |
| 172 | + ...), |
| 173 | + clustargs)) |
| 174 | + }, |
| 175 | + stop(paste("Unrecognised model name", sQuote(object$name)), |
| 176 | + call.=FALSE) |
| 177 | + )}) |
| 178 | +} |
0 commit comments