Trunc: Simulation from a Truncated Distribution

Description Usage Arguments Details Value See Also Examples

Description

This function can simulation from a truncated distribution which is used for generating the left and right spreads of Piecewise Linear Fuzzy Numbers (PLFNs).

Usage

1
Trunc(n, T.dist, T.dist.par, L = -Inf, R = Inf)

Arguments

n

The sample size.

T.dist

The distribution name of random variable (which one needs its truncated version) is determined by characteristic element T.dist. The names of distributions is similar to stats package.

T.dist.par

A vector of distribution parameters (which one needs its truncated version) with considered ordering in stats package.

L

The left point of truncation of distribution.

R

The right point of truncation of distribution.

Details

The goal of introducing Trunc function in this package is only using in PLFN and S.PLFN functions.

Value

A vector of random data from the considered truncated distribution.

See Also

DISTRIB

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# Truncated Normal Distribution: 

data1 = Trunc(n=10^4, T.dist="norm", T.dist.par=c(5,2), L=3, R=10)
hist(data1)

data2 = Trunc(n=1000, T.dist="chisq", T.dist.par=4, L=0, R=12)
hist(data2)

data3 = Trunc(n=10^4, T.dist="norm", T.dist.par=c(5,2), L=3) 
hist(data3)

Example output



Sim.PLFN documentation built on May 2, 2019, 5:51 a.m.