% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/HelperFunctions.R
\name{take_derivative}
\alias{take_derivative}
\title{Calculate Derivatives of Polynomial Terms}
\usage{
take_derivative(dat, var, second = FALSE, scale)
}
\arguments{
\item{dat}{Numeric matrix; design matrix containing polynomial basis expansions}

\item{var}{Character; column name of variable to differentiate with respect to}

\item{second}{Logical; if TRUE compute second derivative, if FALSE compute first derivative (default FALSE)}

\item{scale}{Numeric; scaling factor for normalization}
}
\value{
Numeric matrix containing derivatives of polynomial terms, with same dimensions as input matrix
}
\description{
Computes first or second derivatives of polynomial terms in a design matrix with
respect to a specified variable. Handles polynomial terms up to fourth degree.
}
\keyword{internal}
