summary {bigsplines} | R Documentation |
Summarizes Fit Information for bigsplines Model
Description
This function summarizes basic model fit information for a fit bigsplines
model.
Usage
## S3 method for class 'bigspline'
summary(object, fitresid = TRUE, chunksize = 10000, ...)
## S3 method for class 'bigssa'
summary(object, fitresid = TRUE, chunksize = 10000, diagnostics = FALSE,...)
## S3 method for class 'bigssg'
summary(object, fitresid = TRUE, chunksize = 10000, diagnostics = FALSE,...)
## S3 method for class 'bigssp'
summary(object, fitresid = TRUE, chunksize = 10000, diagnostics = FALSE,...)
## S3 method for class 'bigtps'
summary(object, fitresid = TRUE, chunksize = 10000, ...)
Arguments
object |
Object of class "bigspline" (output from |
fitresid |
Logical indicating whether the fitted values and residuals should be calculated for all data points in input |
chunksize |
If |
diagnostics |
If |
... |
Ignored. |
Details
See bigspline
, bigssa
, bigssg
, bigssp
, and bigtps
for more details.
Value
call |
Called model in input |
type |
Type of smoothing spline that was used for each predictor. |
fitted.values |
Vector of fitted values (if |
linear.predictors |
Vector of linear predictors (only for class "bigssg" with |
residuals |
Vector of residuals (if |
sigma |
Estimated error standard deviation. |
deviance |
Model deviance (only for class "bigssg"). |
dispersion |
Estimated dispersion parameter (only for class "bigssg"). |
n |
Total sample size. |
df |
Effective degrees of freedom of the model. |
info |
Model fit information: vector containing the GCV, multiple R-squared, AIC, and BIC of fit model. |
converged |
Convergence status: |
iter |
Number of iterative updates ( |
rparm |
Rounding parameters used for model fitting. |
lambda |
Global smoothing parameter used for model fitting. |
gammas |
Vector of additional smoothing parameters (only for class "bigssa"). |
thetas |
Vector of additional smoothing parameters (only for class "bigssp"). |
pi |
Vector of cosine diagnostics. |
family |
Distribution family (only for class "bigssg"). |
gcvtype |
Smoothing parameter selection criterion (only for class "bigssg"). |
Note
For "bigspline" and "bigtps" objects, the outputs call
, converged
, and iter
are NA.
Author(s)
Nathaniel E. Helwig <helwig@umn.edu>
Examples
########## EXAMPLE 1 ##########
# define relatively smooth function
set.seed(773)
myfun <- function(x){ sin(2*pi*x) }
x <- runif(10^4)
y <- myfun(x) + rnorm(10^4)
# cubic spline
cubmod <- bigspline(x,y)
summary(cubmod)
########## EXAMPLE 2 ##########
# function with two continuous predictors
set.seed(773)
myfun <- function(x1v,x2v){
sin(2*pi*x1v) + log(x2v+.1) + cos(pi*(x1v-x2v))
}
x1v <- runif(10^4)
x2v <- runif(10^4)
y <- myfun(x1v,x2v) + rnorm(10^4)
# cubic splines with 100 randomly selected knots (efficient parameterization)
cubmod <- bigssa(y~x1v*x2v,type=list(x1v="cub",x2v="cub"),nknots=100)
summary(cubmod)
########## EXAMPLE 3 ##########
# function with two continuous predictors
set.seed(1)
myfun <- function(x1v,x2v){
sin(2*pi*x1v) + log(x2v+.1) + cos(pi*(x1v-x2v))
}
ndpts <- 1000
x1v <- runif(ndpts)
x2v <- runif(ndpts)
# poisson response
set.seed(773)
lp <- myfun(x1v,x2v)
mu <- exp(lp)
y <- rpois(n=ndpts,lambda=mu)
# generalized smoothing spline anova
genmod <- bigssg(y~x1v*x2v,family="poisson",type=list(x1v="cub",x2v="cub"),nknots=50)
summary(genmod)
########## EXAMPLE 4 ##########
# function with two continuous predictors
set.seed(773)
myfun <- function(x1v,x2v){
sin(2*pi*x1v) + log(x2v+.1) + cos(pi*(x1v-x2v))
}
x1v <- runif(10^4)
x2v <- runif(10^4)
y <- myfun(x1v,x2v) + rnorm(10^4)
# cubic splines with 100 randomly selected knots (classic parameterization)
cubmod <- bigssp(y~x1v*x2v,type=list(x1v="cub",x2v="cub"),nknots=100)
summary(cubmod)
########## EXAMPLE 5 ##########
# define relatively smooth function
set.seed(773)
myfun <- function(x){ sin(2*pi*x) }
x <- runif(10^4)
y <- myfun(x) + rnorm(10^4)
# thin-plate with default (30 knots)
tpsmod <- bigtps(x,y)
summary(tpsmod)