Learn R Programming

cpop (version 1.0.8)

cpop.crops.models: Extract the cpop models created by cpop.crops

Description

Obtains a list of models corresponding to each of the beta (penalty) values considered during a cpop.crops analysis.

Usage

cpop.crops.models(object)

Value

A list of S4 cpop.class objects corresponding to the beta values considered by a cpop.crops analysis.

Arguments

object

An S4 object of type cpop.crops.class produced by cpop.crops.

References

crops-articlecpop

crops-packagecpop

cpop-jss-article-2024cpop

See Also

cpop.crops,crops

Examples

Run this code
# \donttest{
library(cpop)

set.seed(1)
n <- 500
x <- 1:n
m <- 10
mu <- simchangeslope(x,changepoints=(n/(m+1))*0:m,change.slope=c(0.1,0.2*(-1)^(1:m)),sd=0)
epsilon <- rnorm(n+2)
y <- mu+(epsilon[1:n]+epsilon[2:(n+1)]+epsilon[3:(n+2)])/sqrt(3)
res.crops <- cpop.crops(y,x,beta_min=0.5*log(length(y)),beta_max=40*log(length(y)))
models <- cpop.crops.models(res.crops)
for(m in models)
{
  plot(m)
}
# }

Run the code above in your browser using DataLab