se: Sum of Squares of Error Statistics

View source: R/se.R

seR Documentation

Sum of Squares of Error Statistics

Description

Computes the residual sum of squares and the root of the mean of for squares for models: nls, nls.lm, and models CDFmodel and CDFmodelList obatained with [fitCDF].

Usage

se(model, stat)

## S3 method for class 'nls'
se(model, stat = c("rmse", "sme"))

## S3 method for class 'nls.lm'
se(model, stat = c("rmse", "sme"))

## S3 method for class 'CDFmodel'
se(model, stat = c("rmse", "sme"))

## S3 method for class 'CDFmodelList'
se(model, stat = c("rmse", "sme"))

Arguments

model

An object from one of the classes: nls, nls.lm, CDFmodel or CDFmodelList, which are obtained after running [fitCDF].

stat

Select which statistic to return: 1) The root mean of the square of error or the square errors of residuals.

Value

The requested statistic for each model.

Examples

## Simulate data from Normal distribution
## and search for the best fitted model
x <-  rnorm(1000, mean = 5, sd = 2)
models <- fitCDF2(x, distNames = c(1, 7, 11, 12))

## Bases on the AIC criteria the best model is Weibull 3P
models

## In the current case Weibull is also the model with the lowest error
se(model)


genomaths/usefr documentation built on June 10, 2025, 9:18 p.m.