% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/svgd.R
\name{SVGD}
\alias{SVGD}
\title{Stein Variational Gradient Descent (SVGD)}
\description{
R6 class for Bayesian inference using Stein Variational Gradient Descent.
Wraps the Python SVGD implementation for phase-type distributions.
}
\section{Methods}{
\subsection{Public methods}{
\itemize{
\item \href{#method-SVGD-new}{\code{SVGD$new()}}
\item \href{#method-SVGD-optimize}{\code{SVGD$optimize()}}
\item \href{#method-SVGD-get_particles}{\code{SVGD$get_particles()}}
\item \href{#method-SVGD-clone}{\code{SVGD$clone()}}
}
}
\if{html}{\out{<hr>}}
\if{html}{\out{<a id="method-SVGD-new"></a>}}
\if{latex}{\out{\hypertarget{method-SVGD-new}{}}}
\subsection{Method \code{new()}}{
Create a new SVGD object
\subsection{Usage}{
\if{html}{\out{<div class="r">}}\preformatted{SVGD$new(
  model,
  observed_data,
  theta_dim,
  n_particles = 100L,
  n_iterations = 1000L,
  learning_rate = 0.01,
  rewards = NULL,
  ...
)}\if{html}{\out{</div>}}
}

\subsection{Arguments}{
\if{html}{\out{<div class="arguments">}}
\describe{
\item{\code{model}}{Model function (from trace_to_log_likelihood or Graph$pmf_from_graph)}

\item{\code{observed_data}}{Numeric vector or matrix of observed data}

\item{\code{theta_dim}}{Integer dimension of parameter space}

\item{\code{n_particles}}{Integer number of particles (default 100)}

\item{\code{n_iterations}}{Integer number of iterations (default 1000)}

\item{\code{learning_rate}}{Numeric learning rate (default 0.01)}

\item{\code{rewards}}{Optional numeric vector or matrix of rewards}

\item{\code{...}}{Additional arguments passed to Python SVGD}
}
\if{html}{\out{</div>}}
}
\subsection{Returns}{
A new SVGD object
}
}
\if{html}{\out{<hr>}}
\if{html}{\out{<a id="method-SVGD-optimize"></a>}}
\if{latex}{\out{\hypertarget{method-SVGD-optimize}{}}}
\subsection{Method \code{optimize()}}{
Run SVGD optimization
\subsection{Usage}{
\if{html}{\out{<div class="r">}}\preformatted{SVGD$optimize()}\if{html}{\out{</div>}}
}

\subsection{Returns}{
List with theta_mean, theta_std, particles, and convergence info
}
}
\if{html}{\out{<hr>}}
\if{html}{\out{<a id="method-SVGD-get_particles"></a>}}
\if{latex}{\out{\hypertarget{method-SVGD-get_particles}{}}}
\subsection{Method \code{get_particles()}}{
Get current particles
\subsection{Usage}{
\if{html}{\out{<div class="r">}}\preformatted{SVGD$get_particles()}\if{html}{\out{</div>}}
}

\subsection{Returns}{
Matrix of particle positions (n_particles x theta_dim)
}
}
\if{html}{\out{<hr>}}
\if{html}{\out{<a id="method-SVGD-clone"></a>}}
\if{latex}{\out{\hypertarget{method-SVGD-clone}{}}}
\subsection{Method \code{clone()}}{
The objects of this class are cloneable with this method.
\subsection{Usage}{
\if{html}{\out{<div class="r">}}\preformatted{SVGD$clone(deep = FALSE)}\if{html}{\out{</div>}}
}

\subsection{Arguments}{
\if{html}{\out{<div class="arguments">}}
\describe{
\item{\code{deep}}{Whether to make a deep clone.}
}
\if{html}{\out{</div>}}
}
}
}
