// Numbas version: exam_results_page_options {"name": "Calculate moving averages, perform linear regression and give seasonal adjustments, ", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"variablesTest": {"condition": "", "maxRuns": 100}, "variables": {"sdt2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(t2-mt2,1)", "description": "", "name": "sdt2"}, "ms1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "(th1+f1+s1+m2+t2)/5", "description": "", "name": "ms1"}, "mf2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "(t2+th2+f2+s2+m3)/5", "description": "", "name": "mf2"}, "st": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(sat-om,2)", "description": "", "name": "st"}, "sdm2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(m2-mm2,1)", "description": "", "name": "sdm2"}, "f1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "th1+random(1..3)", "description": "", "name": "f1"}, "tms": {"templateType": "anything", "group": "Ungrouped variables", "definition": "(sm+st+sth+sf+ss)/5", "description": "", "name": "tms"}, "sdth1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(th1-mth1,1)", "description": "", "name": "sdth1"}, "sds1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(s1-ms1,1)", "description": "", "name": "sds1"}, "comm1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "if(ms=0, \"Since the mean of the seasonal effects is 0, the adjusted seasonal effects are the same as the seasonal effects found above.\", \" \")", "description": "", "name": "comm1"}, "tol1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "1", "description": "", "name": "tol1"}, "m1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(1..4)", "description": "", "name": "m1"}, "asth": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(sth-ms,2)", "description": "", "name": "asth"}, "t3": {"templateType": "anything", "group": "Ungrouped variables", "definition": "max(t2,m3)+random(1..2)", "description": "", "name": "t3"}, "s1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "f1+random(1..2)", "description": "", "name": "s1"}, "sdf1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(f1-mf1,1)", "description": "", "name": "sdf1"}, "ms": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(tms,2)", "description": "", "name": "ms"}, "ti": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(16..19)", "description": "", "name": "ti"}, "thisdate": {"templateType": "anything", "group": "Ungrouped variables", "definition": "if(ti=16,\"Monday 28th April\",if(ti=17,\"Tuesday, 29th April\",if(ti=18,\"Thursday, 1st May\",\"Friday,2nd May\")))", "description": "", "name": "thisdate"}, "sumysquared": {"templateType": "anything", "group": "Ungrouped variables", "definition": "mth1^2+mf1^2+ms1^2+mm2^2+mt2^2+mth2^2+mf2^2+ms2^2+mm3^2+mt3^2+mth3^2", "description": "", "name": "sumysquared"}, "sdm3": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(m3-mm3,1)", "description": "", "name": "sdm3"}, "th3": {"templateType": "anything", "group": "Ungrouped variables", "definition": "max(th2,t3)+random(1..2)", "description": "", "name": "th3"}, "estord": {"templateType": "anything", "group": "Ungrouped variables", "definition": "round(estal+estbe*ti+adj+0.00000001)", "description": "", "name": "estord"}, "t1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "m1+random(1..3)", "description": "", "name": "t1"}, "f3": {"templateType": "anything", "group": "Ungrouped variables", "definition": "max(f2,th3)+random(1..2)", "description": "", "name": "f3"}, "syy": {"templateType": "anything", "group": "Ungrouped variables", "definition": "sumysquared-11*meany^2", "description": "", "name": "syy"}, "sds2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(s2-ms2,1)", "description": "", "name": "sds2"}, "thisday": {"templateType": "anything", "group": "Ungrouped variables", "definition": "if(ti=16 ,\"Monday\",if(ti=17 ,\"Tuesday\",if(ti=18,\"Thursday\",\"Friday\")))", "description": "", "name": "thisday"}, "ss": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(sas-om,2)", "description": "", "name": "ss"}, "mth1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "(m1+t1+th1+f1+s1)/5", "description": "", "name": "mth1"}, "testbe": {"templateType": "anything", "group": "Ungrouped variables", "definition": "(sumty-11*meany*meant)/110", "description": "", "name": "testbe"}, "sdth3": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(th3-mth3,1)", "description": "", "name": "sdth3"}, "m2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "m1+random(0..2)", "description": "", "name": "m2"}, "mt2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "(s1+m2+t2+th2+f2)/5", "description": "", "name": "mt2"}, "sf": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(saf-om,2)", "description": "", "name": "sf"}, "sdt3": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(t3-mt3,1)", "description": "", "name": "sdt3"}, "th2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "max(th1,t2)+random(1..2)", "description": "", "name": "th2"}, "mt3": {"templateType": "anything", "group": "Ungrouped variables", "definition": "(s2+m3+t3+th3+f3)/5", "description": "", "name": "mt3"}, "sat": {"templateType": "anything", "group": "Ungrouped variables", "definition": "(sdt2+sdt3)/2", "description": "", "name": "sat"}, "ast": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(st-ms,2)", "description": "", "name": "ast"}, "tol": {"templateType": "anything", "group": "Ungrouped variables", "definition": "0.01", "description": "", "name": "tol"}, "saf": {"templateType": "anything", "group": "Ungrouped variables", "definition": "(sdf1+sdf2)/2", "description": "", "name": "saf"}, "sath": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround((sdth1+sdth2+sdth3)/3,2)", "description": "", "name": "sath"}, "s2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "max(s1,f2)+random(1..2)", "description": "", "name": "s2"}, "m3": {"templateType": "anything", "group": "Ungrouped variables", "definition": "m2+random(0..2)", "description": "", "name": "m3"}, "mm2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "(f1+s1+m2+t2+th2)/5", "description": "", "name": "mm2"}, "sth": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(sath-om,2)", "description": "", "name": "sth"}, "testal": {"templateType": "anything", "group": "Ungrouped variables", "definition": "meany-estbe*meant", "description": "", "name": "testal"}, "mm3": {"templateType": "anything", "group": "Ungrouped variables", "definition": "(f2+s2+m3+t3+th3)/5", "description": "", "name": "mm3"}, "sumty": {"templateType": "anything", "group": "Ungrouped variables", "definition": "3*mth1+4*mf1+5*ms1+6*mm2+7*mt2+8*mth2+9*mf2+10*ms2+11*mm3+12*mt3+13*mth3", "description": "", "name": "sumty"}, "mf1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "(t1+th1+f1+s1+m2)/5", "description": "", "name": "mf1"}, "mth3": {"templateType": "anything", "group": "Ungrouped variables", "definition": "(m3+t3+th3+f3+s3)/5", "description": "", "name": "mth3"}, "mth2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "(m2+t2+th2+f2+s2)/5", "description": "", "name": "mth2"}, "om": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(tom,3)", "description": "", "name": "om"}, "f2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "max(f1,th2)+random(1..2)", "description": "", "name": "f2"}, "sdf2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(f2-mf2,1)", "description": "", "name": "sdf2"}, "tom": {"templateType": "anything", "group": "Ungrouped variables", "definition": "(sdth1+sdf1+sds1+sdm2+sdt2+sdth2+sdf2+sds2+sdm3+sdt3+sdth3)/11", "description": "", "name": "tom"}, "sam": {"templateType": "anything", "group": "Ungrouped variables", "definition": "(sdm2+sdm3)/2", "description": "", "name": "sam"}, "comm": {"templateType": "anything", "group": "Ungrouped variables", "definition": "if(om=0, \"Since the mean of the seasonal deviations is 0, these seasonal effects are the same as the seasonal means found above.\", \" \")", "description": "", "name": "comm"}, "asm": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(sm-ms,2)", "description": "", "name": "asm"}, "th1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "t1+random(1..3)", "description": "", "name": "th1"}, "sm": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(sam-om,2)", "description": "", "name": "sm"}, "this": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(\"A satellite TV store\",\"An electrical store\",\"A plasma TV shop\",\"A computer hardware store\",\"A furniture store\",\"A DIY store\")", "description": "", "name": "this"}, "t2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "max(t1,m2)+random(1..2)", "description": "", "name": "t2"}, "ass": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(ss-ms,2)", "description": "", "name": "ass"}, "summa": {"templateType": "anything", "group": "Ungrouped variables", "definition": "mth1+mf1+ms1+mm2+mt2+mth2+mf2+ms2+mm3+mt3+mth3", "description": "", "name": "summa"}, "asf": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(sf-ms,2)", "description": "", "name": "asf"}, "adj": {"templateType": "anything", "group": "Ungrouped variables", "definition": "if(ti=16 ,asm,if(ti=17,ast,if(ti=18,asth,asf)))", "description": "", "name": "adj"}, "estal": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(testal,2)", "description": "", "name": "estal"}, "meany": {"templateType": "anything", "group": "Ungrouped variables", "definition": "summa/11", "description": "", "name": "meany"}, "estbe": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(testbe,2)", "description": "", "name": "estbe"}, "sas": {"templateType": "anything", "group": "Ungrouped variables", "definition": "(sds1+sds2)/2", "description": "", "name": "sas"}, "meant": {"templateType": "anything", "group": "Ungrouped variables", "definition": "8", "description": "", "name": "meant"}, "s3": {"templateType": "anything", "group": "Ungrouped variables", "definition": "max(s2,f3)+random(1..2)", "description": "", "name": "s3"}, "sdth2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(th2-mth2,1)", "description": "", "name": "sdth2"}, "ms2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "(th2+f2+s2+m3+t3)/5", "description": "", "name": "ms2"}}, "ungrouped_variables": ["f1", "f2", "f3", "sdf2", "sdf1", "thisdate", "t2", "saf", "mm3", "mm2", "this", "mt2", "sas", "t1", "sat", "asth", "tms", "mth3", "sam", "mth1", "sdth3", "s3", "s2", "s1", "sds1", "th3", "th2", "th1", "m1", "m3", "tom", "sath", "sdm3", "adj", "thisday", "sdt3", "sdt2", "ass", "comm1", "tol", "tol1", "ast", "m2", "meany", "testal", "t3", "sdm2", "mf2", "comm", "asf", "sumysquared", "sdth1", "syy", "sm", "asm", "mth2", "testbe", "om", "sdth2", "summa", "estbe", "mf1", "meant", "sumty", "sth", "ms2", "ms1", "st", "ss", "ms", "mt3", "ti", "sds2", "sf", "estal", "estord"], "name": "Calculate moving averages, perform linear regression and give seasonal adjustments, ", "functions": {}, "variable_groups": [], "preamble": {"css": "", "js": ""}, "parts": [{"customMarkingAlgorithm": "", "variableReplacementStrategy": "originalfirst", "prompt": "

