% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/PersistenceLandscape.R
\name{persistence_landscape}
\alias{persistence_landscape}
\title{Compute the persistence landscape of a persistence diagram}
\usage{
persistence_landscape(
  df,
  dimension = 0,
  k_max = NULL,
  resolution = 500,
  t_range = NULL
)
}
\arguments{
\item{df}{A persistence diagram data frame with columns \code{dim},
\code{birth}, \code{death} (e.g. the output of
\code{extract_persistence_pairs()}).}

\item{dimension}{Homological dimension to extract the landscape for.}

\item{k_max}{Number of landscape levels \eqn{\lambda(1,\cdot), \dots,
\lambda(k_{max},\cdot)} to return. Defaults to all levels supported by
the diagram (the number of finite birth-death pairs in \code{dimension});
levels beyond that are identically zero.}

\item{resolution}{Number of grid points used to discretize each landscape
function.}

\item{t_range}{Optional \code{c(t_min, t_max)} grid range. Defaults to
\code{c(min(birth), max(death))} over the selected pairs.}
}
\value{
A data frame with columns \code{t}, \code{k}, \code{value}: the
  discretized landscape functions, one row per (grid point, level) pair.
}
\description{
Converts a persistence diagram data frame (the direct output of
\code{extract_persistence_pairs()}, \code{persistence_pairs()}, or
\code{flood_persistence()}) into its persistence landscape: a collection of
continuous, piecewise-linear functions \eqn{\lambda(k, \cdot)}, obtained by
overlaying the "tent" function of every birth-death pair and, at each time
\code{t}, taking the \eqn{k}th largest tent value (Bubenik, 2015; Chazal
and Michel, 2021, Section 5.4).
}
\examples{
points <- matrix(c(0, 1, 1, 0, 0, 0, 1, 1), ncol = 2)
filtration <- build_filtration(points, method = "VR", eps_max = 1.2)
res <- boundary_info(filtration)
pairs <- extract_persistence_pairs(filtration, res$last_1, res$pivot_owner)
landscape <- persistence_landscape(pairs, dimension = 0)
}
