% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/feature_pos.R
\name{assess_pos_compare}
\alias{assess_pos_compare}
\title{Compare PLS-POS Solutions Across K Values}
\usage{
assess_pos_compare(
  seminr_model,
  K_range = 2:5,
  nstart = 10,
  max_iter = 100,
  search_depth = NULL,
  min_segment_size = NULL,
  seed = 123
)
}
\arguments{
\item{seminr_model}{An estimated SEMinR model from \code{estimate_pls()}.}

\item{K_range}{Integer vector of K values to compare (default \code{2:5}).}

\item{nstart}{Number of random starting partitions (default 10). The best
solution (highest objective) is returned.}

\item{max_iter}{Maximum hill-climbing iterations per start (default 100).}

\item{search_depth}{Maximum number of candidates to evaluate per iteration
before accepting the first improvement (default = N, the sample size).
Use a smaller value for faster but potentially less optimal results.}

\item{min_segment_size}{Minimum observations per segment. Default is
\code{max(10, max_predictors + 2)} where max_predictors is the largest
number of predictors for any endogenous construct.}

\item{seed}{Random seed for reproducibility.}
}
\value{
An S3 object of class \code{"pos_comparison"} with components:
  \describe{
    \item{solutions}{Named list of \code{pos_analysis} objects}
    \item{fit_table}{Data frame comparing K values}
    \item{K_range}{The K values compared}
  }
}
\description{
Runs \code{\link{assess_pos}} for each K in \code{K_range} and returns a
comparison table of objective criterion (sum of R-squared) values. This
helps identify the optimal number of segments.
}
\examples{
\donttest{
library(seminr)

mobi_mm <- constructs(
  composite("Image",        multi_items("IMAG", 1:5)),
  composite("Expectation",  multi_items("CUEX", 1:3)),
  composite("Satisfaction", multi_items("CUSA", 1:3)),
  composite("Loyalty",      multi_items("CUSL", 1:3))
)
mobi_sm <- relationships(
  paths(from = "Image",       to = c("Expectation", "Satisfaction", "Loyalty")),
  paths(from = "Expectation", to = "Satisfaction"),
  paths(from = "Satisfaction", to = "Loyalty")
)
pls_model <- estimate_pls(data = mobi, measurement_model = mobi_mm,
                           structural_model = mobi_sm)

pos_comp <- assess_pos_compare(pls_model, K_range = 2:3,
                                nstart = 2, max_iter = 10, seed = 123)
print(pos_comp)
plot(pos_comp)
}

}
\seealso{
[assess_fimix_compare()] for comparing FIMIX solutions across K
}
