R/simulateObserved.R

Defines functions simulateObserved

simulateObserved <-
function (cdf)
{
	n = length (cdf)
	tmp = runif (1, min=0, max=1)
	obs = 1
	for (k in 2:n)
	{
		if (tmp>cdf[k-1] & tmp<=cdf[k])
			obs = k
	}
	return (obs)	
}

Try the DIRECT package in your browser

Any scripts or data that you put into this service are public.

DIRECT documentation built on May 29, 2017, 10:59 a.m.