% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/DGP_X.R
\name{DGP_X_Gaussian}
\alias{DGP_X_Gaussian}
\title{Data Generating Process with a Gaussian Covariate}
\usage{
DGP_X_Gaussian(n, p, beta, Sigma, m, s)
}
\arguments{
\item{n}{Integer. Total sample size.}

\item{p}{Numeric. Probability of being assigned to the treatment group \eqn{(Z=1)}.}

\item{beta}{Numeric vector. Coefficients for the linear function of the covariate \eqn{X}.}

\item{Sigma}{Matrix. Covariance matrix for the potential outcomes.}

\item{m}{Numeric. Mean of the Gaussian covariate \eqn{X}.}

\item{s}{Numeric. Standard deviation of the Gaussian covariate \eqn{X}.}
}
\value{
A list containing:
\itemize{
 \item \code{X}: The Gaussian covariate vector.
 \item \code{Z}: Treatment assignment vector.
 \item \code{n1}: Number of treated units.
 \item \code{n0}: Number of control units.
 \item \code{P}: Full matrix of potential outcomes.
 \item \code{P_observed}: Observed outcomes \eqn{(Y, S)} corresponding to the assigned treatment \eqn{Z}.
 \item \code{P_unobserved}: Counterfactual outcomes under the opposite treatment.
}
This function is useful for generating synthetic data to test or explore
the method, for instance to verify the behavior of \code{BSET_X} under
known simulation settings.
}
\description{
This function generates potential outcomes from a data generating process
similar to the one described in \insertCite{parast2024rank;textual}{BSET}, but with the addition
of a Gaussian covariate X. It creates a dataset of potential outcomes
\deqn{P = (Y_1, S_1, Y_0, S_0)} and observed outcomes
\deqn{P_{observed} = (Y, S)} based on a random treatment assignment \eqn{Z}.
}
\details{
The potential outcomes are generated from a multivariate normal
distribution with mean vector and covariance matrix that depend on the
value of \eqn{X}. Specifically, the mean vector is a linear function of \eqn{X}:
\deqn{\mu(X) = x \cdot (\beta_{Y1}, \beta_{S1}, \beta_{Y0}, \beta_{S0})^T,}
and the covariance matrix is constant across values of \eqn{X}:
\deqn{\Sigma(X) = \Sigma.}
}
\examples{
set.seed(123)
data <- DGP_X_Gaussian(
  n = 100,
  p = 0.5,
  beta = c(1, 7, 0, 6),
  Sigma = 0.5 * diag(4),
  m = 3,
  s = 1
)
}
\references{
\insertRef{carlotti2026bayesian}{BSET}
}
