%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%                          KENT STATE UNIVERSITY
%                      Analytical Methods, Fall 2013
%                               Assignment X
%
% SCRIPT documentationExample.m
%
% This script does _____________________.
%
% INPUT: List any relevant input data and its characteristics. Example: 
%
%         myData(100x3): Consumer choice dataset.
%
% OUTPUT: Relevant output resulting from the script. Example:
%
%         myData(100x4): Consumer choice dataset with predicted purchase
%                        probability in Column 4.
%
%                                                     yourName (MM/DD/YYYY)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
clear; clc;

%Load consumer choice dataset
%Column 1: Purchase decision (Y/N, binary, 1=purchase, 0=no purchase)
%Column 2: Price of good
%Column 3: Time of day (dummy set, 0=morning, 1=midday, 2=evening).
myData=load('myData.dat');

%%%%%%%%%%%
%ALGORITHM
%%%%%%%%%%%

%Scroll through the dataset and, for each observation, obtain
%predicted probability of purchase.
for i=1:1:size(myData,1)
   
    %Extract relevant variables from dataset
    choice=myData(i,1);
    price=myData(i,2);
    time=myData(i,3);
    
    %Obtain predicted probability and store it
    myData(i,4)=predictedProbabilityFunction(choice, price, time);
        
end

















