FactorSCGLR | R Documentation |
Function that fits the scglr model with factors
FactorSCGLR(
formula,
data,
family,
H = c(1, 1),
J = 1,
size = NULL,
offset = NULL,
crit = list(),
method = methodSR()
)
formula |
an object of class |
data |
a data frame to be modeled. |
family |
a vector of character of the same length as the number of dependent variables: "bernoulli", "binomial", "poisson" or "gaussian" is allowed. |
H |
a vector of integer representing the number of components per theme. |
J |
the number of factors |
size |
describes the number of trials for the binomial dependent variables. |
offset |
used for the poisson dependent variables. |
crit |
a list of two elements : maxit and tol, describing respectively the maximum number of iterations and the tolerance convergence criterion for the Expectation Maximization algorithm. Default is set to 50 and 10e-6 respectively. |
method |
structural relevance criterion. |
U |
the set of loading vectors |
comp |
the set of components |
eta |
the fitted linear predictor |
coef |
contains regression parameters: intercept, gamma and delta |
B |
the factors loading |
G |
the set of factors |
sigma2 |
the residual variances for gaussian responses |
offset |
the offset used for the poisson dependent variables |
Z |
the set of working variables |
Y |
the response matrix |
Theme |
the list of standardized explanatory themes |
A |
the supplementary explanatory variables |
W |
the matrix of GLM weights |
family |
the distributions |
# load sample data
data <- genus
# get variable names from dataset
n <- names(data)
ny <- n[grep("^gen",n)]
nx1 <- n[grep("^evi",n)]
nx2 <- n[grep("^pluvio",n)]
na <- c("geology", "altitude", "forest", "lon", "lat")
# build multivariate formula
form <- multivariateFormula(Y = ny, X = list(nx1, nx2), A = na)
# define family
fam <- rep("poisson", length(ny))
# run function
H <- c(2,2)
J <- 2
met <- methodSR(l=4, s=0.5)
res <- FactorSCGLR(formula=form, data=data, H=H, J=J,
family=fam, method=met, offset = data$surface)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.