PlotAdaptiveReg: Eigenvectors - R^2 plot

Description Usage Arguments Examples

View source: R/PlotAdaptiveReg.R

Description

This function produces a plot of the R^2 estimated by cross-validation as a function of the number of eigenvectors included in the fitting. The vertical red lines indicated the optimal R^2 and the corresponding number of eigenvectors.

Usage

1

Arguments

fit

An object containing a fitted model obtained by the AdaptiveReg function.

Examples

1
2
3
4
5
6
library(prospectr)
data(NIRsoil)
indNA = which(is.na(NIRsoil$Nt))
NIRNt = list(x=NIRsoil$spc[-indNA,],y=NIRsoil$Nt[-indNA])
fit = AdaptiveReg(NIRNt$x,NIRNt$y,nvmax=100)
PlotAdaptiveReg(fit)

fhebert/AdaptivePrediction documentation built on Nov. 4, 2019, 12:40 p.m.