Complete the following table, showing the moving averages for the number of orders based on a five-observation cycle. The first one has been done for you. Input all moving averages to one decimal place.

\n

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
MonTuesThurFriSat
7/4/08**$\\var{mth1}$[[0]][[1]]
14/4/08[[2]][[3]][[4]][[5]][[6]]
21/4/08[[7]][[8]][[9]]**
", "unitTests": [], "showFeedbackIcon": true, "scripts": {}, "gaps": [{"correctAnswerFraction": false, "allowFractions": false, "customMarkingAlgorithm": "", "mustBeReduced": false, "extendBaseMarkingAlgorithm": true, "minValue": "{mf1}", "maxValue": "{ms1}", "unitTests": [], "correctAnswerStyle": "plain", "variableReplacementStrategy": "originalfirst", "mustBeReducedPC": 0, "scripts": {}, "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "variableReplacements": [], "marks": 0.5, "showFeedbackIcon": true}, {"correctAnswerFraction": false, "allowFractions": false, "customMarkingAlgorithm": "", "mustBeReduced": false, "extendBaseMarkingAlgorithm": true, "minValue": "ms1", "maxValue": "ms1", "unitTests": [], "correctAnswerStyle": "plain", "variableReplacementStrategy": "originalfirst", "mustBeReducedPC": 0, "scripts": {}, "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "variableReplacements": [], "marks": 0.5, "showFeedbackIcon": true}, {"correctAnswerFraction": false, "allowFractions": false, "customMarkingAlgorithm": "", "mustBeReduced": false, "extendBaseMarkingAlgorithm": true, "minValue": "mm2", "maxValue": "mm2", "unitTests": [], "correctAnswerStyle": "plain", "variableReplacementStrategy": "originalfirst", "mustBeReducedPC": 0, "scripts": {}, "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "variableReplacements": [], "marks": 0.5, "showFeedbackIcon": true}, {"correctAnswerFraction": false, "allowFractions": false, "customMarkingAlgorithm": "", "mustBeReduced": false, "extendBaseMarkingAlgorithm": true, "minValue": "mt2", "maxValue": "mt2", "unitTests": [], "correctAnswerStyle": "plain", "variableReplacementStrategy": "originalfirst", "mustBeReducedPC": 0, "scripts": {}, "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "variableReplacements": [], "marks": 0.5, "showFeedbackIcon": true}, {"correctAnswerFraction": false, "allowFractions": false, "customMarkingAlgorithm": "", "mustBeReduced": false, "extendBaseMarkingAlgorithm": true, "minValue": "mth2", "maxValue": "mth2", "unitTests": [], "correctAnswerStyle": "plain", "variableReplacementStrategy": "originalfirst", "mustBeReducedPC": 0, "scripts": {}, "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "variableReplacements": [], "marks": 0.5, "showFeedbackIcon": true}, {"correctAnswerFraction": false, "allowFractions": false, "customMarkingAlgorithm": "", "mustBeReduced": false, "extendBaseMarkingAlgorithm": true, "minValue": "mf2", "maxValue": "mf2", "unitTests": [], "correctAnswerStyle": "plain", "variableReplacementStrategy": "originalfirst", "mustBeReducedPC": 0, "scripts": {}, "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "variableReplacements": [], "marks": 0.5, "showFeedbackIcon": true}, {"correctAnswerFraction": false, "allowFractions": false, "customMarkingAlgorithm": "", "mustBeReduced": false, "extendBaseMarkingAlgorithm": true, "minValue": "ms2", "maxValue": "ms2", "unitTests": [], "correctAnswerStyle": "plain", "variableReplacementStrategy": "originalfirst", "mustBeReducedPC": 0, "scripts": {}, "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "variableReplacements": [], "marks": 0.5, "showFeedbackIcon": true}, {"correctAnswerFraction": false, "allowFractions": false, "customMarkingAlgorithm": "", "mustBeReduced": false, "extendBaseMarkingAlgorithm": true, "minValue": "mm3", "maxValue": "mm3", "unitTests": [], "correctAnswerStyle": "plain", "variableReplacementStrategy": "originalfirst", "mustBeReducedPC": 0, "scripts": {}, "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "variableReplacements": [], "marks": 0.5, "showFeedbackIcon": true}, {"correctAnswerFraction": false, "allowFractions": false, "customMarkingAlgorithm": "", "mustBeReduced": false, "extendBaseMarkingAlgorithm": true, "minValue": "mt3", "maxValue": "mt3", "unitTests": [], "correctAnswerStyle": "plain", "variableReplacementStrategy": "originalfirst", "mustBeReducedPC": 0, "scripts": {}, "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "variableReplacements": [], "marks": 0.5, "showFeedbackIcon": true}, {"correctAnswerFraction": false, "allowFractions": false, "customMarkingAlgorithm": "", "mustBeReduced": false, "extendBaseMarkingAlgorithm": true, "minValue": "mth3", "maxValue": "mth3", "unitTests": [], "correctAnswerStyle": "plain", "variableReplacementStrategy": "originalfirst", "mustBeReducedPC": 0, "scripts": {}, "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "variableReplacements": [], "marks": 0.5, "showFeedbackIcon": true}], "type": "gapfill", "extendBaseMarkingAlgorithm": true, "showCorrectAnswer": true, "variableReplacements": [], "marks": 0, "sortAnswers": false}, {"customMarkingAlgorithm": "", "variableReplacementStrategy": "originalfirst", "prompt": "

Fit the linear regression model $Y=\\alpha+\\beta T+\\epsilon$  to this set $Y$ of moving averages, where $T$ represents time. ($T=1$ for 7/4/08,  $T=2$ for 8/4/08,  $T=3$ for 10/4/08 etc.)

\n

You may use the following summaries:

\n

$\\sum t=88,\\;\\;\\sum y=\\var{summa},\\;\\;\\sum ty=\\var{sumty},\\;\\; \\sum t^2=814,\\;\\;\\sum y^2=\\var{sumysquared}$.

\n

Estimate for $\\beta= \\;$[[0]] (estimate to 2 decimal places).

\n

Estimate for $\\alpha= \\;$[[1]] (estimate to 2 decimal places). Use the estimate for $\\beta$ to 2 decimal places to estimate $\\alpha$.

", "unitTests": [], "showFeedbackIcon": true, "scripts": {}, "gaps": [{"correctAnswerFraction": false, "allowFractions": false, "customMarkingAlgorithm": "", "mustBeReduced": false, "extendBaseMarkingAlgorithm": true, "minValue": "estbe-tol", "maxValue": "estbe+tol", "unitTests": [], "correctAnswerStyle": "plain", "variableReplacementStrategy": "originalfirst", "mustBeReducedPC": 0, "scripts": {}, "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "variableReplacements": [], "marks": 1, "showFeedbackIcon": true}, {"correctAnswerFraction": false, "allowFractions": false, "customMarkingAlgorithm": "", "mustBeReduced": false, "extendBaseMarkingAlgorithm": true, "minValue": "estal-tol", "maxValue": "estal+tol", "unitTests": [], "correctAnswerStyle": "plain", "variableReplacementStrategy": "originalfirst", "mustBeReducedPC": 0, "scripts": {}, "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "variableReplacements": [], "marks": 1, "showFeedbackIcon": true}], "type": "gapfill", "extendBaseMarkingAlgorithm": true, "showCorrectAnswer": true, "variableReplacements": [], "marks": 0, "sortAnswers": false}, {"customMarkingAlgorithm": "", "variableReplacementStrategy": "originalfirst", "prompt": "

Complete the following table, showing the seasonal deviations and seasonal means for each day of the week:

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
MonTuesThurFriSat
7/4/08**[[0]][[1]][[2]]
14/4/08[[3]][[4]][[5]][[6]][[7]]
21/4/08[[8]][[9]][[10]]**
Seasonal Mean[[11]][[12]][[13]][[14]][[15]]
\n

Input all entries to 2 decimal places.

", "unitTests": [], "showFeedbackIcon": true, "scripts": {}, "gaps": [{"correctAnswerFraction": false, "allowFractions": false, "customMarkingAlgorithm": "", "mustBeReduced": false, "extendBaseMarkingAlgorithm": true, "minValue": "sdth1", "maxValue": "sdth1", "unitTests": [], "correctAnswerStyle": "plain", "variableReplacementStrategy": "originalfirst", "mustBeReducedPC": 0, "scripts": {}, "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "variableReplacements": [], "marks": 0.25, "showFeedbackIcon": true}, {"correctAnswerFraction": false, "allowFractions": false, "customMarkingAlgorithm": "", "mustBeReduced": false, "extendBaseMarkingAlgorithm": true, "minValue": "sdf1", "maxValue": "sdf1", "unitTests": [], "correctAnswerStyle": "plain", "variableReplacementStrategy": "originalfirst", "mustBeReducedPC": 0, "scripts": {}, "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "variableReplacements": [], "marks": 0.25, "showFeedbackIcon": true}, {"correctAnswerFraction": false, "allowFractions": false, "customMarkingAlgorithm": "", "mustBeReduced": false, "extendBaseMarkingAlgorithm": true, "minValue": "sds1", "maxValue": "sds1", "unitTests": [], "correctAnswerStyle": "plain", "variableReplacementStrategy": "originalfirst", "mustBeReducedPC": 0, "scripts": {}, "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "variableReplacements": [], "marks": 0.25, "showFeedbackIcon": true}, {"correctAnswerFraction": false, "allowFractions": false, "customMarkingAlgorithm": "", "mustBeReduced": false, "extendBaseMarkingAlgorithm": true, "minValue": "sdm2", "maxValue": "sdm2", "unitTests": [], "correctAnswerStyle": "plain", "variableReplacementStrategy": "originalfirst", "mustBeReducedPC": 0, "scripts": {}, "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "variableReplacements": [], "marks": 0.25, "showFeedbackIcon": true}, {"correctAnswerFraction": false, "allowFractions": false, "customMarkingAlgorithm": "", "mustBeReduced": false, "extendBaseMarkingAlgorithm": true, "minValue": "sdt2", "maxValue": "sdt2", "unitTests": [], "correctAnswerStyle": "plain", "variableReplacementStrategy": "originalfirst", "mustBeReducedPC": 0, "scripts": {}, "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "variableReplacements": [], "marks": 0.25, "showFeedbackIcon": true}, {"correctAnswerFraction": false, "allowFractions": false, "customMarkingAlgorithm": "", "mustBeReduced": false, "extendBaseMarkingAlgorithm": true, "minValue": "sdth2", "maxValue": "sdth2", "unitTests": [], "correctAnswerStyle": "plain", "variableReplacementStrategy": "originalfirst", "mustBeReducedPC": 0, "scripts": {}, "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "variableReplacements": [], "marks": 0.25, "showFeedbackIcon": true}, {"correctAnswerFraction": false, "allowFractions": false, "customMarkingAlgorithm": "", "mustBeReduced": false, "extendBaseMarkingAlgorithm": true, "minValue": "sdf2", "maxValue": "sdf2", "unitTests": [], "correctAnswerStyle": "plain", "variableReplacementStrategy": "originalfirst", "mustBeReducedPC": 0, "scripts": {}, "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "variableReplacements": [], "marks": 0.25, "showFeedbackIcon": true}, {"correctAnswerFraction": false, "allowFractions": false, "customMarkingAlgorithm": "", "mustBeReduced": false, "extendBaseMarkingAlgorithm": true, "minValue": "sds2", "maxValue": "sds2", "unitTests": [], "correctAnswerStyle": "plain", "variableReplacementStrategy": "originalfirst", "mustBeReducedPC": 0, "scripts": {}, "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "variableReplacements": [], "marks": 0.25, "showFeedbackIcon": true}, {"correctAnswerFraction": false, "allowFractions": false, "customMarkingAlgorithm": "", "mustBeReduced": false, "extendBaseMarkingAlgorithm": true, "minValue": "sdm3", "maxValue": "sdm3", "unitTests": [], "correctAnswerStyle": "plain", "variableReplacementStrategy": "originalfirst", "mustBeReducedPC": 0, "scripts": {}, "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "variableReplacements": [], "marks": 0.25, "showFeedbackIcon": true}, {"correctAnswerFraction": false, "allowFractions": false, "customMarkingAlgorithm": "", "mustBeReduced": false, "extendBaseMarkingAlgorithm": true, "minValue": "sdt3", "maxValue": "sdt3", "unitTests": [], "correctAnswerStyle": "plain", "variableReplacementStrategy": "originalfirst", "mustBeReducedPC": 0, "scripts": {}, "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "variableReplacements": [], "marks": 0.25, "showFeedbackIcon": true}, {"correctAnswerFraction": false, "allowFractions": false, "customMarkingAlgorithm": "", "mustBeReduced": false, "extendBaseMarkingAlgorithm": true, "minValue": "sdth3", "maxValue": "sdth3", "unitTests": [], "correctAnswerStyle": "plain", "variableReplacementStrategy": "originalfirst", "mustBeReducedPC": 0, "scripts": {}, "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "variableReplacements": [], "marks": 0.25, "showFeedbackIcon": true}, {"correctAnswerFraction": false, "allowFractions": false, "customMarkingAlgorithm": "", "mustBeReduced": false, "extendBaseMarkingAlgorithm": true, "minValue": "sam", "maxValue": "sam", "unitTests": [], "correctAnswerStyle": "plain", "variableReplacementStrategy": "originalfirst", "mustBeReducedPC": 0, "scripts": {}, "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "variableReplacements": [], "marks": 0.25, "showFeedbackIcon": true}, {"correctAnswerFraction": false, "allowFractions": false, "customMarkingAlgorithm": "", "mustBeReduced": false, "extendBaseMarkingAlgorithm": true, "minValue": "sat", "maxValue": "sat", "unitTests": [], "correctAnswerStyle": "plain", "variableReplacementStrategy": "originalfirst", "mustBeReducedPC": 0, "scripts": {}, "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "variableReplacements": [], "marks": 0.25, "showFeedbackIcon": true}, {"correctAnswerFraction": false, "allowFractions": false, "customMarkingAlgorithm": "", "mustBeReduced": false, "extendBaseMarkingAlgorithm": true, "minValue": "sath-tol", "maxValue": "sath+tol", "unitTests": [], "correctAnswerStyle": "plain", "variableReplacementStrategy": "originalfirst", "mustBeReducedPC": 0, "scripts": {}, "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "variableReplacements": [], "marks": 0.25, "showFeedbackIcon": true}, {"correctAnswerFraction": false, "allowFractions": false, "customMarkingAlgorithm": "", "mustBeReduced": false, "extendBaseMarkingAlgorithm": true, "minValue": "saf", "maxValue": "saf", "unitTests": [], "correctAnswerStyle": "plain", "variableReplacementStrategy": "originalfirst", "mustBeReducedPC": 0, "scripts": {}, "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "variableReplacements": [], "marks": 0.25, "showFeedbackIcon": true}, {"correctAnswerFraction": false, "allowFractions": false, "customMarkingAlgorithm": "", "mustBeReduced": false, "extendBaseMarkingAlgorithm": true, "minValue": "sas", "maxValue": "sas", "unitTests": [], "correctAnswerStyle": "plain", "variableReplacementStrategy": "originalfirst", "mustBeReducedPC": 0, "scripts": {}, "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "variableReplacements": [], "marks": 0.25, "showFeedbackIcon": true}], "type": "gapfill", "extendBaseMarkingAlgorithm": true, "showCorrectAnswer": true, "variableReplacements": [], "marks": 0, "sortAnswers": false}, {"customMarkingAlgorithm": "", "variableReplacementStrategy": "originalfirst", "prompt": "

Calculate the (unadjusted) seasonal effects for each day of the week: (input all your answers to 2 decimal places).

\n

Seasonal effect for Monday:   $S_M=\\;$    [[0]]                     

\n

Seasonal effect for Tuesday:   $S_T=\\;$ [[1]]

\n

Seasonal effect for Thursday:   $S_{Thu}=\\;$  [[2]]     

\n

Seasonal effect for Friday:        $S_F=\\;$ [[3]]

\n

Seasonal effect for Saturday:    $S_{Sa}=\\;$ [[4]]

\n

", "unitTests": [], "showFeedbackIcon": true, "scripts": {}, "gaps": [{"correctAnswerFraction": false, "allowFractions": false, "customMarkingAlgorithm": "", "mustBeReduced": false, "extendBaseMarkingAlgorithm": true, "minValue": "sm-tol", "maxValue": "sm+tol", "unitTests": [], "correctAnswerStyle": "plain", "variableReplacementStrategy": "originalfirst", "mustBeReducedPC": 0, "scripts": {}, "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "variableReplacements": [], "marks": 0.5, "showFeedbackIcon": true}, {"correctAnswerFraction": false, "allowFractions": false, "customMarkingAlgorithm": "", "mustBeReduced": false, "extendBaseMarkingAlgorithm": true, "minValue": "st-tol", "maxValue": "st+tol", "unitTests": [], "correctAnswerStyle": "plain", "variableReplacementStrategy": "originalfirst", "mustBeReducedPC": 0, "scripts": {}, "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "variableReplacements": [], "marks": 0.5, "showFeedbackIcon": true}, {"correctAnswerFraction": false, "allowFractions": false, "customMarkingAlgorithm": "", "mustBeReduced": false, "extendBaseMarkingAlgorithm": true, "minValue": "sth-tol", "maxValue": "sth+tol", "unitTests": [], "correctAnswerStyle": "plain", "variableReplacementStrategy": "originalfirst", "mustBeReducedPC": 0, "scripts": {}, "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "variableReplacements": [], "marks": 0.5, "showFeedbackIcon": true}, {"correctAnswerFraction": false, "allowFractions": false, "customMarkingAlgorithm": "", "mustBeReduced": false, "extendBaseMarkingAlgorithm": true, "minValue": "sf-tol", "maxValue": "sf+tol", "unitTests": [], "correctAnswerStyle": "plain", "variableReplacementStrategy": "originalfirst", "mustBeReducedPC": 0, "scripts": {}, "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "variableReplacements": [], "marks": 0.5, "showFeedbackIcon": true}, {"correctAnswerFraction": false, "allowFractions": false, "customMarkingAlgorithm": "", "mustBeReduced": false, "extendBaseMarkingAlgorithm": true, "minValue": "ss-tol", "maxValue": "ss+tol", "unitTests": [], "correctAnswerStyle": "plain", "variableReplacementStrategy": "originalfirst", "mustBeReducedPC": 0, "scripts": {}, "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "variableReplacements": [], "marks": 0.5, "showFeedbackIcon": true}], "type": "gapfill", "extendBaseMarkingAlgorithm": true, "showCorrectAnswer": true, "variableReplacements": [], "marks": 0, "sortAnswers": false}, {"customMarkingAlgorithm": "", "variableReplacementStrategy": "originalfirst", "prompt": "

Calculate the adusted seasonal effects for each day of the week: (input all your answers to 2 decimal places).

\n

Adjusted seasonal effect for Monday:   $S_M=\\;$    [[0]]                     

\n

Adjusted seasonal effect for Tuesday:   $S_T=\\;$ [[1]]

\n

Adjusted seasonal effect for Thursday:   $S_{Thu}=\\;$  [[2]]     

\n

Adjusted seasonal effect for Friday:        $S_F=\\;$ [[3]]

\n

Adjusted seasonal effect for Saturday:    $S_{Sa}=\\;$ [[4]]

\n

", "unitTests": [], "showFeedbackIcon": true, "scripts": {}, "gaps": [{"correctAnswerFraction": false, "allowFractions": false, "customMarkingAlgorithm": "", "mustBeReduced": false, "extendBaseMarkingAlgorithm": true, "minValue": "asm-tol", "maxValue": "asm+tol", "unitTests": [], "correctAnswerStyle": "plain", "variableReplacementStrategy": "originalfirst", "mustBeReducedPC": 0, "scripts": {}, "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "variableReplacements": [], "marks": 0.5, "showFeedbackIcon": true}, {"correctAnswerFraction": false, "allowFractions": false, "customMarkingAlgorithm": "", "mustBeReduced": false, "extendBaseMarkingAlgorithm": true, "minValue": "ast-tol", "maxValue": "ast+tol", "unitTests": [], "correctAnswerStyle": "plain", "variableReplacementStrategy": "originalfirst", "mustBeReducedPC": 0, "scripts": {}, "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "variableReplacements": [], "marks": 0.5, "showFeedbackIcon": true}, {"correctAnswerFraction": false, "allowFractions": false, "customMarkingAlgorithm": "", "mustBeReduced": false, "extendBaseMarkingAlgorithm": true, "minValue": "asth-tol", "maxValue": "asth+tol", "unitTests": [], "correctAnswerStyle": "plain", "variableReplacementStrategy": "originalfirst", "mustBeReducedPC": 0, "scripts": {}, "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "variableReplacements": [], "marks": 0.5, "showFeedbackIcon": true}, {"correctAnswerFraction": false, "allowFractions": false, "customMarkingAlgorithm": "", "mustBeReduced": false, "extendBaseMarkingAlgorithm": true, "minValue": "asf-tol", "maxValue": "asf+tol", "unitTests": [], "correctAnswerStyle": "plain", "variableReplacementStrategy": "originalfirst", "mustBeReducedPC": 0, "scripts": {}, "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "variableReplacements": [], "marks": 0.5, "showFeedbackIcon": true}, {"correctAnswerFraction": false, "allowFractions": false, "customMarkingAlgorithm": "", "mustBeReduced": false, "extendBaseMarkingAlgorithm": true, "minValue": "ass-tol", "maxValue": "ass+tol", "unitTests": [], "correctAnswerStyle": "plain", "variableReplacementStrategy": "originalfirst", "mustBeReducedPC": 0, "scripts": {}, "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "variableReplacements": [], "marks": 0.5, "showFeedbackIcon": true}], "type": "gapfill", "extendBaseMarkingAlgorithm": true, "showCorrectAnswer": true, "variableReplacements": [], "marks": 0, "sortAnswers": false}, {"customMarkingAlgorithm": "", "variableReplacementStrategy": "originalfirst", "prompt": "

Use the regression equation in part 2 and the adjusted seasonal effects in part 5 to forecast the number of orders on {thisdate}

\n

Estimated orders on {thisdate} = ?[[0]]  (input to the nearest whole number)

", "unitTests": [], "showFeedbackIcon": true, "scripts": {}, "gaps": [{"correctAnswerFraction": false, "allowFractions": false, "customMarkingAlgorithm": "", "mustBeReduced": false, "extendBaseMarkingAlgorithm": true, "minValue": "estord-tol1", "maxValue": "estord+tol1", "unitTests": [], "correctAnswerStyle": "plain", "variableReplacementStrategy": "originalfirst", "mustBeReducedPC": 0, "scripts": {}, "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "variableReplacements": [], "marks": 2, "showFeedbackIcon": true}], "type": "gapfill", "extendBaseMarkingAlgorithm": true, "showCorrectAnswer": true, "variableReplacements": [], "marks": 0, "sortAnswers": false}], "statement": "

