Package 'tnorm'

Title: Truncated Normal Distribution
Description: Truncated Normal Distributions can be generated by other packages such as msm, but these are slow. tnorm is a faster C++ replacement.
Authors: Mark Padgham [aut, cre]
Maintainer: Mark Padgham <[email protected]>
License: GPL-3
Version: 0.0.1
Built: 2026-05-16 07:56:08 UTC
Source: https://github.com/mpadge/tnorm

Help Index


tnorm

Description

Generates truncated normal distributions. Current best R method is msm::rtnorm, but this is entirely R-based and therefore s l o w. trunc-norm is Rcpp-based and much faster.

Functions

tnormn The sole function; used to generate truncated normal distributions

tnormn

Description

Generates a truncated normal distribution

Usage

tnormn(n, sd, seed)

Arguments

n

Number of truncated normally distributed observations to be simulated

sd

Standard deviation of truncated normal distribution

seed

Random seed

Value

A vector of n truncated normally distributed values

Examples

x <- tnormn (n=100, sd=0.1)