Skip to content

Commit 835e677

Browse files
committed
removed two demo models because they have to be compiled
1 parent 9ded9ba commit 835e677

29 files changed

+247
-158
lines changed

R/cross_validation.R

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,13 @@
1010
#' @seealso \code{\link{crossvalidate}} for how to use the created fold vector to perform cross-validation.
1111
#' @details The folds are created such that the data of each person is fully in one fold.
1212
#' @examples
13-
#' data("exampleModel")
14-
#' theFolds <- createLeavePersonsOutFolds(exampleModel)
13+
#' \dontrun{
14+
#' data("demoLGCM")
15+
#' lgcm <- gppm('muI+muS*t','varI+covIS*(t+t#)+varS*t*t#+(t==t#)*sigma',
16+
#' demoLGCM,'ID','y')
17+
#' theFolds <- createLeavePersonsOutFolds(lgcm)
18+
#' }
19+
#'
1520
#' @export
1621
createLeavePersonsOutFolds <- function(gpModel,k=10){
1722
checkGPPM(gpModel)

R/data.R

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -14,25 +14,4 @@
1414
"trueParas"
1515

1616

17-
#' Example Gaussian Process Panel model
18-
#'
19-
#' @format An object of class GPPM. A fitted Gaussian process panel model. Used to speed up the example code for the numerous extractor functions. Result of
20-
#'
21-
#' ```
22-
#' data('demoLGCM')
23-
#' exampleModel <- fit(gppm('muI+muS*t','varI+covIS*(t+t#)+varS*t*t#+(t==t#)*sigma',demoLGCM,'ID','y'))
24-
#' ```
25-
"exampleModel"
26-
27-
#' Example Gaussian Process Panel model
28-
#'
29-
#' @format An object of class GPPM. An unfitted Gaussian process panel model. Used for testing only. Result of
30-
#'
31-
#' ```
32-
#' data('demoLGCM')
33-
#' exampleModelNotFit <- fit(gppm('muI+muS*t','varI+covIS*(t+t#)+varS*t*t#+(t==t#)*sigma',demoLGCM,'ID','y'))
34-
#' ```
35-
"exampleModelNotFit"
36-
37-
3817

R/extractors.R

Lines changed: 115 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,13 @@
88
#' @family functions to extract from a GPPM
99
#' @return Point estimates for all parameters as a named numeric vector.
1010
#' @examples
11-
#' data("exampleModel")
12-
#' paraEsts <- coef(exampleModel)
11+
#' \dontrun{
12+
#' data("demoLGCM")
13+
#' lgcm <- gppm('muI+muS*t','varI+covIS*(t+t#)+varS*t*t#+(t==t#)*sigma',
14+
#' demoLGCM,'ID','y')
15+
#' lgcmFit <- fit(lgcm)
16+
#' paraEsts <- coef(lgcmFit)
17+
#' }
1318
#' @export
1419
coef.GPPM <- function (object,...){
1520
checkFitted(object)
@@ -24,8 +29,13 @@ coef.GPPM <- function (object,...){
2429
#' @family functions to extract from a GPPM
2530
#' @return A matrix of the estimated covariances between the parameter estimates. This has row and column names corresponding to the parameter names.
2631
#' @examples
27-
#' data("exampleModel")
28-
#' covMat <- vcov(exampleModel)
32+
#' \dontrun{
33+
#' data("demoLGCM")
34+
#' lgcm <- gppm('muI+muS*t','varI+covIS*(t+t#)+varS*t*t#+(t==t#)*sigma',
35+
#' demoLGCM,'ID','y')
36+
#' lgcmFit <- fit(lgcm)
37+
#' covMat <- vcov(lgcmFit)
38+
#' }
2939
#' @export
3040
vcov.GPPM <- function (object,...)
3141
{
@@ -42,8 +52,12 @@ vcov.GPPM <- function (object,...)
4252
#' @family functions to extract from a GPPM
4353
#' @return Standard errors for all parameters as a named numeric vector.
4454
#' @examples
45-
#' data("exampleModel")
46-
#' stdErrors <- SE(exampleModel)
55+
#' \dontrun{
56+
#' lgcm <- gppm('muI+muS*t','varI+covIS*(t+t#)+varS*t*t#+(t==t#)*sigma',
57+
#' demoLGCM,'ID','y')
58+
#' lgcmFit <- fit(lgcm)
59+
#' stdErrors <- SE(lgcmFit)
60+
#' }
4761
#' @export
4862
SE <- function (object)
4963
{
@@ -63,8 +77,13 @@ SE <- function (object)
6377
#'
6478
#' @return A matrix (or vector) with columns giving lower and upper confidence limits for each parameter. These will be labelled as (1-level)/2 and 1 - (1-level)/2 in \% (by default 2.5\% and 97.5\%).
6579
#' @examples
66-
#' data("exampleModel")
67-
#' confInts <- confint(exampleModel)
80+
#' \dontrun{
81+
#' data("demoLGCM")
82+
#' lgcm <- gppm('muI+muS*t','varI+covIS*(t+t#)+varS*t*t#+(t==t#)*sigma',
83+
#' demoLGCM,'ID','y')
84+
#' lgcmFit <- fit(lgcm)
85+
#' confInts <- confint(lgcmFit)
86+
#' }
6887
#' @export
6988
confint.GPPM <- function(object, parm, level = 0.95,...)
7089
{
@@ -94,8 +113,13 @@ confint.GPPM <- function(object, parm, level = 0.95,...)
94113
#' @family functions to extract from a GPPM
95114
#' @return Returns an object of class logLik. Attributs are: "df" (\strong{d}egrees of \strong{f}reedom; number of estimated parameters in the model) and nobs (number of persons in the model)
96115
#' @examples
97-
#' data("exampleModel")
98-
#' ll <- logLik(exampleModel)
116+
#' \dontrun{
117+
#' data("demoLGCM")
118+
#' lgcm <- gppm('muI+muS*t','varI+covIS*(t+t#)+varS*t*t#+(t==t#)*sigma',
119+
#' demoLGCM,'ID','y')
120+
#' lgcmFit <- fit(lgcm)
121+
#' ll <- logLik(lgcmFit)
122+
#' }
99123
#' @export
100124
logLik.GPPM <- function(object,...){
101125
checkFitted(object)
@@ -113,12 +137,17 @@ logLik.GPPM <- function(object,...){
113137
#' @family functions to extract from a GPPM
114138
#' @return Returns a list structure with mean and covariances matrices. See example.
115139
#' @examples
116-
#' data("exampleModel")
117-
#' meansCovs <- fitted(exampleModel)
140+
#' \dontrun{
141+
#' data("demoLGCM")
142+
#' lgcm <- gppm('muI+muS*t','varI+covIS*(t+t#)+varS*t*t#+(t==t#)*sigma',
143+
#' demoLGCM,'ID','y')
144+
#' lgcmFit <- fit(lgcm)
145+
#' meansCovs <- fitted(lgcmFit)
118146
#'
119147
#' person1Mean <- meansCovs$mean[[1]]
120148
#' person1Cov <- meansCovs$cov[[1]]
121149
#' person1ID <- meansCovs$ID[[1]]
150+
#' }
122151
#' @export
123152
fitted.GPPM <- function(object,...){
124153
checkFitted(object)
@@ -133,8 +162,12 @@ fitted.GPPM <- function(object,...){
133162
#' @param gpModel object of class GPPM.
134163
#' @return Number of persons as a numeric.
135164
#' @examples
136-
#' data("exampleModel")
137-
#' numberPersons <- nPers(exampleModel)
165+
#' \dontrun{
166+
#' data("demoLGCM")
167+
#' lgcm <- gppm('muI+muS*t','varI+covIS*(t+t#)+varS*t*t#+(t==t#)*sigma',
168+
#' demoLGCM,'ID','y')
169+
#' numberPersons <- nPers(lgcm)
170+
#' }
138171
#' @export
139172
nPers <- function (gpModel) {
140173
gpModel$dataForStan$nPer
@@ -150,8 +183,12 @@ nPers <- function (gpModel) {
150183
#' @family functions to extract from a GPPM
151184
#' @return Number of parameters as a numeric.
152185
#' @examples
153-
#' data("exampleModel")
154-
#' numberParas <- nPars(exampleModel)
186+
#' \dontrun{
187+
#' data("demoLGCM")
188+
#' lgcm <- gppm('muI+muS*t','varI+covIS*(t+t#)+varS*t*t#+(t==t#)*sigma',
189+
#' demoLGCM,'ID','y')
190+
#' numberParas <- nPars(lgcm)
191+
#' }
155192
#' @export
156193
nPars <- function (gpModel) {
157194
checkGPPM(gpModel)
@@ -167,8 +204,12 @@ nPars <- function (gpModel) {
167204
#' @family functions to extract from a GPPM
168205
#' @return Maximum number of observations as a numeric.
169206
#' @examples
170-
#' data("exampleModel")
171-
#' maxNumberObs <- maxnObs(exampleModel)
207+
#' \dontrun{
208+
#' data("demoLGCM")
209+
#' lgcm <- gppm('muI+muS*t','varI+covIS*(t+t#)+varS*t*t#+(t==t#)*sigma',
210+
#' demoLGCM,'ID','y')
211+
#' maxNumberObs <- maxnObs(lgcm)
212+
#' }
172213
#' @export
173214
maxnObs <- function (gpModel){
174215
checkGPPM(gpModel)
@@ -183,9 +224,12 @@ maxnObs <- function (gpModel){
183224
#' @family functions to extract from a GPPM
184225
#' @return Number of observations for each person as a numeric vector. The corresponding IDs are in the IDs attribute.
185226
#' @examples
186-
#' data("exampleModel")
187-
#' numberObs <- nObs(exampleModel)
188-
#'
227+
#' \dontrun{
228+
#' data("demoLGCM")
229+
#' lgcm <- gppm('muI+muS*t','varI+covIS*(t+t#)+varS*t*t#+(t==t#)*sigma',
230+
#' demoLGCM,'ID','y')
231+
#' numberObs <- nObs(lgcm)
232+
#' }
189233
#' @export
190234
nObs <- function (gpModel) {
191235
checkGPPM(gpModel)
@@ -205,8 +249,12 @@ nObs <- function (gpModel) {
205249
#' @family functions to extract from a GPPM
206250
#' @return Number of predictors as numeric.
207251
#' @examples
208-
#' data("exampleModel")
209-
#' numberPreds <- nPreds(exampleModel)
252+
#' \dontrun{
253+
#' data("demoLGCM")
254+
#' lgcm <- gppm('muI+muS*t','varI+covIS*(t+t#)+varS*t*t#+(t==t#)*sigma',
255+
#' demoLGCM,'ID','y')
256+
#' numberPreds <- nPreds(lgcm)
257+
#' }
210258
#' @export
211259
nPreds <- function (gpModel) {
212260
checkGPPM(gpModel)
@@ -221,8 +269,12 @@ nPreds <- function (gpModel) {
221269
#' @family functions to extract from a GPPM
222270
#' @return The names of the predictors.
223271
#' @examples
224-
#' data("exampleModel")
225-
#' myPreds <- preds(exampleModel)
272+
#' \dontrun{
273+
#' data("demoLGCM")
274+
#' lgcm <- gppm('muI+muS*t','varI+covIS*(t+t#)+varS*t*t#+(t==t#)*sigma',
275+
#' demoLGCM,'ID','y')
276+
#' myPreds <- preds(lgcm)
277+
#' }
226278
#' @export
227279
preds <- function(gpModel) {
228280
checkGPPM(gpModel)
@@ -237,9 +289,13 @@ preds <- function(gpModel) {
237289
#' @inheritParams nPers
238290
#' @family functions to extract from a GPPM
239291
#' @examples
240-
#' data("exampleModel")
241-
#' parameters <- pars(exampleModel)
292+
#' \dontrun{
293+
#' data("demoLGCM")
294+
#' lgcm <- gppm('muI+muS*t','varI+covIS*(t+t#)+varS*t*t#+(t==t#)*sigma',
295+
#' demoLGCM,'ID','y')
296+
#' parameters <- pars(lgcm)
242297
#' @return The names of the paramters
298+
#' }
243299
#' @export
244300
pars <- function (gpModel) {
245301
gpModel$parsedModel$params
@@ -254,9 +310,13 @@ pars <- function (gpModel) {
254310
#' @family functions to extract from a GPPM
255311
#' @param level scalar from 0 to 1. The confidence level required.
256312
#' @examples
257-
#' data("exampleModel")
258-
#' paramEssentials <- parEsts(exampleModel)
259-
#'
313+
#' \dontrun{
314+
#' data("demoLGCM")
315+
#' lgcm <- gppm('muI+muS*t','varI+covIS*(t+t#)+varS*t*t#+(t==t#)*sigma',
316+
#' demoLGCM,'ID','y')
317+
#' lgcmFit <- fit(lgcm)
318+
#' paramEssentials <- parEsts(lgcmFit)
319+
#' }
260320
#' @return A data.frame containing the estimated parameters, standard errors, and the lower and upper bounds of the confidence intervals.
261321
#' @export
262322
parEsts <- function (object, level=.95) {
@@ -286,8 +346,12 @@ parEsts <- function (object, level=.95) {
286346
#' @family functions to extract from a GPPM
287347
#' @return The mean function as a character string.
288348
#' @examples
289-
#' data("exampleModel")
290-
#' myMean <- meanf(exampleModel)
349+
#' \dontrun{
350+
#' data("demoLGCM")
351+
#' lgcm <- gppm('muI+muS*t','varI+covIS*(t+t#)+varS*t*t#+(t==t#)*sigma',
352+
#' demoLGCM,'ID','y')
353+
#' myMean <- meanf(lgcm)
354+
#' }
291355
#' @export
292356
meanf <- function (gpModel) {
293357
checkGPPM(gpModel)
@@ -303,8 +367,12 @@ meanf <- function (gpModel) {
303367
#' @family functions to extract from a GPPM
304368
#' @return The covariance function as a character string.
305369
#' @examples
306-
#' data("exampleModel")
307-
#' myCov <- covf(exampleModel)
370+
#' \dontrun{
371+
#' data("demoLGCM")
372+
#' lgcm <- gppm('muI+muS*t','varI+covIS*(t+t#)+varS*t*t#+(t==t#)*sigma',
373+
#' demoLGCM,'ID','y')
374+
#' myCov <- covf(lgcm)
375+
#' }
308376
#' @export
309377
covf <- function (gpModel) {
310378
checkGPPM(gpModel)
@@ -320,8 +388,12 @@ covf <- function (gpModel) {
320388
#' @family functions to extract from a GPPM
321389
#' @return The data set associated with the GPPM.
322390
#' @examples
323-
#' data("exampleModel")
324-
#' myData <- datas(exampleModel)
391+
#' \dontrun{
392+
#' data("demoLGCM")
393+
#' lgcm <- gppm('muI+muS*t','varI+covIS*(t+t#)+varS*t*t#+(t==t#)*sigma',
394+
#' demoLGCM,'ID','y')
395+
#' myData <- datas(lgcm)
396+
#' }
325397
#' @export
326398
datas <- function (gpModel) {
327399
checkGPPM(gpModel)
@@ -345,8 +417,13 @@ datas <- function (gpModel) {
345417
#' @family functions to extract from a GPPM
346418
#' @return The requested quantity
347419
#' @examples
348-
#' data("exampleModel")
349-
#' getIntern(exampleModel,'parsedmFormula')
420+
#' \dontrun{
421+
#' data("demoLGCM")
422+
#' lgcm <- gppm('muI+muS*t','varI+covIS*(t+t#)+varS*t*t#+(t==t#)*sigma',
423+
#' demoLGCM,'ID','y')
424+
#' lgcmFit <- fit(lgcm)
425+
#' getIntern(lgcmFit,'parsedmFormula')
426+
#' }
350427
#' @export
351428
getIntern <- function (gpModel, quantity) {
352429
checkGPPM(gpModel)

cran-comments.md

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,10 @@
11
## Test environments
2-
* local OS X install, R 3.5.0
3-
* ubuntu XXX (on travis-ci), R XXX
4-
* win-builder (devel and release)
2+
* local mac OS 10.12.6, R 3.5.0
3+
* ubuntu 14.04 (on travis-ci), R 3.5.0
4+
* win-builder (devel)
55

66
## R CMD check results
7-
There were no ERRORs or WARNINGs.
8-
9-
There was 1 NOTE:
10-
11-
checking installed package size ... NOTE
12-
installed size is 6.4Mb
13-
sub-directories of 1Mb or more:
14-
data 6.1Mb
7+
There were no ERRORs, WARNINGs or NOTEs.
158

169
## Downstream dependencies
17-
I have also run R CMD check locally on downstream dependencies of gppm using devtools::revdep_check(). Not ERRORsor WARNINGs were found.
10+
I have also run R CMD check locally on downstream dependencies of gppm using devtools::revdep_check(). No ERRORs or WARNINGs were found.

data-raw/generateData.R

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,4 @@ lgcm <- gppm(meanf,covf,demoLGCM,'ID','y')
2121
trueParas <- c(58,-1,5,1,0, 0.01)
2222
names(trueParas) <-c('muI','muS','varI','varS','covIS','sigma')
2323
demoLGCM <- simulate(lgcm,parameterValues=trueParas)
24-
exampleModelNotFit <- gppm(meanf,covf,demoLGCM,'ID','y')
25-
exampleModel <- fit(gppm(meanf,covf,demoLGCM,'ID','y'))
26-
devtools::use_data(demoLGCM,trueParas,exampleModel,exampleModelNotFit,overwrite = TRUE)
24+
devtools::use_data(demoLGCM,trueParas,overwrite = TRUE)

data/exampleModel.rda

-2.62 MB
Binary file not shown.

data/exampleModelNotFit.rda

-2.26 MB
Binary file not shown.

man/SE.Rd

Lines changed: 6 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/coef.GPPM.Rd

Lines changed: 7 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)