Learn R Programming

ShapeSelectForest (version 1.2)

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

shapenum
the shapenum argument
pre.rate
annual rate of decline prior to the primary change point
pre.rate2
annual rate of decline prior to the secondary change point
dist.yr
year of the primary change points
dist2.yr
year of the secondary change points
dist.mag
difference in predicted values before and after primary change events
dist2.mag
difference in predicted values before and after secondary change events
dist.mag2
difference in predicted values before and after primary change points scaled by starting value
dist2.mag2
difference in predicted values before and after secondary change points scaled by starting value
dist.dur
duration of the change event before resuming a downward turn
dist2.dur
duration of the change event before resuming a downward turn
post.rate
annual rate of decline after the end of the primary change event
post2.rate
annual rate of decline after the end of the secondary change event
my.ic
information 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
## Not run: 
# 	# 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)		
# ## End(Not run)

Run the code above in your browser using DataLab