| k {analogue} | R Documentation |
An extractor function to access the number of analogues used in particular models. Can also be used to set or update the stored value of k.
k(object, ...) ## S3 method for class 'mat': k(object, weighted=FALSE, ...) ## S3 method for class 'bootstrap': k(object, ...) k(object, weighted=FALSE) <- value ## S3 method for class 'mat': k(object, weighted=FALSE) <- value
object |
an R object; currently only for objects of class
mat and class bootstrap. |
weighted |
logical; extract/set number of analogues for a weighted or un-weighted model? |
... |
further arguments to other methods. |
value |
integer; replacement value for k. |
k is a generic accessor function, and k<- is a generic
replacement function.
For k, an integer value that is the number of analogues stored
for use. The returned object has attributes “auto” and
“weighted”. “auto” refers to whether the extracted value
of k was set automatically (TRUE) or by the user
(FALSE). “weighted” states if the returned value is for
a weighted analysis or an un-weighted analysis (FALSE).
For k<-, the updated object.
Gavin L. Simpson
## continue the example from join example(join) ## fit a MAT model swap.mat <- mat(swapdiat, swappH, method = "SQchord") ## How many analogues gives lowest RMSE? k(swap.mat) ## note that this value was chosen automatically ## Now set k to be 10 k(swap.mat) <- 10 ## check k(swap.mat)