Type: Package
Title: Fuzzy & Randomized Confidence Intervals
Version: 0.1.0
Description: Contains the methods proposed by Geyer and Meeden (2005)<doi:10.1214/088342305000000340> and Trigo et al. (2025) <doi:10.47749/T/UNICAMP.2025.1500297> to construct fuzzy confidence intervals. Compute and plot the fuzzy membership functions of the methods, and the expected length compared with the infimum.
License: GPL-3
Imports: DescTools, calculus, ump, zipfR, graphics, stats
Encoding: UTF-8
RoxygenNote: 7.3.2
Suggests: testthat (≥ 3.0.0)
Config/testthat/edition: 3
NeedsCompilation: no
Packaged: 2025-12-07 01:45:50 UTC; caetn
Author: Carlos Henrique Trigo Nasser Felix [aut, cre], Nancy Garcia [aut], Alex Sousa [aut]
Maintainer: Carlos Henrique Trigo Nasser Felix <c214344@dac.unicamp.br>
Repository: CRAN
Date/Publication: 2025-12-11 14:10:02 UTC

Plot for "psi" type objects.

Description

Plot for "psi" type objects.

Usage

## S3 method for class 'psi'
plot(x, ..., psi2 = NULL, gamma = 0.95, xlim = NULL, ylim = NULL, type = "psi")

Arguments

x

A list containing the following information.

[[1]]

the membership function

[[2]]

the name of the sample distribution

[[3]]

sample size

[[4]]

the name of method

[[5]]

standard deviation (for the case of normal distribution).

[[6]]

the upper and lower bound function of the support of the membership function.

...

generic plot parameter.

psi2

Another list containing the following information.

[[1]]

the membership function

[[2]]

the name of the sample distribution

[[3]]

sample size

[[4]]

the name of method

[[5]]

standard deviation (for the case of normal distribution).

[[6]]

the upper and lower bound function of the support of the membership function.

gamma

the confidence level.

xlim

A vector containing the upper and lower values for the theta.

ylim

A vector containing the values of omega to be included in the plot.

type

The type of the plot, by default is the menbership function, and "length" for the expected length plot.

Value

No return value, called for side effects

Examples

x<-psi("GM",n=10)
plot(x)
plot(x,type="length")

x<-psi(0.5,n=10)
plot(x)
plot(x,type="length")

Fuzzy & Randomized Confidence Intervals

Description

Function to create "psi" type objects.

Usage

psi(method, distribution = "bernoulli", n = 1, sigma = 1)

Arguments

method

numeric value or name of the method that defines how obtain confidence intervals.

  • A numeric value utilizes the value as reference.

  • "GM" utilize the Gayer-Meeden method.

  • "AC" utilize the Agrest-Coull method (for the binomial distribution only).

  • "SC" utilizes the score method (for the poisson distribution only).

distribution

name of the distribution of the sample.

  • "normal" for the normal distribution.

  • "bernoulli" for the Bernoulli or binomial distribution.

  • "poisson" for the Poisson distribution.

n

sample size.

sigma

standard deviation (for the case of normal distribution).

Value

A list containing the following information.

[[1]]

the membership function

[[2]]

distribution

[[3]]

n

[[4]]

method

[[5]]

sigma

[[6]]

the upper and lower bound function of the support of the membership function.

References

FELIX, Carlos Henrique Trigo Nasser, Garcia, Nancy Lopes & Sousa, Alex Rodrigo dos Santos. (2025). Uma Nova Abordagem para Construção de Intervalos de Confiança Aleatorizados (Master's thesis, Universidade Estadual de Campinas, Campinas).

GEYER, C. J.; MEEDEN, G. D. Fuzzy and randomized confidence intervals and p-values. Statistical Science, v. 20, n. 4, p. 358–366, 2005. ISSN 08834237. Disponível em: http://www.jstor.org/stable/20061193.

Examples

x<-psi("GM",n=10)
x[[1]](0.3,2)
x[[2]]
x[[3]]
x[[4]]
x[[5]]
x[[6]](2)

x<-psi(0.5,n=10)
x[[1]](0.6,8)
x[[2]]
x[[3]]
x[[4]]
x[[5]]
x[[6]](8)