
 

 

I have run the below function..

 

coef<-function(N,theta,k,alpha,lamda){
  omega<-rgamma(N,alpha,lamda)
  theta<-rnorm(N,theta,1/(k*omega))
  coeff<-1/(sqrt(omega)*theta)
  return(coeff)
}

 

I have been told I have to calculate the fifth percentile for :

dsamp100<-coef(100,39.83,5739,2869.1,49.44)

but how do I go about doing this? 

 

I know there is a quantile function in R, do I use this to find a percentile? If so, what value do I have to type into the second argument in the brackets to find the 5th?!

 

Any help would be greatly appreciated,

Henry

_________________________________________________________________


	[[alternative HTML version deleted]]


