Skip to contents

[Stable]

Parses the cycle information from an NPAG or an IT2B object.

Usage

makeCycle(data)

Arguments

data

A suitable data object of the NPAG or IT2B class (see NPparse or ITparse).

Value

The output of makeCycle is a list of class PMcycle, which has 8 objects from NPAG or 6 objects from IT2B :

names

Vector of names of the random parameters

#'

names

Vector of names of the random parameters

cycnum

Vector cycle numbers, which may start at numbers greater than 1 if a non-uniform prior was specified for the run (NPAG only)

ll

Matrix of cycle number and -2*Log-likelihood at each cycle

gamlam

A matrix of cycle number and gamma or lambda at each cycle

mean

A matrix of cycle number and the mean of each random parameter at each cycle, normalized to initial mean

sd

A matrix of cycle number and the standard deviation of each random parameter at each cycle, normalized to initial standard deviation

median

A matrix of cycle number and the median of each random parameter at each cycle, normalized to initial median

aic

A matrix of cycle number and Akaike Information Criterion at each cycle

bic

A matrix of cycle number and Bayesian (Schwartz) Information Criterion at each cycle

A plot method exists in plot for PMcycle objects.

Details

This function will parse the output of NPparse or ITparse to generate a list suitable for analysis and plotting of NPAG or IT2B cycle information.

Author

Michael Neely

Examples

