Learn R Programming

scam (version 1.2-21)

vcov.scam: Parameter estimator covariance matrix from SCAM fit

Description

Extracts, from a fitted scam object, either the Bayesian posterior covariance matrix of the transformed parameters (a mix of exponentiated and un-exponentiated parameters) or the frequentist covariance matrix of the parameter estimators.

Usage

# S3 method for scam
vcov(object, freq = FALSE, untransformed=FALSE, ...)

Value

A matrix corresponding to the estimated posterior covariance matrix of the (un)transformed model parameter estimators/coefficients, or the estimated frequentist covariance matrix of the parameters, depending on the arguments freq and unstransformed.

Arguments

object

fitted model object of class scam as produced by scam().

freq

TRUE to return the frequentist covariance matrix of the (transformed or untransformed) parameter estimators, FALSE to return the Bayesian posterior covariance matrix of the parameters.

untransformed

if TRUE then the covariance matrix of the untransformed parameters is returned.

...

other arguments, currently ignored.

Author

Natalya Pya <nat.pya@gmail.com>

Details

Extracts, from a fitted scam object, the Bayesian posterior covariance matrix of the transformed parameters (default; object$Vp.t), the frequentist covariance matrix of the transformed parameters (object$Ve.t), or the covariance matrix of the untransformed parameters (object$Vp for Bayesian and object$Ve for frequentist inference).

References

Wood, S.N. (2017) Generalized Additive Models: An Introductio with R (2nd ed) CRC Press

Pya, N. and Wood, S.N. (2015) Shape constrained additive models. Statistics and Computing, 25(3), 543-559

See Also

scam

Examples

Run this code
require(scam)
set.seed(2)
n <- 200
x <- runif(n)*4-1;
y <- exp(4*x)/(1+exp(4*x)) +rnorm(n)*.2
m <- scam(y~s(x,bs="mpi"))
diag(vcov(m))

Run the code above in your browser using DataLab