% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/methods.R
\name{coef.lgspline}
\alias{coef.lgspline}
\title{Extract Coefficients from a Fitted lgspline}
\usage{
\method{coef}{lgspline}(object, ...)
}
\arguments{
\item{object}{A fitted lgspline model object.}

\item{...}{Not used.}
}
\value{
A list of per-partition coefficient vectors. Returns NULL with a
  warning if \code{object$B} is not found.
}
\description{
Returns the per-partition polynomial coefficient lists from a fitted
lgspline model.
}
\details{
Coefficient names reflect the polynomial expansion terms, e.g.:
\itemize{
  \item intercept
  \item v: linear term for predictor v
  \item v_^2: quadratic term
  \item v^3: cubic term
  \item _v_x_w_: two-way interaction
}
Column/variable names replace numeric indices when available.

To get all coefficients as a single matrix:
\code{Reduce('cbind', coef(model_fit))}.
}
\examples{

set.seed(1234)
t <- runif(1000, -10, 10)
y <- 2*sin(t) + -0.06*t^2 + rnorm(length(t))
model_fit <- lgspline(t, y)

coefficients <- coef(model_fit)
print(coefficients[[1]])
print(Reduce('cbind', coefficients))

}
\seealso{
\code{\link{lgspline}}
}