library(PmetricsData)
cycle <- makeCycle(NPex$NPdata)
cycle
#> $names
#> [1] "Ka"    "Ke"    "V"     "Tlag1"
#> 
#> $cycnum
#>   [1]   1   2   3   4   5   6   7   8   9  10  11  12  13  14  15  16  17  18
#>  [19]  19  20  21  22  23  24  25  26  27  28  29  30  31  32  33  34  35  36
#>  [37]  37  38  39  40  41  42  43  44  45  46  47  48  49  50  51  52  53  54
#>  [55]  55  56  57  58  59  60  61  62  63  64  65  66  67  68  69  70  71  72
#>  [73]  73  74  75  76  77  78  79  80  81  82  83  84  85  86  87  88  89  90
#>  [91]  91  92  93  94  95  96  97  98  99 100
#> 
#> $ll
#>   [1] 507.3346 481.2885 460.5295 456.6656 456.4747 456.4747 454.6416 453.0673
#>   [9] 452.7149 452.6453 452.6453 448.5969 448.4804 448.3917 448.3405 448.3009
#>  [17] 448.2713 448.2713 446.7067 445.8884 445.5819 445.5588 445.5471 445.5426
#>  [25] 445.5426 444.4183 443.9666 443.4177 443.0373 442.8305 442.7360 442.7092
#>  [33] 442.6847 442.6652 442.5090 442.2605 442.1442 442.1415 442.1399 442.1396
#>  [41] 442.1369 442.1322 442.1288 442.1267 442.1259 442.1214 442.1164 442.1128
#>  [49] 442.1106 442.1077 442.1014 442.0966 442.0932 442.0902 442.0829 442.0771
#>  [57] 442.0728 442.0681 442.0600 442.0535 442.0486 442.0447 442.0353 442.0278
#>  [65] 442.0218 442.0172 442.0141 442.0124 442.0120 442.0120 441.6645 441.4615
#>  [73] 441.3766 441.3248 441.2395 441.1680 441.1068 441.0444 440.9916 440.8840
#>  [81] 440.7468 440.6802 440.5175 440.4220 440.4022 440.3955 440.3622 440.3499
#>  [89] 440.3384 440.3066 440.2895 440.2692 440.2470 440.2440 440.2243 440.2052
#>  [97] 440.2048 440.1825 440.1657 440.1657
#> 
#> $gamlam
#> # A tibble: 100 × 3
#>    cycle value outeq
#>    <int> <dbl> <chr>
#>  1     1  4.55 1    
#>  2     2  3.79 1    
#>  3     3  2.71 1    
#>  4     4  2.71 1    
#>  5     5  2.71 1    
#>  6     6  2.71 1    
#>  7     7  2.71 1    
#>  8     8  2.58 1    
#>  9     9  2.58 1    
#> 10    10  2.58 1    
#> # ℹ 90 more rows
#> 
#> $mean
#> # A tibble: 100 × 5
#>    cycle    Ka    Ke     V Tlag1
#>    <int> <dbl> <dbl> <dbl> <dbl>
#>  1     1 1      1    1     1    
#>  2     2 1.01   1.00 0.993 0.997
#>  3     3 1.03   1.01 0.989 0.997
#>  4     4 1.02   1.01 0.995 0.984
#>  5     5 0.994  1.01 0.995 0.983
#>  6     6 0.994  1.01 0.995 0.983
#>  7     7 1.01   1.01 1.01  0.954
#>  8     8 1.00   1.01 1.00  0.949
#>  9     9 1.01   1.01 1.00  0.950
#> 10    10 1.02   1.01 1.00  0.950
#> # ℹ 90 more rows
#> 
#> $sd
#> # A tibble: 100 × 5
#>    cycle    Ka    Ke     V Tlag1
#>    <int> <dbl> <dbl> <dbl> <dbl>
#>  1     1  1     1    1      1   
#>  2     2  1.03  1.00 0.982  1.00
#>  3     3  1.07  1.01 0.971  1.01
#>  4     4  1.04  1.01 0.973  1.18
#>  5     5  1.03  1.01 0.973  1.18
#>  6     6  1.03  1.01 0.973  1.18
#>  7     7  1.03  1.01 1.01   1.10
#>  8     8  1.03  1.01 1.01   1.14
#>  9     9  1.05  1.01 1.00   1.14
#> 10    10  1.06  1.01 1.00   1.14
#> # ℹ 90 more rows
#> 
#> $median
#> # A tibble: 100 × 5
#>    cycle    Ka    Ke     V Tlag1
#>    <int> <dbl> <dbl> <dbl> <dbl>
#>  1     1  1     1     1    1    
#>  2     2  1.04  1.00  1.00 1.04 
#>  3     3  1.06  1.00  1.00 1.05 
#>  4     4  1.04  1.00  1.00 0.802
#>  5     5  1.04  1.00  1.00 0.801
#>  6     6  1.04  1.00  1.00 0.801
#>  7     7  1.06  1.00  1.00 0.801
#>  8     8  1.06  1.00  1.00 0.822
#>  9     9  1.06  1.00  1.00 0.825
#> 10    10  1.07  1.00  1.00 0.825
#> # ℹ 90 more rows
#> 
#> $aic
#>        1        2        3        4        5        6        7        8 
#> 517.7858 491.7396 470.9806 467.1167 466.9258 466.9258 465.0927 463.5185 
#>        9       10       11       12       13       14       15       16 
#> 463.1660 463.0964 463.0964 459.0480 458.9315 458.8429 458.7916 458.7521 
#>       17       18       19       20       21       22       23       24 
#> 458.7225 458.7225 457.1578 456.3396 456.0331 456.0099 455.9982 455.9937 
#>       25       26       27       28       29       30       31       32 
#> 455.9937 454.8695 454.4178 453.8688 453.4884 453.2816 453.1872 453.1603 
#>       33       34       35       36       37       38       39       40 
#> 453.1359 453.1163 452.9602 452.7117 452.5954 452.5926 452.5911 452.5907 
#>       41       42       43       44       45       46       47       48 
#> 452.5880 452.5833 452.5799 452.5778 452.5770 452.5725 452.5675 452.5639 
#>       49       50       51       52       53       54       55       56 
#> 452.5617 452.5588 452.5525 452.5477 452.5443 452.5413 452.5340 452.5282 
#>       57       58       59       60       61       62       63       64 
#> 452.5239 452.5192 452.5112 452.5047 452.4998 452.4958 452.4864 452.4789 
#>       65       66       67       68       69       70       71       72 
#> 452.4729 452.4684 452.4652 452.4635 452.4631 452.4631 452.1157 451.9126 
#>       73       74       75       76       77       78       79       80 
#> 451.8277 451.7759 451.6906 451.6191 451.5580 451.4955 451.4427 451.3352 
#>       81       82       83       84       85       86       87       88 
#> 451.1979 451.1314 450.9686 450.8731 450.8533 450.8467 450.8133 450.8010 
#>       89       90       91       92       93       94       95       96 
#> 450.7896 450.7577 450.7407 450.7203 450.6981 450.6951 450.6755 450.6563 
#>       97       98       99      100 
#> 450.6560 450.6336 450.6168 450.6168 
#> 
#> $bic
#>        1        2        3        4        5        6        7        8 
#> 532.0070 505.9609 485.2018 481.3380 481.1471 481.1471 479.3139 477.7397 
#>        9       10       11       12       13       14       15       16 
#> 477.3873 477.3177 477.3177 473.2692 473.1527 473.0641 473.0129 472.9733 
#>       17       18       19       20       21       22       23       24 
#> 472.9437 472.9437 471.3791 470.5608 470.2543 470.2312 470.2194 470.2150 
#>       25       26       27       28       29       30       31       32 
#> 470.2150 469.0907 468.6390 468.0901 467.7097 467.5029 467.4084 467.3816 
#>       33       34       35       36       37       38       39       40 
#> 467.3571 467.3375 467.1814 466.9329 466.8166 466.8138 466.8123 466.8119 
#>       41       42       43       44       45       46       47       48 
#> 466.8092 466.8046 466.8012 466.7990 466.7982 466.7938 466.7888 466.7852 
#>       49       50       51       52       53       54       55       56 
#> 466.7829 466.7801 466.7738 466.7690 466.7656 466.7625 466.7552 466.7494 
#>       57       58       59       60       61       62       63       64 
#> 466.7452 466.7405 466.7324 466.7259 466.7210 466.7171 466.7077 466.7002 
#>       65       66       67       68       69       70       71       72 
#> 466.6941 466.6896 466.6865 466.6847 466.6844 466.6844 466.3369 466.1339 
#>       73       74       75       76       77       78       79       80 
#> 466.0489 465.9972 465.9119 465.8404 465.7792 465.7168 465.6639 465.5564 
#>       81       82       83       84       85       86       87       88 
#> 465.4192 465.3526 465.1899 465.0944 465.0746 465.0679 465.0345 465.0223 
#>       89       90       91       92       93       94       95       96 
#> 465.0108 464.9789 464.9619 464.9416 464.9193 464.9163 464.8967 464.8776 
#>       97       98       99      100 
#> 464.8772 464.8549 464.8381 464.8381 
#> 
#> attr(,"class")
#> [1] "PMcycle" "list"   
names(cycle)
#> [1] "names"  "cycnum" "ll"     "gamlam" "mean"   "sd"     "median" "aic"   
#> [9] "bic"