function final_std=mystd(values,frequency)
product  = values.*frequency;
productvaluesqrd  = (values.^2).*frequency;
n = sum(frequency);
final_std = sqrt((sum(productvaluesqrd) - (1/n)*sum(product)^2)/(n-1)); 
endfunction