{This} has recently opened for business and is open  5 days a week, Monday, Tuesday, Thursday, Friday and Saturday. The number of orders each day during the first three weeks of business is shown below:

\n

{table([[\"7/4/08\",{m1},{t1},{th1},{f1},{s1}],[\"14/4/08\",{m2},{t2},{th2},{f2},{s2}],[\"21/4/08\",{m3},{t3},{th3},{f3},{s3}]],[\" \",\"Mon\",\"Tues\",\"Thur\",\"Fri\",\"Sat\"])}

\n

", "tags": ["checked2015", "forecasting", "moving averages", "regression", "seasonal adjustments", "seasonality", "statistics", "time series"], "rulesets": {}, "extensions": [], "type": "question", "metadata": {"licence": "Creative Commons Attribution 4.0 International", "description": "

Moving averages, regression and seasonal adjustments.

"}, "advice": "

a)

\n

 The completed moving average table is as follows:

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
MonTuesThurFriSat
7/4/08**$\\var{mth1}$$\\var{mf1}$$\\var{ms1}$
14/4/08$\\var{mm2}$$\\var{mt2}$$\\var{mth2}$$\\var{mf2}$$\\var{ms2}$
21/4/08$\\var{mm3}$$\\var{mt3}$$\\var{mth3}$**
\n

b)

\n

The mean value of $T$ is $\\overline{t}=\\frac{3+4+\\cdots+13}{11}=\\frac{88}{11}=8$.

\n

The mean value of $Y$ is $\\overline{y}=\\frac{\\var{summa}}{11}=\\var{meany}$.

\n

We have:

\n

\\[\\begin{align}S_{TY}&=\\sum ty-11\\overline{t}\\overline{y}=\\var{sumty}-11\\times 8 \\times\\var{ meany}\\\\
S_{YY}&=\\sum y^2-11\\overline{y}^2=\\var{sumysquared}-11\\var{meany}^2=\\var{syy}\\\\
S_{TT}&=\\sum t^2-11\\overline{t}^2=814-11\\times 64=110
\\end{align}\\]

\n

Estimate for $\\beta$ is $\\frac{S_{TY}}{S_{TT}}=\\var{testbe}=\\var{estbe}$ to 2 decimal places.

\n

Estimate for $\\alpha$ is $\\overline{y}-\\beta\\overline{t}=\\var{meany}-\\var{estbe}\\times\\var{meant}=\\var{testal}=\\var{estal}$ to 2 decimal places.

\n

So the linear regression equation is $Y=\\simplify{{estal}+{estbe}T}+\\epsilon$ coefficients to 2 decimal places.

\n

c)

\n

The following table shows the calculated seasonal deviations and seasonal means for each day of the week. These are obtained by taking the moving average data away from the original data on orders. The seasonal means for the days are obtained by taking the means in each column.

\n

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
MonTuesThurFriSat
7/4/08**$\\var{sdth1}$$\\var{sdf1}$$\\var{sds1}$
14/4/08$\\var{sdm2}$$\\var{sdt2}$$\\var{sdth2}$$\\var{sdf2}$$\\var{sds2}$
21/4/08$\\var{sdm3}$$\\var{sdt3}$$\\var{sdth3}$**
Seasonal Mean$\\var{sam}$$\\var{sat}$$\\var{sath}$$\\var{saf}$$\\var{sas}$
\n

d) The seasonal effects for each day of the week are calculated by first finding the means of all the seasonal deviations found in the last table (not including the seasonal means in the last row). Then you take this away from the seasonal mean for each day.

