Description Usage Arguments Details Value Methods Note Note Note See Also Examples
View source: R/Likelihoodratio.R
The function performs an approximate chi2 test or
a Monte Carlo likelihood ratio test
based on fitgauss
. Currently, it only works for
Gaussian random fields.
1 2 3 4 5 |
nullmodel, alternative |
See Details. The set of parameters
to be estimated for |
alpha |
value in [0,1] or missing. Significance level. |
n |
integer. The test is based on |
seed |
integer. If not |
x |
\argX |
y,z |
\argYz |
T |
\argT |
grid |
\argGrid |
data |
\argData |
lower |
\argLower |
upper |
\argUpper |
methods |
\argFitmethods |
sub.methods |
\argFitsubmethods See RFfit for details. |
users.guess |
\argUsersguess |
distances,dim |
\argDistances |
optim.control |
\argOptimcontrol |
transform |
\argTransform |
... |
\argDots |
nullmodel
(and the alternative
) can be
a covariance model, see RMmodel
or
type RFgetModelNames(type="variogram")
to get all options.
If RFoptions
ratiotest_approx
is TRUE
the chisq approximation is performed. Otherwise
a Monte Carlo ratio test is performed.
RFfit
or
RMmodelFit
Here, a chisq approximative test is always performed on the already fitted models.
RFratiotest
tries to detect whether
nullmodel
is a submodel of alternative
.
If it fails,
a message is printed that says that an automatic detection has not been possible;
it is not guaranteed anymore that the alternative
model
returns a (log) likelihood that is at least as large as
that of the nullmodel
,
even if nullmodel
is a submodel of alternative
.
This is due to numerical optimisation which is never perfect.
Otherwise it is guaranteed that the alternative
model has
a (log) likelihood that is at least as large as that of the nullmodel
.
The test returns a message whether the null hypothesis, i.e. the smaller model is accepted. Invisibly, a list that also contains
p
, the p-value
n
data.ratio
the log ratio for the data
simu.ratio
the log ratio for the simulations
data.fit
the models fitted to the data
msg
the message that is also directly returned
It has S3 class "RFratiotest"
.
prints the summary
gives a summary
An important RFoptions
is ratiotest_approx
.
Note that the likelihood ratio test may take a huge amount of time.
This function does not depend on the value of
RFoptions
()$PracticalRange
. The function RFratiotest
always uses the standard specification
of the covariance model as given in RMmodel
.
RFfit
,
RMmodel
,
RandomFields
,
weather
.
1 |
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.