fivpy.srs
Module to perform forest inventories using Simple Random Sampling
Module Contents
Classes
Class to create a forest inventory object |
- class fivpy.srs.RandomSampling(dataframe, unit_area, sampling_area, significance=95, sampling_error=20, deg_free=None)[source]
Class to create a forest inventory object which uses Simple Random Sampling to estimate total wood volume
- get_vol(self, beta_0=7.4e-05, beta_1=1.707348, beta_2=1.16873)[source]
Add a column with volume info to the dataframe
- Parameters
beta_0 (float, optional) – first parameter. Defaults to 0.000074.
beta_1 (float, optional) – second parameter. Defaults to 1.707348.
beta_2 (float, optional) – third parameter. Defaults to 1.16873.
- Returns
A DataFrame containing volume info.
- Return type
dataframe (pd.DataFrame)
Examples
>>> instance.get_vol() ### To change the equation used to calculate volume >>> instance.get_vol(beta_0=0.000025, beta_1=1.4568, beta_2=1.2563)
- get_sample_size(self)[source]
Returns the estimated required sample size to perform the definitive inventory
- Returns
the required sample size
- Return type
sample size (int)
Examples
>>> instance.get_sample_size()
- srs_inventory(self)[source]
Performs the Simple Random Sampling inventory
- Raises
ValueError – If the required sample size is greater than the number
of units sampled, it is not possible to perform the inventory. –
- Returns
A DataFrame containing the inventory results.
- Return type
dataframe (pd.DataFrame)
Examples
>>> instance.srs_inventory()