% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/pglm.R
\name{pglm}
\alias{pglm}
\alias{pglm.fit}
\title{Profile Boosting for Generalized Linear Models.}
\usage{
pglm(
  formula,
  family = gaussian,
  data,
  weights,
  subset,
  na.action,
  start = NULL,
  etastart,
  mustart,
  offset,
  control = list(...),
  model = TRUE,
  method = "glm.fit",
  x = FALSE,
  y = TRUE,
  singular.ok = TRUE,
  contrasts = NULL,
  ...,
  stopFun = "EBIC",
  keep = NULL,
  maxK = NULL,
  verbose = FALSE
)

pglm.fit(
  x,
  y,
  weights = rep.int(1, NROW(y)),
  start = NULL,
  etastart = NULL,
  mustart = NULL,
  offset = rep.int(0, NROW(y)),
  family = gaussian(),
  control = list(),
  intercept = TRUE,
  singular.ok = TRUE,
  stopFun = "EBIC",
  keep = NULL,
  maxK = NULL,
  verbose = FALSE
)
}
\arguments{
\item{formula}{Parameter passed to \link{glm}.}

\item{family}{Parameter passed to \link{glm}.}

\item{data}{Parameter passed to \link{glm}.}

\item{weights}{Parameter passed to \link{glm}.}

\item{subset}{Parameter passed to \link{glm}.}

\item{na.action}{Parameter passed to \link{glm}.}

\item{start}{Parameter passed to \link{glm}.}

\item{etastart}{Parameter passed to \link{glm}.}

\item{mustart}{Parameter passed to \link{glm}.}

\item{offset}{Parameter passed to \link{glm}.}

\item{control}{Parameter passed to \link{glm}.}

\item{model}{Parameter passed to \link{glm}.}

\item{method}{Parameter passed to \link{glm}.}

\item{x}{Parameter passed to \link{glm}.}

\item{y}{Parameter passed to \link{glm}.}

\item{singular.ok}{Parameter passed to \link{glm}.}

\item{contrasts}{Parameter passed to \link{glm}.}

\item{...}{Parameters passed to \link{glm}.}

\item{stopFun}{Parameter passed to \link{pboost}.}

\item{keep}{Parameter passed to \link{pboost}.}

\item{maxK}{Parameter passed to \link{pboost}.}

\item{verbose}{Parameter passed to \link{pboost}.}

\item{intercept}{Parameter passed to \link{glm.fit}.}
}
\value{
A \code{glm} model object fitted on the selected features.
}
\description{
\link{pglm} inherits the usage of the built-in function \link{glm}.
}
\examples{
set.seed(2026)
n <- 200
p <- 100
x <- matrix(rnorm(n*p), n)

eta <- drop( x[, 1:3] \%*\% runif(3, 1.0, 1.5) )
y <- rbinom(n, 1, 1/(1+exp(-eta)))
DF <- data.frame(y, x)

## ---------- pboost ----------
pglm(y ~ ., "binomial", DF, verbose=TRUE)
pglm(y ~ ., "binomial", DF, stopFun=BIC, verbose=TRUE)

scoreLogistic <- function(object) {
   eta.hat <- object[["linear.predictors"]]
   return(object[["y"]] - 1/(1+exp(-eta.hat)))
}
(result <- pboost(y, x, glm, scoreLogistic, family="binomial", verbose=TRUE))
all.vars(formula(result)[[3]])

## ---------- frs ----------
fglm(y ~ ., "binomial", DF, verbose=TRUE)
fglm(y ~ ., "binomial", DF, stopFun=BIC, verbose=TRUE)

frs(y, x, glm, family="binomial", verbose=TRUE)

}
\references{
Zengchao Xu, Shan Luo and Zehua Chen (2022). Partial profile score feature selection
in high-dimensional generalized linear interaction models. Statistics and Its Interface.
\doi{10.4310/21-SII706}
}
