Segmented function in R?

Could someone please explain what psi and npsi are?

segmented(obj, seg.Z, psi, npsi, fixed.psi=NULL, control = seg.control(),
model = TRUE, keep.class=FALSE, ...)

If obj is the linear model seg.z is ~X what is psi and npsi?

Also, if we only include: obj, seg.z and npsi. Would that be sufficient to estimate the breakpoints?

Topic rstudio linear-regression time-series r

Category Data Science


Have you looked at the documentation of the function? psi and npsi seem to indicate the breakpoints and the number of breakpoints respectively. According to the documentation the psi argument can only be left empty when "1 breakpoint has to be estimated (and the median of the segmented variable is used as a starting value)". So if that's the case for what you're trying to achieve only providing npsi is sufficient, otherwise it is not.

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.