[R] random draw from a RESTRICTED pareto distribution
lucie.salwiczek at zooplus.de
Mon Jan 21 12:51:40 CET 2013
Dear R user,
I am a newcomer and need help concerning 'draw a random number for a
restricted area of a prareto distribution'.
(1) For estimation of pareto distribution:
We calculate the pareto distribution (parameter estimation) as follows:
pareto.MLE <- function(X)
n <- length(X)
m <- min(X)
a <- n/sum(log(X)-log(m))
return( c(m,a) )
par.eto.par <- c(s=pareto.MLE(data$T), beta=pareto.MLE(data$T))
[NOTE: data$T: the data we use]
(2) Current random draw from an unrestricted pareto distribution:
random <- rpareto(l, location=beta, shape=s)
[Note: s and beta are calculated in (1)]
(3) What we need instead of step (2) is a random draw from an RESTRICTED
pareto distribution, using the pareto parameters calculated (1), where
random ≥ data$T
- start with one value from data$T.
- Then make a random draw from a pareto distribution using the parameters
(s, beta) estimated in (1)
- and this new = randomly drawn number (‘random’) should be ≥ a given value
If the area from which to draw a new number is not restricted, this new
number (‘random’) can be smaller than the value from data$T.
- if random < data$T then run as many random draws as it needs until the new
number (‘random’) fulfills the requirement random ≥ ta.data$T.
Of course, that is not efficient, it takes a lot of time.
Alternative: restrict the area from which to draw the random numbers.
BUT: I don’ know how to restrict the area where the random draw occurs.*
Thus the question is: how to tell R to use for the random draw only the area
from a given pareto distribution with parameters estimated in (1) where
random ≥ ta.data$T ?
Thanks for any thoughts and advice on this!
View this message in context: http://r.789695.n4.nabble.com/random-draw-from-a-RESTRICTED-pareto-distribution-tp4656151.html
Sent from the R help mailing list archive at Nabble.com.
More information about the R-help