newFit | R Documentation |
Create a new instance of the "Fit" class for a given function.
newFit(name, fun, param, interval)
name |
Name of the fit. |
fun |
The fitting function. |
param |
The parameter(s) of the fitting function. |
interval |
The interval(s) for each parameter. |
An instance of the "Fit" class.
# Create a new Fit object for the Exponential distribution
fit_exp <- newFit("Exponential", pexp, "rate", list(c(0, 1)))
# Create a new Fit object for the Pareto distribution
ppareto <- function(x, shape, scale) {
if (any(x < scale)) return(rep(0, length(x)))
shape * scale^shape / x^(shape + 1)
}
fit_pareto <- newFit("Pareto", ppareto, c("shape", "scale"), list(c(0, 5), c(0, 100)))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.