diff --git a/Logic 1.0 b/Logic 1.0 deleted file mode 100644 index 27bd09a..0000000 --- a/Logic 1.0 +++ /dev/null @@ -1,16 +0,0 @@ -#Logic for the ideation stage - -1. Start - - -2. Imputation process for missing values -. - -# Imputation by mean method - - -3. Predicting future values - -4. Quality process for imputation -5. End - diff --git a/The Predictors Logic 1.0 b/The Predictors Logic 1.0 new file mode 100644 index 0000000..9280ec0 --- /dev/null +++ b/The Predictors Logic 1.0 @@ -0,0 +1,41 @@ +#Logic for the ideation stage + +1. Start +#we have used summary function to determine the number of Na's in the data given +summary(input_data) + +#we also tried to fit normal distribution but it was not following its some basic properties such as the proportion of concentration of data corresponding to Z values. +#data is not plotted as belled shape + +# we also tried to use the data as time series object but the main feature of multivariate time series data i.e the variable to be co-integrated is I(1) does not fulfilled. + +2. Imputation process for missing values + +#we have used mean imputation, but it was not following the trend and adhering to dataset. +#mean imputation +(data_i$M4[which(is.na(data_i$M4))]=mean(data_i$M4,na.rm=TRUE)) + +# imputing the missing values +# mice imputation using pmm method 'Predictive mean matching' +# we used pmm method as data doesn't follow normal distribution so this method +#gives us an egde over regression method + +my_imp<-mice(input_data[,17:21],m=5,method="pmm",maxit = 200) +my_imp$imp$M4 +summary(input_data$M4) +input_data[,17:21]=complete(my_imp,1) + + +3. Predicting future values + +# prediction for the fifth week +#we have assumed that data of monday in week 5 will be dependent on previous weeks data. +M5<-lm(input_data$M4~input_data$M1+input_data$M2+input_data$M3,data = input_data) +# similarly we have computed the values for rest 4 days + +4. Quality process for imputation +#we have observed linear trend within the week +#we check the quality of imputation used + +5. End +