summary: Summarizes Fit Information for bigsplines Model

Description Usage Arguments Details Value Note Author(s) Examples

Description

This function summarizes basic model fit information for a fit bigsplines model.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## 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 bigspline), class "bigssa" (output from bigssa), class "bigssg" (output from bigssg), class "bigssp" (output from bigssp), or class "bigtps" (output from bigtps).

fitresid

Logical indicating whether the fitted values and residuals should be calculated for all data points in input object.

chunksize

If fitresid=TRUE, fitted values are calculated in chunks of size chunksize.

diagnostics

If diagnostics=TRUE, cosine diagnostics are calculated for each term in the model. These give an approximate break-down of the model R-squared into that accounted for by each term in the model.

...

Ignored.

Details

See bigspline, bigssa, bigssg, bigssp, and bigtps for more details.

Value

call

Called model in input formula.

type

Type of smoothing spline that was used for each predictor.

fitted.values

Vector of fitted values (if fitresid=TRUE).

linear.predictors

Vector of linear predictors (only for class "bigssg" with fitresid=TRUE).

residuals

Vector of residuals (if fitresid=TRUE). For class "bigssg" these are deviance residuals.

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: converged=TRUE if the iterative theta update converged, converged=FALSE if the iterative theta update failed to converge, and converged=NA if option skip.iter=TRUE was used.

iter

Number of iterative updates (iter=NA if option skip.iter=TRUE was used).

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

 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
##########   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)

bigsplines documentation built on May 2, 2019, 9:27 a.m.