Subsetting method for mmkin objects

# S3 method for mmkin
[(x, i, j, ..., drop = FALSE)

Arguments

x

An mmkin object

i

Row index selecting the fits for specific models

j

Column index selecting the fits to specific datasets

...

Not used, only there to satisfy the generic method definition

drop

If FALSE, the method always returns an mmkin object, otherwise either a list of mkinfit objects or a single mkinfit object.

Value

An object of class mmkin.

Author

Johannes Ranke

Examples


  # Only use one core, to pass R CMD check --as-cran
  fits <- mmkin(c("SFO", "FOMC"), list(B = FOCUS_2006_B, C = FOCUS_2006_C),
                cores = 1, quiet = TRUE)
  fits["FOMC", ]
#> <mmkin> object
#> Status of individual fits:
#> 
#>       dataset
#> model  B  C 
#>   FOMC OK OK
#> 
#> OK: No warnings
  fits[, "B"]
#> <mmkin> object
#> Status of individual fits:
#> 
#>       dataset
#> model  B 
#>   SFO  OK
#>   FOMC OK
#> 
#> OK: No warnings
  fits["SFO", "B"]
#> <mmkin> object
#> Status of individual fits:
#> 
#>      dataset
#> model B 
#>   SFO OK
#> 
#> OK: No warnings

  head(
    # This extracts an mkinfit object with lots of components
    fits[["FOMC", "B"]]
  )
#> $par
#>  parent_0 log_alpha  log_beta     sigma 
#> 99.666192  2.549850  5.050586  1.890202 
#> 
#> $objective
#> [1] 28.58291
#> 
#> $convergence
#> [1] 0
#> 
#> $iterations
#> [1] 21
#> 
#> $evaluations
#> function gradient 
#>       25       78 
#> 
#> $message
#> [1] "both X-convergence and relative convergence (5)"
#>