\n

We find that the mean of the seasonal deviations is:

\n

\\[\\simplify[all,!collectNumbers]{({sdth1} + {sdf1} + {sds1} + {sdm2} + {sdt2} + {sdth2} + {sdf2} + {sds2} + {sdm3} + {sdt3} + {sdth3}) / 11} = \\var{om}\\]to 3 decimal places.

\n

{comm}

\n

Seasonal effect for Monday: $S_M=\\;\\simplify[all,!collectNumbers]{{sam}-{om}}=\\var{sm}$ to 2 decimal places.

\n

Seasonal effect for Tuesday: $S_T=\\simplify[all,!collectNumbers]{{sat}-{om}}=\\var{st}$ to 2 decimal places.

\n

Seasonal effect for Thursday: $S_{Thu}=\\simplify[all,!collectNumbers]{{sath}-{om}}=\\var{sth}$ to 2 decimal places.

\n

Seasonal effect for Friday: $S_F=\\simplify[all,!collectNumbers]{{saf}-{om}}=\\var{sf}$ to 2 decimal places.

\n

Seasonal effect for Saturday: $S_{Sa}=\\simplify[all,!collectNumbers]{{sas}-{om}}=\\var{ss}$ to 2 decimal places.

\n

e)

\n

We further adjust the seasonal effects for each day by finding the mean of the seasonal effects we have just found and then taking this away from each of the seasonal effects.

