% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/runELA.R
\name{ELPruning}
\alias{ELPruning}
\title{ELPruning}
\usage{
ELPruning(
  ela,
  type = "relative",
  th = 0.05,
  lower_qr = 0.05,
  bootstrap_ene = NULL,
  threads = 1,
  reporting = TRUE,
  fork = TRUE
)
}
\arguments{
\item{ela}{output of ELA function.}

\item{type}{the type of pruning \code{"relative"}(use with \code{th}) or \code{"bootstrap"} (use with \code{lower_qr} and \code{bootstrap_ene})}

\item{th}{ratio of the depth of the basin to be pruned with respect to the deepest basin.}

\item{lower_qr}{Numeric value. Quantile used for constructing confidence intervals from bootstrap samples to check 
whether the estimated energy gaps include zero. Default is \code{lower_qr = 0.05}.}

\item{bootstrap_ene}{a data frame of bootstrap energies generated by \link{bootstrap_ELA}. Necessary when \code{type="quantile"}.}

\item{threads}{number of cores (threads) used for calculation.}

\item{reporting}{enable/disable the reporting function.}

\item{fork}{logical; if TRUE and \code{threads > 1}, a cluster is created internally for parallel execution.}
}
\value{
A list of two elements: (1) pruned ELA tuple (same format as \link{ELA} output),
  and (2) a data frame with columns \code{ss.before.pruning} and \code{ss.after.pruning}.
}
\description{
Pruning shallow stable states of energy landscape.

Iteratively prunes stable states (merges basins). 
If \code{type="relative"},  stable state whose energy depth is smaller than \code{th} times the deepest
basin depth are pruned and merged to the deeper basins. 
If \code{type="bootstrap"}, stable state whose bootstrap confidence interval (default: 95% quantile) of energy gap between tipping point
cross zero is pruned. 
The function updates stable states and corresponding tipping
structures, and returns both the pruned ELA object and a mapping table
from stable states before pruning to those after pruning.
}
