Description Usage Arguments Details Value See Also Examples

View source: R/CI.prediction.R

Compute Confidence Intervals (CI) for test samples based on random subsamplings

1 2 | ```
CI.prediction(object,X,Y,signature,ncomp,many,
subsampling.matrix,ratio,X.test,level.CI,save.file)
``` |

`object` |
a ‘spls.constraint’ object, as one resulting from |

`X` |
Only used if |

`Y` |
Only used if |

`signature` |
Only used if |

`ncomp` |
Only used if |

`many` |
How many subsamplings do you want to do? Default is 100 |

`subsampling.matrix` |
Optional matrix of |

`ratio` |
Number between 0 and 1. It is the proportion of the n samples that are put aside and considered as an internal testing set. The (1-ratio)*n samples are used as a training set and the |

`X.test` |
Test matrix. |

`level.CI` |
A 1- |

`save.file` |
Save the outputs of the functions in |

This function can work with a ‘spls.constraint’ object or with the input data (X, Y, signature). See examples below to see the difference in use.

`CI` |
A (1- |

`Y.hat.test` |
A four dimensional array. The two first dimensions are an estimation of the dummy matrix obtained from Y (size n * number of sample types). The third dimension is relative to the number of components |

`ClassifResult` |
A 5-dimensional array. The two first dimensions consists in the confusion matrix. The third dimension is relative to the number of components |

`loadings.X` |
A 3-dimensional array. Loadings vector of X, for each component and each subsampling. |

`prediction.X` |
A 4-dimensional array of size n*many*ncomp*3. Gives the prediction for the chosen |

`prediction.X.test` |
A 4-dimensional array of size nrow(X.test)*many*ncomp*3. Gives the prediction for the chosen |

`learning.sample` |
Matrix of size n*many. Gives the samples that have been used in the internal training set over the |

`coeff` |
A list of means.X, sigma.X, means.Y and sigma.Y. Means and variances for the variables of X and the columns of the dummy matrix obtained from Y, each row is a subsampling. |

`data` |
A list of the input data X, Y and of signature, which is a list containing the variables kept on each component. |

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | ```
## Not run:
data(MSC)
X=MSC$X
Y=MSC$Y
# with a bootsPLS object
boot=bootsPLS(X=X,Y=Y,ncomp=3,many=5,kCV=5)
fit=fit.model(boot,ncomp=3)
CI=CI.prediction(fit)
CI=CI.prediction(fit,X.test=X)
plot(CI)
lapply(CI$CI$'comp.1',head)
lapply(CI$CI$'comp.2',head)
lapply(CI$CI$'comp.3',head)
# without a spls.constraint object. X,Y and signature are needed
# the results should be similar
#(not the same because of the random subsamplings,
# exactly the same if subsampling.matrix is an input)
signature=fit$data$signature
CI=CI.prediction(X=X,Y=Y,signature=signature)
CI=CI.prediction(X=X,Y=Y,signature=signature,X.test=X)
lapply(CI$CI$'comp.1',head)
lapply(CI$CI$'comp.2',head)
lapply(CI$CI$'comp.3',head)
## End(Not run)
``` |

bootsPLS documentation built on Dec. 18, 2017, 9:02 a.m.

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.