% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/glmnetFlex.R
\name{weighted_mean_sd}
\alias{weighted_mean_sd}
\title{Helper function to compute weighted mean and standard deviation}
\usage{
weighted_mean_sd(x, weights = rep(1, nrow(x)))
}
\arguments{
\item{x}{Observation matrix.}

\item{weights}{Optional weight vector.}
}
\value{
A list with components.
\item{mean}{vector of weighted means of columns of x}
\item{sd}{vector of weighted standard deviations of columns of x}
}
\description{
Helper function to compute weighted mean and standard deviation.
Deals gracefully whether x is sparse matrix or not.
}
