Type: | Package |
Title: | Fits and Plots a Dataset to the Weibull Probability Distribution Function |
Version: | 0.1.0 |
Description: | Provides a single function to fit data of an input data frame into one of the selected Weibull functions (w2, w3 and it's truncated versions), calculating the scale, location and shape parameters accordingly. The resulting plots and files are saved into the 'folder' parameter provided by the user. References: a) John C. Nash, Ravi Varadhan (2011). "Unifying Optimization Algorithms to Aid Software System Users: optimx for R" <doi:10.18637/jss.v043.i09>. |
License: | GPL-3 |
Encoding: | UTF-8 |
LazyData: | true |
Depends: | R(≥ 3.6.0) |
Imports: | glue, xtable, sqldf, R.oo, FAdist, mixdist, optimx, kSamples, e1071, R.methodsS3, grDevices, graphics, stats, utils |
RoxygenNote: | 6.1.1 |
NeedsCompilation: | no |
Packaged: | 2019-07-22 23:40:32 UTC; Thiago |
Author: | Clayton Filho [aut], Thiago Martins [aut, cre] |
Maintainer: | Thiago Martins <thiago_valentim1@hotmail.com> |
Repository: | CRAN |
Date/Publication: | 2019-07-26 08:40:02 UTC |
Diameter at breast height of brazilian eucalyptus
Description
Diameter at breast height of brazilian eucalyptus
Usage
data(TreesDBH)
Format
A data frame with columns:
- parcela
The Parcel's number (A primary group). Each parcel contais many trees at the same age
- idade
Trees' age at given parcel, in months
- idadearred
Trees' rounded age at given parcel, in months
- dap
Diameter at breast height, or DBH. It is the standard for measuring trees. DBH refers to the tree diameter measured at 4.5 feet above the ground.
Source
still unknown
Bus velocity at given Time
Description
Bus velocity at given Time
Usage
data(busTrace)
Format
A data frame with columns:
- Onibus
Bus' series name
- Linha
Bus' line name
- Velocidade
Bus' velocity at given time
- HoraSegundos
Time of record, in seconds
Source
/hrefhttps://crawdad.org/coppe-ufrj/RioBuses/20180319/
Weibull-fitting function
Description
This functions calculates the shape, scale and location parameters for the weibull distribution to the input data and save the plots.
Usage
weibullFit(dataFrame, primaryGroup = "parcela",
secondaryGroup = "idadearred", restrValue, pValue = "dap",
leftTrunc = 5, folder = NA, limit = 1e+05,
selectedFunctions = NULL, amp = 2, pmaxIT = 20, verbose = FALSE)
Arguments
dataFrame |
the input data frame containing the independent, continuous variable. |
primaryGroup |
the name(String) of the primary grouping column of the data frame. |
secondaryGroup |
the name(String) of the secondary grouping column of the data frame. |
restrValue |
the restriction value choosen to be applied to the secondary group column. |
pValue |
the name(String) of the independent, continuos variable to be analyzed. |
leftTrunc |
An integer, defining the value for the weibull's function truncation. |
folder |
the pathname of the folder where the plots will be saved. |
limit |
A positive integer determining the maximum number of rows from the data frame (grouped by the primary group column) to be analyzed. |
selectedFunctions |
A character vector determining which weibull function to be applied. Can be any of the following: w2, w2te, w2td, w2tetd, w3, w3te, w3td, w3tetd |
amp |
The continuous variable class width to be accounted for the calculations. |
pmaxIT |
A positive integer, the maximum number of iterations used by the algorithm to try to get the weibull function parameters, for each primary group. |
verbose |
Logical, determines if the function prints more detailed results on the console. |
Details
This function first extracts a subset of the input data frame using the restrValue parameter applied to the secondary group column. Then, it calculates the weibull function scale, shape and location parameters using the maximum-likelyhood method. Finally, it plots the results (as .wmf, .csv and .jpeg) inside the folder given by the Folder parameter.
Value
A data frame object containing the best results for shape, location and scale parameters.
Examples
functions <- c("w2", "w3")
best <- weibullFit(restrValue = 60, dataFrame = TreesDBH,
selectedFunctions = functions, amp = 2, pmaxIT = 1, limit = 1)