\n

We find that the mean of the seasonal deviations is:

\n

\\[\\simplify[all,!collectNumbers]{({sm} + {st} + {sth} + {sf} + {ss} ) / 5} = \\var{ms}\\] to 3 decimal places.

\n

{comm1}

\n

Adjusted seasonal effect for Monday $\\;=\\simplify[all,!collectNumbers]{{sm}-{ms}}=\\var{asm}$ to 2 decimal places.

\n

Adjusted seasonal effect for Tuesday$\\;=\\simplify[all,!collectNumbers]{{st}-{ms}}=\\var{ast}$ to 2 decimal places.

\n

Adjusted seasonal effect for Thursday$\\;=\\simplify[all,!collectNumbers]{{sth}-{ms}}=\\var{asth}$ to 2 decimal places.

\n

Adjusted seasonal effect for Friday$\\;=\\simplify[all,!collectNumbers]{{sf}-{ms}}=\\var{asf}$ to 2 decimal places.

\n

Adjusted seasonal effect for Saturday $\\;=\\simplify[all,!collectNumbers]{{ss}-{ms}}=\\var{ass}$ to 2 decimal places.

\n

f)

\n

We use the regression equation found above  $Y=\\simplify[all,!collectNumbers]{{estal}+{estbe}T}+\\epsilon$  to estimate the number of orders on {thisdate}.

\n

\n

But we have to adjust for seasonality using the adjusted seasonal effect found above by adding on the adjusted seasonal effect for {thisday} i.e. $\\var{adj}$.

\n

Note that $T=1$ corresponds to 7/4/08 and hence $T=\\var{ti}$ for {thisdate}.

\n

So putting $T=\\var{ti}$ gives  $Y=\\simplify[all,!collectNumbers]{{estal}+{estbe}*{ti}+{adj}}=\\var{estal+estbe*ti+adj}=\\var{estord}$  orders to the nearest whole number.

\n

\n

", "contributors": [{"name": "Bill Foster", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/6/"}, {"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}]}]}], "contributors": [{"name": "Bill Foster", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/6/"}, {"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}]}