Hi,
I have a function,func1.
func1=function(dat,T_period){
dat1=sort(dat,decreasing = T)
K_T=(-sqrt(6)/pi)*(0.5772+log(T_period, base = exp(1)))
X_T=mean(dat)+K_T*sd(dat)
return(X_T)
}
dat1=list(sample(100,20),
sample(100,10))
T_period1=as.list(c(2,5,10))
I want to get different outputs in the following way:
Each T_period1 for a given dat1, I am expecting an output X_T.
Therefore, how can I get 6 X_T (3 T_periods for each dat1).