if (FALSE) {
# import the matrix of Landsat signals
data("ymat")
# define the predictor vector: the year 1985 to the year 2010
x <- 1985:2010
# call the shape routine allowing a double-jump shape using "CIC"
ans <- shape(x, ymat, "CIC")
# Example 1: parameters for a flat shape
flat_id <- which(ans$shape == 1)
i <- flat_id[1]
ans_flat <- shapeparams(ans$shape[i], ans$ic[, i], ans$thetab[, i], x)
# Example 2: parameters for a one-jump shape
jp_id <- which(ans$shape == 3)
i <- jp_id[1]
ans_jp <- shapeparams(ans$shape[i], ans$ic[, i], ans$thetab[, i], x)
# Example 3: parameters for a double-jump shape
db_id <- which(ans$shape == 7)
i <- db_id[1]
ans_db <- shapeparams(ans$shape[i], ans$ic[, i], ans$thetab[, i], x)
}
Run the code above in your browser using DataLab