Description Usage Arguments Details Value Author(s)

View source: R/qleTest.R View source: R/qleTest.R

Monte Carlo hypothesis testing

1 2 3 |

`est` |
object of class |

`local` |
optional, object of class |

`sim` |
user supplied simulation function (see |

`...` |
arguments passed to the simulation function ' |

`nsim` |
number of model replications to generate the simulated statistics |

`obs` |
optional, |

`check.root` |
logical, |

`alpha` |
significance level for testing the hypothesis |

`na.rm` |
logical, |

`cl` |
cluster object, |

`iseed` |
integer, the seed for initializing the cluster workers for parallel computations |

`verbose` |
logical, |

The function tests the null hypothesis *H_0:\,\hat{θ}=θ_0*, that is, whether the statistical
model w.r.t. to the estimated parameter is true, against the alternative *H_1:\,\hat{θ}\neqθ_0* by testing based
on a Monte Carlo approach (see vignette). Due to the approximate nature of the assumed statistical model for the observed data the
exact distribution of the test statistics, that is, the Mahalanobis distance or quasi-deviance, is generally unknown and therefore
its asymptotic distribution might be an unrealistic assumption for the null hypothesis. For this reason, and in order to retrieve an empirical
P-value for testing, we generate (pseudo-)observations from the outcome of the model replications and re-estimate the model
parameter for each realization in the same way as done before when estimating the model parameter. This includes all possible types
of variance approximations (by kriging or average approximation) and types of prediction variance (kriging or the CV-based variance).

The function expects an estimation result as returned from `qle`

. If any generated observations are readily available
at the final parameter estimate, then these can be passed by '`obs`

'. Otherwise the function first generates those
using '`nsim`

' model replications at the estimated parameter as part of '`est`

' or '`local`

'. The criterion
function approximations are used as it (specified in the object '`qsd`

') and will not be further improved by
additional samples during the test.
The value of the test statistic is either chosen as the current criterion function value in '`OPT`

'
(see argument '`criterion`

' in `getQLmodel`

) or is taken from the optional argument '`local`

'. Given the local results
'`local`

' of class `QSResult`

, the user can also select a different criterion function as a test statistic than before when
estimating the parameter itself. Apart from the quasi-deviance as a test statistic, in principle, any supported type of a least squares criterion,
more generally, the Mahalanobis distance, can be used depending on the prefered type of variance matrix approximation, see `covarTx`

.
Practically, the re-estimations might fail to converge, however, then the user can control the convergence conditions of the local solvers
(including quasi-scoring) by the corresponding control parameters (see `searchMinimizer`

). Any failed re-estimations are
excluded from the test results and stored in the attribute '`info`

'. In addition, as part of the returned data frame '`param`

'
the empirical standard error, predicted standard error (based on the average inverse quasi-information matrix), the root mean square error,
the bias and sample mean value of the re-estimated parameters are also available.

For an example please see the package vignette.

An object of class `qleTest`

as a list of:

`param` |
data frame of estimated parameters and error measures |

`test` |
the test result |

`Stest` |
name of the test |

and attributes:

`msem` |
mean square error matrix of re-estimated parameters |

`aiqm` |
average inverse quasi-information matrix over all re-estimated parameters |

`qi` |
inverse quasi-information matrix at the parameter to be tested ' |

`relED` |
relative difference of the empirial and predicted standard error of the parameter to be tested |

`obs` |
list of simulated observed statistics |

`optRes` |
results from re-estimating the model parameters for each simulated observation from ' |

`mean.score` |
average quasi-score, respectively, average gradient of the MD at the re-estimated parameters |

`criterion` |
always equal to " |

`solInfo` |
results of the numerical consistency checks for each re-estimated parameter |

`info` |
list of indices of re-estimation results where the inversion of the quasi-information matrix failed,
the re-estimated parameters have |

M. Baaske

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.