# suppose to have four lags: 
# K<-4 
# w1<-1	# by setting w1=1, only a monotonically decreasing weighting scheme is allowed
	#(more recent observations weigh more)
# w2<-5
beta_function(1:4,K=4,w1=1,w2=5)
Run the code above in your browser using DataLab