Description Usage Arguments Details Value Note Author(s) References Examples

`HTest_cps`

calculates Horvitz–Thompson-like estimates of forest characteristics of interest in a specified circular area based on a collection of detected trees and their detection probabilities, or detectabilities. Also produces estimated variances and confidence intervals.

`detectability_cps`

calculates detectabilities of trees in a circular plot sample.

`visibility_thinning_cps`

takes a tree list and determines if the trees can be detected when a certain visibility-based detection condition is used.

`ordering_cps`

is a helper function for preprocessing of tree lists: it takes a tree list and orders the trees based on their distance to plot centre point.

`polar_to_cart`

and `cart_to_polar`

are internal functions for transforming polar coordinates to cartesian coordinates and vice versa.

`triangle_coords`

is an internal function that, given locations and diameters of discs, returns coordinates needed to define the areas behind the discs that are non-visible from the origin.

`shades`

is an internal function that forms polygonal approximations of the planar sets that are non-visible from the origin.

1 2 3 4 5 6 7 8 | ```
HTest_cps(data, total=TRUE, confidence.level=0.95)
detectability_cps(data, plot.radius, alpha=0, polar=TRUE, npoly=1024, delta=NULL)
visibility_thinning_cps(data, plot.radius, alpha=0, polar=TRUE, npoly=1024, delta=NULL)
ordering_cps(data, polar=TRUE)
polar_to_cart(X)
cart_to_polar(X)
triangle_coords(X, plot.radius, polar=TRUE)
shades(X, plot.radius, polar=TRUE)
``` |

`data` |
For |

`total` |
Do you want to estimate population totals (TRUE) or population means (FALSE)? |

`confidence.level` |
The level of the approximate confidence interval, a value between 0 and 1. For example, |

`plot.radius` |
Radius of the plot in which circular plot sampling has been performed. |

`alpha` |
A tuning parameter that controls the calculation of detection probabilities, or detectabilities. |

`polar` |
Are the locations of trees given in polar coordinates (TRUE) or cartesian coordinates (FALSE)? |

`npoly` |
Number of edges for the polygonal approximation of the plot boundary and the circles used to calculate the detection probabilities. Used if |

`delta` |
The tolerance of the polygonal approximation of of the plot boundary and the circles used to calculate the detection probabilities: the length of the arc that will be replaced by one edge of the polygon. If given value that is different from NULL tihs will override |

`X` |
For |

The function `HTest_cps`

produces estimates of forest characteristics of interest in a circular plot sampling situation. More specifically, it is assumed that an observer stands in a point and observes such trees that are within the fixed-area plot and are not hiding behind other trees. It is assumed that observer can record the locations and diameters of the trees that they observe. The observer can be a person or a piece of equipment, such as terrestrial laser scanner or camera.

The estimation is based on a Horvitz–Thompson-like estimator presented by Kansanen et al. (2019). This construction uses approximated detection probabilities, or detectabilities, that depend on the size and distance from the plot centre of the tree for which the probability is calculated, the nonvisible area produced by trees that are closer to the centre point, and a visibility based detection condition. It is assumed that the centre point of the sampling plot is the origin of the plane (0,0). The function `detectability_cps`

is used to calculate the detectabilities.

The confidence intervals that `HTest_cps`

produces are based on the t-distribution if less than 50 trees have been observed, and the standard normal distribution otherwise.

The parameter `alpha`

is a value between -1 and 1 and it controls the detection condition. alpha=1 means that trees are detected if the stems are fully visible to the observer, alpha=0 means that they are detected if the center point is visible, and alpha=-1 means that a tree is detected if any part of the stem is visible.

The estimation is not possible if the data contains trees that cover the plot centre point.

All of the variables related to distance and size, meaning the cartesian coordinates, the distance coordinate, `plot.radius`

, `delta`

, and tree diameters, should have the same unit, e.g. they should all be in metres.

The function `visibility_thinning_cps`

is useful for simulation-based testing of the estimator. Given a tree list, it classifies trees as either detected or not detected based on a visibility based detection condition.

The function `ordering_cps`

is a useful preprocessing step for tree lists over which estimation is needed. It reorders the rows of the tree list, corresponding to trees, based on the closest distance from the stem disc to the plot centre point. `detectability_cps`

and `visibility_thinning_cps`

use this ordering for their advantage, as this is the assumed order or sequence of detection. Be warned that even if you do not order the data with `ordering_cps`

these functions will, and will output tree lists with this ordering!

The functions `polar_to_cart`

, `cart_to_polar`

, `triangle_coords`

, and `shades`

are internal functions used by the two main functions. They can be useful for visualizing data.

`HTest_cps`

returns a four-column matrix, the columns containing an estimate, estimated variance of the estimator, and lower and upper bound of the approximate confidence interval for the estimate. Rows of the matrix correspond to the forest characteristics of interest given in columns `2:ncol(data)`

of the input matrix `data`

. If the input matrix has named columns, these names are used as row names of the output matrix.

`detectability_cps`

returns a matrix with the locations and diameters of the trees given as input, the indicators of their detection, and the estimated detection probabilities.

`visibility_thinning_cps`

returns a four-column matrix with the locations and diameters of the trees given as input and the indicators of their detection: 1, if a tree has been detected based on the detection condition given by `alpha`

, and 0, otherwise.

`ordering_cps`

returns a matrix with same dimensions as the input matrix, rows being reordered in the assumed order of detection.

`polar_to_cart`

returns a two-column matrix of cartesian coordinates (x, y).

`cart_to_polar`

returns a two-column matrix of polar coordinates (r, phi).

`triangle_coords`

returns an eight-column matrix, each row containing cartesian coordinates needed for forming a polygonal representation of an area behind a tree, nonvisible from the origin.

`shades`

returns a list of `owin`

objects, each representing an area behind a tree, nonvisible from the origin.

These functions require the package `spatstat`

(Baddeley et al. 2015) to work.

Kasper Kansanen <kasperkansanen@gmail.com>

Baddeley, A., Rubak, E. and Turner, R. (2015) *Spatial Point Patterns: Methodology and Applications with R*.
Chapman and Hall/CRC Press, London. doi: 10.1201/b19708

Kansanen, K., Packalen, P., Maltamo, M., and Mehtatalo, L. (2020+) *Horvitz–Thompson-like estimation
with distance-based detection probabilities for circular plot sampling of forests*. Biometrics.
doi: 10.1111/biom.13312

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | ```
## Not run:
# Simulate a plot of radius 10 metres and stem density of 1000 trees/ha from the Poisson process:
set.seed(1)
N <- rpois(1, lambda=0.1*pi*10^2)
proc <- cbind(10*sqrt(runif(N, 0 ,1)), runif(N, -pi, pi), rweibull(N, shape=12, scale=22)/100)
# Preprocess the data to the right order:
proc <- ordering_cps(proc)
# Thin the data:
thinned<-visibility_thinning_cps(data=proc, plot.radius=10, alpha=1)
# Calculate the detection probabilities:
detprob <- detectability_cps(data=thinned, plot.radius=10, alpha=1)
# Calculate estimates of stand density (number of trees) and basal area
# (the sum of areas covered by tree stems at breast height):
mydata<-cbind(detprob[,5], 1, pi*detprob[,3]^2)
HTest_cps(data=mydata)
# Calculate estimate of mean DBH and a 99 per cent approximate confidence interval:
mydata<-cbind(detprob[,5], detprob[,3])
HTest_cps(data=mydata, total=FALSE, confidence.level=0.99)
## End(Not run)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.