function [mean_value,var_value,rmse_value] = para_optimization(train_data,test_data,n_train_datapoints,n_train_classes,test_class_values,n_test_datapoints,kernel,c_value,epsilon_value,gamma_value,train_label_values)
para1 = c_value;
para2 = epsilon_value;
para3 = gamma_value; 
index1 = 1;
r1 = strcmp(kernel,'rbf');
r2 = strcmp(kernel,'linear');
if(r1 == 1)
    while(index1 <= length(para1))
        index2 = 1;
        while(index2 <= length(para2))
            index3 = 1;
            while(index3 <= length(para3))
                [dum_mean_value,dum_var_value,dum_rmse_value] = SVM_regression(train_data,test_data,n_train_datapoints,n_train_classes,test_class_values,n_test_datapoints,kernel,para1(index1),para2(index2),para3(index3),train_label_values); 
                dum_mean_value = [dum_mean_value para1(index1) para2(index2) para3(index3)];
                dum_var_value = [dum_var_value para1(index1) para2(index2) para3(index3)];
                dum_rmse_value = [dum_rmse_value para1(index1) para2(index2) para3(index3)];
                mean_value(index3+(index2-1)*length(para3)+(index1-1)*length(para3)*length(para2),:) = dum_mean_value;
                var_value(index3+(index2-1)*length(para3)+(index1-1)*length(para3)*length(para2),:) = dum_var_value;
                rmse_value(index3+(index2-1)*length(para3)+(index1-1)*length(para3)*length(para2),:) = dum_rmse_value;
                index3 = index3 + 1;
            end
            index2 = index2 + 1;
        end
        index1 = index1 + 1;
    end
end
if(r2 == 1)
    while(index1 <= length(para1))
        index2 = 1;
        while(index2 <= length(para2))
            [dum_mean_value,dum_var_value,dum_rmse_value] = SVM_regression(train_data,test_data,n_train_datapoints,n_train_classes,test_class_values,n_test_datapoints,kernel,para1(index1),para2(index2),0,train_label_values); 
            dum_mean_value = [dum_mean_value para1(index1) para2(index2)];
            dum_var_value = [dum_var_value para1(index1) para2(index2)];
            dum_rmse_value = [dum_rmse_value para1(index1) para2(index2)];
            mean_value(index2+(index1-1)*length(para2),:) = dum_mean_value;
            var_value(index2+(index1-1)*length(para2),:) = dum_var_value;
            rmse_value(index2+(index1-1)*length(para2),:) = dum_rmse_value;
            index2 = index2 + 1;
        end
        index1 = index1 + 1;
    end
end
end

% %FOR RUNNING
% function [mean_estimate,var_estimate,rmse] = optimizing_parameter(train_feat1,train_feat2,test_feat1,m_value)
% parameter1 = 1;
% parameter2 = -10;
% parameter3 = 0.4;
% est_dum = parameters_sev_estimate(train_feat1,train_feat2,test_feat1,parameter1,parameter2,parameter3);
% est_class1 = est_dum(:,1);
% s = size(est_class1);
% rmse = sqrt(1/s(1)*(est_class1-m_value)'*(est_class1-m_value));
% mean_estimate = mean(est_class1);
% var_estimate = (std(est_class1))^2;
% end




% % Optimizing one parameter
% function [mean_estimate,var_estimate,rmse] = optimizing_parameter(train_feat1,train_feat2,test_feat1,m_value)
%     parameter1 = -15;
%     index = 1;
%     while(parameter1 <= 10)
%         parameter2 = -10;
%         parameter3 = 0.1;
%         est_dum = parameters_sev_estimate(train_feat1,train_feat2,test_feat1,parameter1,parameter2,parameter3);
%         est_class1 = est_dum(:,1);
%         s = size(est_class1);
%         mean_estimate(index) = mean(est_class1);
%         var_estimate(index) = (std(est_class1))^2;
%         rmse(index) = sqrt(1/s(1)*(est_class1-m_value)'*(est_class1-m_value));
%         index = index+1;
%         parameter1= parameter1 + 1;
%     end
% end


