RFratiotest(nullmodel, alternative, x, y = NULL, z = NULL, T = NULL,
grid=NULL, data,
alpha, n = 5 / alpha, seed = 0,
lower = NULL, upper = NULL, bc_lambda, methods,
sub.methods, optim.control = NULL, users.guess = NULL,
distances = NULL, dim, transform = NULL, ...)
nullmodel
should be a subset of the parameters to be estimated for
alternative
if alternative
is given.n-1
simulations.NULL
and not NA
, the
.Random.seed is set to seed
. Otherwise,
p
, the$p$-valuen
data.ratio
the log ratio for the datasimu.ratio
the log ratio for the simulationsdata.fit
the models fitted to the datamsg
the message that is also directly returned"RFratiotest"
.nullmodel
(and the alternative
) can be
RFgetModelNames(type="negative")
to get all options. Depending weather theratiotest_approx
is TRUE the
the chisq approximation is performed. Otherwise
a Monte Carlo ratio test is performed.
RFfit
orRMmodelFit
Here, a chisq approximative test is always performed on the
already fitted models.nullmodel
is a submodel of alternative
.
If it fails,
alternative
model
returns a (log) likelihood that is at least as large as
that of thenullmodel
,
even ifnullmodel
is a submodel ofalternative
.
This is due to numerical optimisation which is never perfect.alternative
model has
a (log) likelihood that is at least as large as that of the nullmodel
.RandomFields
,
\dontrun{
RFoptions(seed=0) ## *ANY* simulation will have the random seed 0; set
## RFoptions(seed=NA) to make them all random again
data(soil) ## see also ?soil
soil <- RFspatialPointsDataFrame(
coords = soil[, c("x.coord", "y.coord")],
data = soil[, c("moisture", "NO3.N", "Total.N",
"NH4.N", "DOC", "N20N")],
RFparams=list(vdim=6, n=1)
)
model <- ~1 + RMplus(RMwhittle(scale=NA, var=NA, nu=NA), RMnugget(var=NA))
submodel <- ~1 + RMplus(RMwhittle(scale=NA, var=NA, nu=NA), RMnugget(var=0))
RFratiotest(submodel, model, data=soil["moisture"],
modus_operandi="sloppy")
}
FinalizeExample()
Run the code above in your browser using DataLab