Learn R Programming

ShapeSelectForest (version 1.1)

shapeparams: Shape Parameters

Description

Given the output from the shape function (including the chosen shape, chosen information criteria value ic, vector of fitted values thetab, and corresponding $\bold{x}$, e.g., years), this routine calculates a set of parameters that describe the behavior of the fitted trajectory.

Usage

shapeparams(shapenum, ic, thetab, x)

Arguments

shapenum
A number with the index $1$ to $7$.
ic
A $k$ by $N$ matrix where the $i$th column is the vector of "BIC" or "CIC" values used to choose the best shape for the $i$th scatterplot. $k$ is the number of shapes allowed by the user.
thetab
A $n$ by $N$ matrix where the $i$th column is the vector of predicted values for the chosen shape for the $i$th scatterplot.
x
A $n$ by $1$ predictor vector, e.g., years.

Value

  • shapenumthe shapenum argument
  • pre.rateannual rate of decline prior to the primary change point
  • pre.rate2annual rate of decline prior to the secondary change point
  • dist.yryear of the primary change points
  • dist2.yryear of the secondary change points
  • dist.magdifference in predicted values before and after primary change events
  • dist2.magdifference in predicted values before and after secondary change events
  • dist.mag2difference in predicted values before and after primary change points scaled by starting value
  • dist2.mag2difference in predicted values before and after secondary change points scaled by starting value
  • dist.durduration of the change event before resuming a downward turn
  • dist2.durduration of the change event before resuming a downward turn
  • post.rateannual rate of decline after the end of the primary change event
  • post2.rateannual rate of decline after the end of the secondary change event
  • my.icinformation criteria value for the chosen shape

References

Moisen, G.G., M. Meyer, T.A. Schroeder, C. Toney, X. Liao, E.A. Freeman, K. Schleeweis. Shape-selection in Landsat time series: A tool for monitoring forest dynamics (In Review). Global Change Biology.

See Also

shape

Examples

Run this code
# 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