// Numbas version: finer_feedback_settings {"name": "Coursework 2", "metadata": {"description": "", "licence": "None specified"}, "duration": 0, "percentPass": 0, "showQuestionGroupNames": false, "shuffleQuestionGroups": false, "showstudentname": true, "question_groups": [{"name": "Group", "pickingStrategy": "all-ordered", "pickQuestions": 1, "questionNames": ["", "", "", "", "", ""], "variable_overrides": [[], [], [], [], [], []], "questions": [{"name": "InterimTest - Question 2 as 2021", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Tatiana Tyukina", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/341/"}], "tags": [], "metadata": {"description": "", "licence": "None specified"}, "statement": "
Let $Y_1, Y_2, . . . , Y_n$ denote a random sample from the uniform distribution on the interval $[0, t]$ with the probability density function of the form:
\n\\[f_Y(y)=\\frac{1}{t}, \\quad 0\\leqslant y \\leqslant t.\\]
\n", "advice": "", "rulesets": {}, "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"x1": {"name": "x1", "group": "Ungrouped variables", "definition": "random(0 .. 5#1)", "description": "", "templateType": "randrange", "can_override": false}, "x3": {"name": "x3", "group": "Ungrouped variables", "definition": "random(1..5)", "description": "", "templateType": "anything", "can_override": false}, "x2": {"name": "x2", "group": "Ungrouped variables", "definition": "random(0..n-1)", "description": "", "templateType": "anything", "can_override": false}, "n": {"name": "n", "group": "Ungrouped variables", "definition": "3", "description": "", "templateType": "number", "can_override": false}, "sample": {"name": "sample", "group": "Ungrouped variables", "definition": "\"X1, X2, X3\"", "description": "", "templateType": "anything", "can_override": false}, "mu1": {"name": "mu1", "group": "Ungrouped variables", "definition": "expression(\"t/2\")", "description": "", "templateType": "anything", "can_override": false}, "mu2": {"name": "mu2", "group": "Ungrouped variables", "definition": "expression(\"t^2/3\")", "description": "", "templateType": "anything", "can_override": false}, "vary": {"name": "vary", "group": "Ungrouped variables", "definition": "expression(\"t^2/12\")", "description": "", "templateType": "anything", "can_override": false}, "t_est": {"name": "t_est", "group": "Ungrouped variables", "definition": "siground(sum(vector([x1,x2,x3]))/3*2,4)", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["x1", "x2", "x3", "n", "sample", "mu1", "mu2", "vary", "t_est"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "gapfill", "useCustomName": true, "customName": "Part 1.", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "Using the first two population moments, find the mean and the variance of $Y$.
\nWrite your answer as an experssion in terms of t
\n$\\mu_1=E(Y)=$[[0]]
\n$\\mu_2=$[[1]]
\nVar$(Y)=$[[2]]
\n", "gaps": [{"type": "jme", "useCustomName": false, "customName": "", "marks": "2", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "answer": "{mu1}", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "singleLetterVariables": false, "allowUnknownFunctions": true, "implicitFunctionComposition": false, "caseSensitive": false, "valuegenerators": []}, {"type": "jme", "useCustomName": false, "customName": "", "marks": "2", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "answer": "{mu2}", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "singleLetterVariables": false, "allowUnknownFunctions": true, "implicitFunctionComposition": false, "caseSensitive": false, "valuegenerators": []}, {"type": "jme", "useCustomName": false, "customName": "", "marks": "2", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "answer": "{varY}", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "singleLetterVariables": false, "allowUnknownFunctions": true, "implicitFunctionComposition": false, "caseSensitive": false, "valuegenerators": []}], "sortAnswers": false}, {"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "Write the first sample moment $m_1$ as a function of the sample mean, use $Ybar$ to denote $\\bar{Y}$:
\n$m_1=$[[0]]
\nWrite the estimator for t in terms of $\\bar{Y}$:
\n$\\hat{t}=$[[1]]
", "gaps": [{"type": "jme", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "answer": "Ybar", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "singleLetterVariables": false, "allowUnknownFunctions": true, "implicitFunctionComposition": false, "caseSensitive": false, "valuegenerators": [{"name": "ybar", "value": ""}]}, {"type": "jme", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "answer": "2Ybar", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "singleLetterVariables": false, "allowUnknownFunctions": true, "implicitFunctionComposition": false, "caseSensitive": false, "valuegenerators": [{"name": "ybar", "value": ""}]}], "sortAnswers": false}, {"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "Find the estimate of $t$ using the method of moments if the following numbers were observed:
\n\\[y_1=\\var{x1},\\ y_2=\\var{x2},\\ y_3=\\var{x3}\\]
\n$\\hat{t}=$[[0]]
", "gaps": [{"type": "jme", "useCustomName": false, "customName": "", "marks": "2", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "answer": "{t_est}", "showPreview": true, "checkingType": "dp", "checkingAccuracy": 3, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "singleLetterVariables": false, "allowUnknownFunctions": true, "implicitFunctionComposition": false, "caseSensitive": false, "valuegenerators": []}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "type": "question"}, {"name": "Method of Moments - Q2", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Tatiana Tyukina", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/341/"}], "tags": [], "metadata": {"description": "", "licence": "None specified"}, "statement": "A random sample of size $n=\\var{n}$ , $\\var{sample}$, is drawn (with replacement) from a population with the following p.m.f.:
\n\\[p_X(x)=\\frac{\\var{n}!}{x!(\\var{n}-x)!}\\left(t\\right)^x\\left(1-t\\right)^{\\var{n}-x}, \\quad x=0,1,...,\\var{n}\\]
\n", "advice": "", "rulesets": {}, "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"x1": {"name": "x1", "group": "Ungrouped variables", "definition": "random(0..n)", "description": "", "templateType": "anything", "can_override": false}, "x3": {"name": "x3", "group": "Ungrouped variables", "definition": "random(1..n)", "description": "", "templateType": "anything", "can_override": false}, "x2": {"name": "x2", "group": "Ungrouped variables", "definition": "random(0..n-1)", "description": "", "templateType": "anything", "can_override": false}, "n": {"name": "n", "group": "Ungrouped variables", "definition": "4", "description": "", "templateType": "number", "can_override": false}, "sample": {"name": "sample", "group": "Ungrouped variables", "definition": "\"X1,\\ X2,\\ X3,\\ X4\"", "description": "", "templateType": "anything", "can_override": false}, "x4": {"name": "x4", "group": "Ungrouped variables", "definition": "random(0..n)", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["x1", "x2", "x3", "x4", "sample", "n"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "Find the estimator for $t$ using the method of moments:
\nFind $E[X]$ as a function of $t$:
\n$E[X]=$[[0]]
\nFind the first sample moment $m_1$ as a function of $\\var{sample}$:
\n$m_1=$[[1]]
\nWrite the estimator for t:
\n$\\hat{t}=$[[2]]
\n", "gaps": [{"type": "jme", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "answer": "{n}*t", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "singleLetterVariables": false, "allowUnknownFunctions": true, "implicitFunctionComposition": false, "caseSensitive": false, "valuegenerators": [{"name": "t", "value": ""}]}, {"type": "jme", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "answer": "(X1+X2+X3+X4)/4", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "singleLetterVariables": false, "allowUnknownFunctions": true, "implicitFunctionComposition": false, "caseSensitive": false, "valuegenerators": [{"name": "x1", "value": ""}, {"name": "x2", "value": ""}, {"name": "x3", "value": ""}, {"name": "x4", "value": ""}]}, {"type": "jme", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "answer": "(X1+X2+X3+X4)/16", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "singleLetterVariables": false, "allowUnknownFunctions": true, "implicitFunctionComposition": false, "caseSensitive": false, "valuegenerators": [{"name": "x1", "value": ""}, {"name": "x2", "value": ""}, {"name": "x3", "value": ""}, {"name": "x4", "value": ""}]}], "sortAnswers": false}, {"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "Find the estimate of $t$ if the following numbers were observed:
\n\\[x1=\\var{x1},\\ x2=\\var{x2},\\ x3=\\var{x3}, \\ x4=\\var{x4}\\]
\n$\\hat{t}=$[[0]]
", "gaps": [{"type": "jme", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "answer": "({x1}+{x2}+{x3}+{x4})/(4*{n})", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "singleLetterVariables": false, "allowUnknownFunctions": true, "implicitFunctionComposition": false, "caseSensitive": false, "valuegenerators": []}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "type": "question"}, {"name": "Nikon's copy of Log-likelihood and maximum likelihood estimator for PDF", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}, {"name": "Nikon Kurnosov", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/28343/"}], "variable_groups": [], "variables": {"x": {"templateType": "anything", "group": "Ungrouped variables", "definition": "x1+x2+x3", "description": "", "name": "x"}, "tol": {"templateType": "anything", "group": "Ungrouped variables", "definition": "0", "description": "", "name": "tol"}, "x1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(2.5..5.5#0.5)", "description": "", "name": "x1"}, "prod": {"templateType": "anything", "group": "Ungrouped variables", "definition": "x1*x2*x3", "description": "", "name": "prod"}, "m": {"templateType": "anything", "group": "Ungrouped variables", "definition": "-precround(3/mle^2,2)", "description": "", "name": "m"}, "where": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random('North Shields','Owslebury','Bradfield in West Yorkshire','Sheffield','Windy Nook', 'Hepple','Leeming','Linton-on-Ouse','Scampton','Cranwell','Keele','Bingley', 'Ecclefechan','Finningley','Foxrock, Dublin')", "description": "", "name": "where"}, "x2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "if(y2=x1,y2+ random(-1..1#0.5),y2)", "description": "", "name": "x2"}, "y2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(3.5..6.5#0.5)", "description": "", "name": "y2"}, "sumsq": {"templateType": "anything", "group": "Ungrouped variables", "definition": "x1^2+x2^2+x3^2", "description": "", "name": "sumsq"}, "x3": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(2.5..7.5#0.5)", "description": "", "name": "x3"}, "mle": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(3/sumsq,2)", "description": "", "name": "mle"}}, "ungrouped_variables": ["prod", "mle", "m", "x1", "sumsq", "tol", "x3", "x2", "x", "y2", "where"], "rulesets": {"std": ["all", "fractionNumbers", "!collectNumbers", "!noLeadingMinus"]}, "functions": {}, "showQuestionGroupNames": false, "parts": [{"scripts": {}, "gaps": [{"answer": "({(8 *prod)} * (t ^ 3) * Exp(({( - sumsq)} * t)))", "vsetrange": [-0.2, -0.1], "scripts": {}, "checkvariablenames": false, "expectedvariablenames": [], "showpreview": true, "checkingtype": "absdiff", "checkingaccuracy": 0.001, "answersimplification": "std", "type": "jme", "showCorrectAnswer": true, "marks": 1, "vsetrangepoints": 5}], "type": "gapfill", "showCorrectAnswer": true, "prompt": "\n \n \nFind the likelihood function for $t$ given these observations.
\n \n \n \n$L(t|\\underline{x})=\\;\\;$[[0]]
\n \n ", "marks": 0}, {"scripts": {}, "gaps": [{"answer": "(Ln({(8 * prod)}) + (3 * Ln(t)) - ({sumsq} * t))", "vsetrange": [0, 1], "scripts": {}, "checkvariablenames": false, "expectedvariablenames": [], "showpreview": true, "checkingtype": "absdiff", "checkingaccuracy": 0.001, "answersimplification": "std", "type": "jme", "showCorrectAnswer": true, "marks": 1, "vsetrangepoints": 5}], "type": "gapfill", "showCorrectAnswer": true, "prompt": "Hence find the log-likelihood function for $t$
\n$l(t|\\underline{x})=\\;\\;$[[0]]
\nIf $\\ln(a)$, for some integer $a$, is a term in your answer, leave as $\\ln(a)$ and do not evaluate.
", "marks": 0}, {"scripts": {}, "gaps": [{"showPrecisionHint": false, "scripts": {}, "allowFractions": false, "type": "numberentry", "correctAnswerFraction": false, "minValue": "mle-tol", "showCorrectAnswer": true, "marks": 1, "maxValue": "mle+tol"}], "type": "gapfill", "showCorrectAnswer": true, "prompt": "Find the MLE $\\hat{t}$ for $t$
\n$\\hat{t}=\\;\\;$[[0]]
\nInput to 2 decimal places.
", "marks": 0}, {"scripts": {}, "gaps": [{"answer": "-(3/t^2)", "vsetrange": [0, 1], "scripts": {}, "checkvariablenames": false, "expectedvariablenames": [], "showpreview": true, "checkingtype": "absdiff", "checkingaccuracy": 0.001, "answersimplification": "std", "type": "jme", "showCorrectAnswer": true, "marks": 1, "vsetrangepoints": 5}, {"showPrecisionHint": false, "scripts": {}, "allowFractions": false, "type": "numberentry", "correctAnswerFraction": false, "minValue": "m-tol", "showCorrectAnswer": true, "marks": 1, "maxValue": "m+tol"}], "type": "gapfill", "showCorrectAnswer": true, "prompt": "Now verify that you have indeed found a maximum:
\n1. First find $\\displaystyle\\frac{\\partial^2\\;l}{\\partial\\;t^2}=\\;\\;$[[0]].
\n2. Using the value of the MLE to 2 decimal places you have found:
\n$\\displaystyle\\frac{\\partial^2\\;l}{\\partial\\;t^2}$ evaluated at $\\hat{t}$ = [[1]].
\nInput to 2 decimal places.
", "marks": 0}], "statement": "The average annual wind speed, $X$, at {where} has the following probability density function with parameter $t$ which you have to estimate:
\n$f_X(x) = \\left \\{ \\begin{array}{l} \\phantom{{.}} \\\\ \\phantom{{.}} \\\\ \\phantom{{.}} \\end{array} \\right .$ | \n$2txe^{-tx^2}$ | \n$x \\gt 0,$ | \n
\n | \n | |
$0$ | \n$\\textrm{otherwise.}$ | \n
For three randomly selected years, we observe the following average wind speeds:
\n$x_1=\\var{x1},\\;\\;x_2=\\var{x2}$ and $x_3=\\var{x3}$.
", "tags": ["checked2015", "cr1", "density function", "estimators", "likelihood functions", "log-likelihood function", "maximum", "maximum likelihood estimator", "mle", "MLE", "PDF", "pdf", "Probability", "probability", "probability density function", "random sample", "random variable", "sc", "second derivative", "statistics", "tested1", "unused"], "question_groups": [{"pickingStrategy": "all-ordered", "questions": [], "name": "", "pickQuestions": 0}], "preamble": {"css": "", "js": ""}, "type": "question", "metadata": {"notes": "14/07/2012:
\nAdded tags.
\nCorrected mistakes in Advice.
\nAdded some text to make statement clearer re parameter $t$.
\nRephrased questions in last question so that it is clear that the value to 2dps is used in the calculation.
\nSpaced Advice text.
\nNew tolerance variable, tol=0 for last two questions.
\nAdded line in prompt: If $\\ln(a)$, for some integer $a$, is a term in your answer, leave as $\\ln(a)$ and do not evaluate.
\nImproved display of correct answer in second question as $+\\;- $ together. Also improved correct answer display in second last question.
\nImportant: set checking range between -0.2 and -0.1 rather than between 0 and 1 so that evaluation of likelihood function over the range does not suffer from underflow and incorrect answer marked as correct. This needs constant testing, have tested on bounday values and OK.
\n1/08/2012:
\nAdded tags.
\nIn the Advice section, moved \\Rightarrow to the beginning of the line instead of the end of the previous line.
\n21/12/2012:
\nChecked calculations, OK. Added tested1 tag.
\nChecked rounding, OK. Added cr1 tag.
\nScenarios, so added sc tag.
", "licence": "Creative Commons Attribution 4.0 International", "description": "Given a PDF $f(x)$ on the real line with unknown parameter $t$ and three random observations, find log-likelihood and MLE $\\hat{t}$ for $t$.
"}, "variablesTest": {"condition": "", "maxRuns": 100}, "advice": "a)
\n\\[ \\begin{eqnarray*} L(t|\\underline{x})&=& \\var{2*x1}te^{-\\var{x1}^2t}\\times \\var{2*x2}te^{-\\var{x2}^2t} \\times \\var{2*x3}te^{-\\var{x3}^2t}\\\\ &=& \\var{8*prod}t^3e^{-\\var{sumsq}t} \\end{eqnarray*} \\]
b)
The log-likelihood function is :
\\[\\begin{eqnarray*} l(t|\\underline{x})&=&\\ln\\left( \\var{8*prod}t^3e^{-\\var{sumsq}t}\\right)\\\\ &=&\\ln(\\var{8*prod})+3\\ln(t)-\\var{sumsq}t \\end{eqnarray*} \\]
c)
\nWe have:
\\[\\frac{\\partial\\;l}{\\partial\\;t}=\\frac{3}{t}-\\var{sumsq}\\]
Now:
\\[\\begin{eqnarray*} \\frac{\\partial\\;l}{\\partial\\;t}&=&0 \\\\ \\Rightarrow \\frac{3}{t}-\\var{sumsq}&=&0\\\\ \\Rightarrow t&=&\\frac{3}{\\var{sumsq}} = \\var{mle} \\end{eqnarray*} \\] to 3 decimal places.
And putting $t=\\hat{t}$ gives the MLE $\\hat{t}=\\var{mle}$
d)
\\[\\frac{\\partial^2\\;l}{\\partial\\;t^2}=-3t^{-2} \\lt 0\\]
when evaluated at any point including $t=\\hat{t}=\\var{mle}$.
Hence gives a maximum at $t=\\hat{t}$.
"}, {"name": "Find maximum likelihood estimator of mean of normal distribution", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}], "variable_groups": [], "variables": {"w": {"group": "Ungrouped variables", "templateType": "anything", "definition": "if(r=4,1,0)", "name": "w", "description": ""}, "mlephi": {"group": "Ungrouped variables", "templateType": "anything", "definition": "precround(( t * ln(m/n+ b) + u * (a / (m/n + d)) + v * e ^ (m/(n*c)) + w * ((m/n) ^ 2 + g)),2)", "name": "mlephi", "description": ""}, "v": {"group": "Ungrouped variables", "templateType": "anything", "definition": "if(r=3,1,0)", "name": "v", "description": ""}, "b": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(1..9)", "name": "b", "description": ""}, "c": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(10..15)", "name": "c", "description": ""}, "var": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(10..30)", "name": "var", "description": ""}, "t": {"group": "Ungrouped variables", "templateType": "anything", "definition": "if(r=1,1,0)", "name": "t", "description": ""}, "a": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(2..9)", "name": "a", "description": ""}, "tol": {"group": "Ungrouped variables", "templateType": "anything", "definition": "0", "name": "tol", "description": ""}, "mlemu": {"group": "Ungrouped variables", "templateType": "anything", "definition": "precround(m/n,2)", "name": "mlemu", "description": ""}, "r": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(1..4)", "name": "r", "description": ""}, "n": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(15..30)", "name": "n", "description": ""}, "d": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(2..9)", "name": "d", "description": ""}, "g": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(2..9)", "name": "g", "description": ""}, "u": {"group": "Ungrouped variables", "templateType": "anything", "definition": "if(r=2,1,0)", "name": "u", "description": ""}, "m": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(150..500#5)", "name": "m", "description": ""}}, "ungrouped_variables": ["a", "c", "b", "d", "g", "m", "n", "w", "mlemu", "u", "t", "tol", "v", "var", "r", "mlephi"], "rulesets": {"std": ["all", "fractionNumbers", "!collectNumbers", "!noLeadingMinus"]}, "functions": {}, "showQuestionGroupNames": false, "parts": [{"scripts": {}, "gaps": [{"correctAnswerFraction": false, "showPrecisionHint": false, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "mlemu+tol", "minValue": "mlemu-tol", "showCorrectAnswer": true, "marks": 1}], "type": "gapfill", "prompt": "\n \n \nUsing this data find the MLE $\\hat{\\mu}$ of $\\mu$ .
\n \n \n \n$\\hat{\\mu}=\\;\\;$[[0]]
\n \n \n \nEnter to 2 decimal places.
\n \n \n ", "showCorrectAnswer": true, "marks": 0}, {"scripts": {}, "gaps": [{"correctAnswerFraction": false, "showPrecisionHint": false, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "mlephi+tol", "minValue": "mlephi-tol", "showCorrectAnswer": true, "marks": 1}], "type": "gapfill", "prompt": "Let \\[\\phi = \\simplify[std]{{t}*ln(mu+{b})+{u}*({a}/(mu+{d}))+{v}e^(mu/{c})+{w}*(mu^2+{g})}\\]
\nUsing the invariance property of maximum likelihood estimators, what is the MLE $\\hat{\\phi}$ of $\\phi$?
\n$\\hat{\\phi}=\\;\\;$[[0]] (make sure that you use an estimator for $\\mu$ which is accurate to 4 decimal places).
\nEnter to 2 decimal places.
", "showCorrectAnswer": true, "marks": 0}], "statement": "\nIn an experiment we take $\\var{n}$ observations $x_i$ from a Normal distribution with unknown mean $\\mu$ and variance $\\var{var}$.
\nFrom this sample we find:
\n\\[\\sum_{i=1}^{\\var{n}}x_i = \\var{m}\\]
\n ", "tags": ["checked2015", "cr1", "distributions", "functions", "invariance property of maximum likelihood estimators", "known variance", "MAS2302", "maximum likelihood estimator", "mean", "mean ", "mle", "MLE", "Normal distribution", "normal distribution", "query", "sample", "statistics", "sum of sample", "tested1", "unknown mean", "variance"], "question_groups": [{"pickingStrategy": "all-ordered", "questions": [], "name": "", "pickQuestions": 0}], "preamble": {"css": "", "js": ""}, "type": "question", "metadata": {"notes": "14/07/2012:
\nAdded tags.
\nNew tolerance variable t=0 for the numeric inputs.
\nChecked calculations.
\n1/08/2012:
\nAdded tags.
\nQuestion appears to be working correctly.
\n21/12/2012:
\n
Checked calculations for all functions appearing in this exercise. Added tested1 tag.
Rounding OK, added cr1 tag.
\nIn order to calculate the MLE for $\\phi$ need to use a more accurate value than that found for $\\mu$ to 2 decimal places. This is stated in the question now.
\nThere is no need to have the variance given. Added query tag for that.
\nAlso query the accuracy needed for the estimator of $\\mu$.
", "licence": "Creative Commons Attribution 4.0 International", "description": "Given sum of sample from a Normal distribution with unknown mean $\\mu$ and known variance $\\sigma^2$. Find MLE of $\\mu$ and one of four functions of $\\mu$.
"}, "variablesTest": {"condition": "", "maxRuns": 100}, "advice": "a)
The MLE $\\hat{\\mu}$ of $\\mu$ is given by dividing the sum of the sample by the number of samples i.e.
\\[\\hat{\\mu}=\\frac{\\var{m}}{\\var{n}}=\\var{mlemu}\\] to 2 decimal places.
\nb)
In order to find the MLE $\\hat{\\phi}$ of \\[\\phi=\\simplify[std]{{t}*ln(mu+{b})+{u}*({a}/(mu+{d}))+{v}e^(mu/{c})+{w}*(mu^2+{g})}\\]
we note that $\\phi$ is 1-1 and so we can directly substitute $\\mu=\\hat{\\mu}$ into this to obtain:
\n\\[\\hat{\\phi} = \\simplify[std]{{t} * Ln({m} / {n} + {b}) + {u} * ({a} / ({m} / {n} + {d})) + {v} * e ^ (({m} / {n}) / {c}) + {w} * (({m} / {n}) ^ 2 + {g})} = \\var{mlephi}\\]
\nto 2 decimal places.
"}, {"name": "Nikon's copy of 20122013 CBA1_1", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}, {"name": "Nikon Kurnosov", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/28343/"}], "parts": [{"scripts": {}, "gaps": [{"showPrecisionHint": false, "scripts": {}, "allowFractions": false, "type": "numberentry", "correctAnswerFraction": false, "minValue": "ans1-tol4", "showCorrectAnswer": true, "marks": 1, "maxValue": "ans1+tol4"}, {"showPrecisionHint": false, "scripts": {}, "allowFractions": false, "type": "numberentry", "correctAnswerFraction": false, "minValue": "ans2-tol3", "showCorrectAnswer": true, "marks": 1, "maxValue": "ans2+tol3"}], "type": "gapfill", "showCorrectAnswer": true, "prompt": "For $\\mu=\\var{m}$ calculate:
\n(i) $L(\\mu,\\underline{x})=\\;$? [[0]] (enter your answer to 4 decimal places).
\n(ii) $l(\\mu,\\underline{x})=\\;$? [[1]] (enter your answer to 3 decimal places).
", "marks": 0}, {"scripts": {}, "gaps": [{"showPrecisionHint": false, "scripts": {}, "allowFractions": false, "type": "numberentry", "correctAnswerFraction": false, "minValue": "ans3-tol3", "showCorrectAnswer": true, "marks": 1, "maxValue": "ans3+tol3"}], "type": "gapfill", "showCorrectAnswer": true, "prompt": "The maximum likelihood estimator $\\hat{\\mu}$ for $\\mu$ is: [[0]]
\n(enter your answer as a decimal to 3 decimal places)
", "marks": 0}], "variables": {"tol3": {"group": "Ungrouped variables", "templateType": "anything", "definition": "0.001", "name": "tol3", "description": ""}, "x2": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(0..5)", "name": "x2", "description": ""}, "x1": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(0..5 except x0)", "name": "x1", "description": ""}, "v": {"group": "Ungrouped variables", "templateType": "anything", "definition": "rowvector(x0,x1,x2)", "name": "v", "description": ""}, "ans1": {"group": "Ungrouped variables", "templateType": "anything", "definition": "precround(p[0]*p[1]*p[2],4)", "name": "ans1", "description": ""}, "x0": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(0..5)", "name": "x0", "description": ""}, "ans3": {"group": "Ungrouped variables", "templateType": "anything", "definition": "precround((x0+x1+x2)/3,3)", "name": "ans3", "description": ""}, "tol4": {"group": "Ungrouped variables", "templateType": "anything", "definition": "0.0001", "name": "tol4", "description": ""}, "p": {"group": "Ungrouped variables", "templateType": "anything", "definition": "[e^(-m)*m^x0/fact(x0),e^(-m)*m^x1/fact(x1),e^(-m)*m^x2/fact(x2)]", "name": "p", "description": ""}, "ans2": {"group": "Ungrouped variables", "templateType": "anything", "definition": "precround(ln(p[0]*p[1]*p[2]),3)", "name": "ans2", "description": ""}, "m": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(1..3#0.5)", "name": "m", "description": ""}}, "ungrouped_variables": ["tol3", "ans1", "ans2", "ans3", "m", "tol4", "p", "v", "x2", "x0", "x1"], "question_groups": [{"pickingStrategy": "all-ordered", "questions": [], "name": "", "pickQuestions": 0}], "functions": {}, "variable_groups": [], "variablesTest": {"condition": "", "maxRuns": 100}, "statement": "Suppose $\\underline{x}=\\var{v}$ is a vector of observations from a $\\operatorname{Poisson}(\\mu)$ distribution.
", "tags": ["MAS2302", "MLE", "Poisson", "Poisson parameter", "checked2015", "distributions", "likelihood", "log likelihood", "maximum likelihood estimator", "mle", "statistical distributions", "statistics"], "rulesets": {}, "preamble": {"css": "", "js": ""}, "type": "question", "metadata": {"notes": "26/01/2013:
\nFirst draft created.
", "licence": "Creative Commons Attribution 4.0 International", "description": "Given 3 observations from a $\\operatorname{Poisson}(\\mu)$ distribution find the likelihood, the log likelihood and the MLE for $\\mu$.
"}, "advice": "a) If there are 3 observations from $\\operatorname{Poisson}(\\mu),\\;(x_1,x_2,x_3)$ then:
\n(i) \\[\\operatorname{L}(\\mu|\\underline{x})=\\frac{e^{-\\mu}\\mu^{x_1}}{x_1!}\\times\\frac{e^{-\\mu}\\mu^{x_2}}{x_2!}\\times \\frac{e^{-\\mu}\\mu^{x_3}}{x_3!}\\]
\nFor this calculation $\\mu=\\var{m}$ and $(x_1,x_2,x_3)=\\var{v}$ and we obtain:
\n\\[\\operatorname{L}(\\mu|\\underline{x})=\\var{p[0]}\\times\\var{p[1]}\\times \\var{p[2]}=\\var{ans1}\\] to 4 decimal places.
\n(ii) \\[\\operatorname{l}(\\mu|\\underline{x})=\\ln(\\operatorname{L}(\\mu|\\underline{x}))=\\ln(\\var{p[0]}\\times\\var{p[1]}\\times \\var{p[2]})=\\var{ans2}\\]
\nto 3 decimal places.
\nb) The MLE is the mean of the observations i.e. \\[\\frac{\\var{x0}+\\var{x1}+\\var{x2}}{3} = \\var{ans3}\\] to 3 decimal places.
\n", "showQuestionGroupNames": false}, {"name": "Nikon's copy of Expectation and variance of combinations of estimators", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}, {"name": "Nikon Kurnosov", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/28343/"}], "variable_groups": [], "variables": {"b": {"templateType": "anything", "group": "Ungrouped variables", "definition": "'B'", "name": "b", "description": ""}, "e3": {"templateType": "anything", "group": "Ungrouped variables", "definition": "s3*m", "name": "e3", "description": ""}, "unb2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "if(unb1=0,1,random(0,1))", "name": "unb2", "description": ""}, "s7": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(1,-1)", "name": "s7", "description": ""}, "sqsum1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "cw1^2+cx1^2+cy1^2+cz1^2", "name": "sqsum1", "description": ""}, "wrong": {"templateType": "anything", "group": "Ungrouped variables", "definition": "if(unb1*unb2>0,'C',if(unb1=1,'B','A'))", "name": "wrong", "description": ""}, "t3": {"templateType": "anything", "group": "Ungrouped variables", "definition": "if(unb3=1,1,random(2..9))", "name": "t3", "description": ""}, "v1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "sqsum1*sd^2", "name": "v1", "description": ""}, "su2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "cw2+cx2+cy2+cz2", "name": "su2", "description": ""}, "p": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random('W','X','Y','Z')", "name": "p", "description": ""}, "cy1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "if(cx1=0,random(1..9),random(-9..9))", "name": "cy1", "description": ""}, "sd": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(2..6)", "name": "sd", "description": ""}, "cw1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(1..9)", "name": "cw1", "description": ""}, "t1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "if(unb1=1,1,random(2..9))", "name": "t1", "description": ""}, "tw": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(0,1)", "name": "tw", "description": ""}, "cy3": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(2..9)", "name": "cy3", "description": ""}, "sqsum2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "cw2^2+cx2^2+cy2^2+cz2^2", "name": "sqsum2", "description": ""}, "v3": {"templateType": "anything", "group": "Ungrouped variables", "definition": "sqsum3*sd^2", "name": "v3", "description": ""}, "s1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "cw1+cx1+cy1+cz1", "name": "s1", "description": ""}, "tol": {"templateType": "anything", "group": "Ungrouped variables", "definition": "0.01", "name": "tol", "description": ""}, "a": {"templateType": "anything", "group": "Ungrouped variables", "definition": "'A'", "name": "a", "description": ""}, "c": {"templateType": "anything", "group": "Ungrouped variables", "definition": "'C'", "name": "c", "description": ""}, "sqsum3": {"templateType": "anything", "group": "Ungrouped variables", "definition": "cw3^2+cx3^2+cy3^2+cz3^2", "name": "sqsum3", "description": ""}, "s2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "if(unb2=1,su2,su2+random(1..4))", "name": "s2", "description": ""}, "unb1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(0,1)", "name": "unb1", "description": ""}, "cz3": {"templateType": "anything", "group": "Ungrouped variables", "definition": "t3-cw3-cx3-cy3", "name": "cz3", "description": ""}, "cx2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(1..9)", "name": "cx2", "description": ""}, "cw3": {"templateType": "anything", "group": "Ungrouped variables", "definition": "tw*random(10..40)", "name": "cw3", "description": ""}, "sx": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(1,-1)", "name": "sx", "description": ""}, "correct2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "if(unb1=1,if(unb2=1,'B','C'),'C')", "name": "correct2", "description": ""}, "cw2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(1..9)", "name": "cw2", "description": ""}, "q": {"templateType": "anything", "group": "Ungrouped variables", "definition": "switch(p='X',random('W','Y','Z'),p='W',random('X','Y','Z'),p='Y',random('W','X','Z'),random('W','X','Y'))", "name": "q", "description": ""}, "e2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(su2*m/S2,2)", "name": "e2", "description": ""}, "e1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "s1*m", "name": "e1", "description": ""}, "m": {"templateType": "anything", "group": "Ungrouped variables", "definition": "s7*random(1..10)", "name": "m", "description": ""}, "correct1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "if(unb1=1,'A','B')", "name": "correct1", "description": ""}, "cz2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(1..9)", "name": "cz2", "description": ""}, "unb3": {"templateType": "anything", "group": "Ungrouped variables", "definition": "if(unb1*unb2>0,0,1)", "name": "unb3", "description": ""}, "cy2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(1..9)", "name": "cy2", "description": ""}, "cx1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(-9..9)", "name": "cx1", "description": ""}, "s3": {"templateType": "anything", "group": "Ungrouped variables", "definition": "cw3+cx3+cy3+cz3", "name": "s3", "description": ""}, "v2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(sqsum2*sd^2/S2^2,2)", "name": "v2", "description": ""}, "cx3": {"templateType": "anything", "group": "Ungrouped variables", "definition": "tx*sx*random(1..9)", "name": "cx3", "description": ""}, "cz1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "t1-cx1-cw1-cy1", "name": "cz1", "description": ""}, "tx": {"templateType": "anything", "group": "Ungrouped variables", "definition": "if(tw=0,1,0)", "name": "tx", "description": ""}}, "ungrouped_variables": ["cy3", "cy2", "cy1", "t3", "correct2", "correct1", "t1", "unb3", "unb2", "unb1", "s3", "tw", "s1", "s7", "tol", "cx1", "cx2", "cx3", "sqsum1", "sqsum3", "sqsum2", "cz2", "cz3", "cz1", "v1", "v2", "v3", "e1", "e3", "e2", "a", "c", "b", "tx", "cw1", "cw3", "cw2", "m", "wrong", "sx", "q", "p", "su2", "s2", "sd"], "question_groups": [{"pickingStrategy": "all-ordered", "questions": [], "name": "", "pickQuestions": 0}], "showQuestionGroupNames": false, "functions": {}, "parts": [{"scripts": {}, "gaps": [{"showPrecisionHint": false, "scripts": {}, "allowFractions": false, "type": "numberentry", "showCorrectAnswer": true, "minValue": "{e1}", "correctAnswerFraction": false, "marks": 1, "maxValue": "{e1}"}, {"showPrecisionHint": false, "scripts": {}, "allowFractions": false, "type": "numberentry", "showCorrectAnswer": true, "minValue": "{v1}", "correctAnswerFraction": false, "marks": 1, "maxValue": "{v1}"}], "type": "gapfill", "showCorrectAnswer": true, "prompt": "
$\\simplify[std]{A = {cw1} * W + {cx1} * X + {cy1} * Y + {cz1} * Z}$
\n$ \\operatorname{E}[A]=\\;\\;$[[0]]$\\;\\;\\;\\;\\operatorname{Var}(A)=\\;\\;\\;$[[1]]
\nInput both as integers.
", "marks": 0}, {"scripts": {}, "gaps": [{"showPrecisionHint": false, "scripts": {}, "allowFractions": false, "type": "numberentry", "showCorrectAnswer": true, "minValue": "{e2-tol}", "correctAnswerFraction": false, "marks": 1, "maxValue": "{e2+tol}"}, {"showPrecisionHint": false, "scripts": {}, "allowFractions": false, "type": "numberentry", "showCorrectAnswer": true, "minValue": "{v2-tol}", "correctAnswerFraction": false, "marks": 1, "maxValue": "{v2+tol}"}], "type": "gapfill", "showCorrectAnswer": true, "prompt": "$\\simplify[std]{B = (1 / {S2}) * ({cw2} * W + {cx2} * X + {cy2} * Y + {cz2} * Z)}$
\n$\\operatorname{E}[B]=\\;\\;$[[0]]$\\;\\;\\;\\;\\operatorname{Var}(B)=\\;\\;\\;$[[1]]
\nInput both to 2 decimal places.
", "marks": 0}, {"scripts": {}, "gaps": [{"showPrecisionHint": false, "scripts": {}, "allowFractions": false, "type": "numberentry", "showCorrectAnswer": true, "minValue": "{e3}", "correctAnswerFraction": false, "marks": 1, "maxValue": "{e3}"}, {"showPrecisionHint": false, "scripts": {}, "allowFractions": false, "type": "numberentry", "showCorrectAnswer": true, "minValue": "{v3}", "correctAnswerFraction": false, "marks": 1, "maxValue": "{v3}"}], "type": "gapfill", "showCorrectAnswer": true, "prompt": "$\\simplify[std]{C = {cw3} * W + {cx3} * X + {cy3} * Y + {cz3} * Z}$
\n$ \\operatorname{E}[C]=\\;\\;$[[0]]$\\;\\;\\;\\;\\operatorname{Var}(C)=\\;\\;\\;$[[1]]
\nInput both as integers.
", "marks": 0}, {"scripts": {}, "gaps": [{"displayType": "checkbox", "choices": ["$\\var{Correct1}$
", "$\\var{Correct2}$
", "$\\var{Wrong}$
"], "matrix": [1, 1, -1], "distractors": ["", "", ""], "minAnswers": 0, "maxAnswers": 0, "shuffleChoices": true, "scripts": {}, "maxMarks": 0, "type": "m_n_2", "minMarks": 0, "showCorrectAnswer": true, "displayColumns": 3, "marks": 0}], "type": "gapfill", "showCorrectAnswer": true, "prompt": "\n \n \nWhich of the estimators $A,\\;\\;B$ or $C$ above are unbiased for $\\mu$? Select the correct choices.
You will lose a mark for selecting a wrong choice.
[[0]]
\n \n ", "marks": 0}, {"scripts": {}, "gaps": [{"displayType": "radiogroup", "choices": ["$\\var{B}$
", "$\\var{A}$
", "$\\var{C}$
"], "matrix": [1, 0, 0], "distractors": ["", "", ""], "shuffleChoices": true, "scripts": {}, "maxMarks": 0, "type": "1_n_2", "minMarks": 0, "showCorrectAnswer": true, "displayColumns": 3, "marks": 0}], "type": "gapfill", "showCorrectAnswer": true, "prompt": "\n \n \nWhich of the estimators $A,\\;\\;B$ or $C$ above is the most efficient?
\n \n \n \n[[0]]
\n \n ", "marks": 0}, {"scripts": {}, "gaps": [{"showPrecisionHint": false, "scripts": {}, "allowFractions": false, "type": "numberentry", "showCorrectAnswer": true, "minValue": "{m^2}", "correctAnswerFraction": false, "marks": 1, "maxValue": "{m^2}"}], "type": "gapfill", "showCorrectAnswer": true, "prompt": "Find $\\operatorname{E}[\\var{p}\\var{q}]=\\;\\;$[[0]]
", "marks": 0}], "variablesTest": {"condition": "", "maxRuns": 100}, "statement": "Suppose $W,\\;\\;X,\\;\\;Y,\\;\\;$ and $Z$ are i.i.d. variables with mean $\\mu=\\var{m}$, standard deviation $\\sigma=\\var{sd}$
\nFind the expectation and variance of each of the following estimators of $\\mu$.
", "tags": ["IID", "MAS1604", "biased", "checked2015", "cr1", "efficient estimators", "estimators", "expectation", "i.i.d", "identical independent distributions", "iid", "independent identical distributions", "mean ", "random variables", "standard deviation", "statistics", "tested1", "unbiased", "unbiased estimators", "variance"], "rulesets": {"std": ["all", "fractionNumbers", "!collectNumbers", "!noLeadingMinus"]}, "preamble": {"css": "", "js": ""}, "type": "question", "metadata": {"notes": "13/07/2012:
\nAdded tags.
\nImproved and made consistent the display in various content areas.
\nSet new tolerance variable tol=0 for 2 dps numeric input questions.
\nAdded formula for $\\operatorname{Var}(aR+bS)$.
\nChecked calculation.
\nAdded description.
\n1/08/2012:
\nAdded tags.
\nQuestion appears to be working correctly.
\n21/12/2012:
\nChecked calculation, OK. Added tested1 tag.
\nChecked rounding, OK. Added tag cr1.
", "licence": "Creative Commons Attribution 4.0 International", "description": "Given three linear combinations of four i.i.d. variables, find the expectation and variance of these estimators of the mean $\\mu$. Which are unbiased and efficient?
"}, "advice": "We use the result throughout these solutions that for independent random variables $R$ and $S$ then $\\operatorname{E}[aR+bS]=a \\operatorname{E}[R]+b\\operatorname{E}[S]$ and $\\operatorname{Var}(aR+bS)=a^2\\operatorname{Var}(R)+b^2\\operatorname{Var}(S)$.
\na)
\\[\\begin{eqnarray*} \\operatorname{E}[A] &=& \\operatorname{E}[\\simplify[std]{{cw1} * W + {cx1} * X + {cy1} * Y + {cz1} * Z}]\\\\ &=& \\simplify[std]{{cw1} * {m} + {cx1} * {m} + {cy1} * {m} + {cz1} * {m}}\\\\ &=& \\var{e1}\\\\ \\\\ \\\\ \\operatorname{Var}(A) &=& \\operatorname{Var}[\\simplify[std]{{cw1} * W + {cx1} * X + {cy1} * Y + {cz1} * Z}]\\\\ &=& \\simplify[std]{ {cw1 ^ 2} * Var(W) + {cx1 ^ 2} * Var(X) + {cy1 ^ 2} * Var(Y) + {cz1 ^ 2} * Var(Z)}\\\\ &=& \\simplify[std]{{cw1 ^ 2} * {sd ^ 2} + {cx1 ^ 2} * {sd ^ 2} + {cy1 ^ 2} * {sd ^ 2} + {cz1 ^ 2} * {sd ^ 2} }\\\\ &=& \\var{v1} \\end{eqnarray*} \\]
b)
\\[\\begin{eqnarray*} \\operatorname{E}[B] &=& \\frac{1}{\\var{S2}}\\left(\\operatorname{E}[\\simplify[std]{{cw2} * W + {cx2} * X + {cy2} * Y + {cz2} * Z}]\\right)\\\\ &=& \\frac{1}{\\var{S2}}\\left(\\simplify[std]{{cw2} * {m} + {cx2} * {m} + {cy2} * {m} + {cz2} * {m}}\\right)\\\\ &=& \\var{e2}\\\\ \\\\ \\\\ \\operatorname{Var}(B) &=& \\frac{1}{\\var{S2^2}}\\left(\\operatorname{Var}[\\simplify[std]{{cw2} * W + {cx2} * X + {cy2} * Y + {cz2} * Z}]\\right)\\\\ &=& \\frac{1}{\\var{S2^2}}\\left(\\simplify[std]{ {cw2 ^ 2} * Var(W) + {cx2 ^ 2} * Var(X) + {cy2 ^ 2} * Var(Y) + {cz2 ^ 2} * Var(Z)}\\right)\\\\ &=& \\frac{1}{\\var{S2^2}}\\left(\\simplify[std]{{cw2 ^ 2} * {sd ^ 2} + {cx2 ^ 2} * {sd ^ 2} + {cy2 ^ 2} * {sd ^ 2} + {cz2 ^ 2} * {sd ^ 2} }\\right)\\\\ &=& \\var{v2} \\end{eqnarray*} \\]
c)
\\[\\begin{eqnarray*} \\operatorname{E}[C] &=& \\operatorname{E}[\\simplify[std,collectNumbers]{{cw3} * W + {cx3} * X + {cy3} * Y + {cz3} * Z}]\\\\ &=& \\simplify[std,collectNumbers]{{cw3} * {m} + {cx3} * {m} + {cy3} * {m} + {cz3} * {m}}\\\\ &=& \\var{e3}\\\\ \\\\ \\\\ \\operatorname{Var}(C) &=& \\operatorname{Var}[\\simplify[std]{{cw3} * W + {cx3} * X + {cy3} * Y + {cz3} * Z}]\\\\ &=& \\simplify[std]{ {cw3 ^ 2} * Var(W) + {cx3 ^ 2} * Var(X) + {cy3 ^ 2} * Var(Y) + {cz3 ^ 2} * Var(Z)}\\\\ &=& \\simplify[std]{{cw3 ^ 2} * {sd ^ 2} + {cx3 ^ 2} * {sd ^ 2} + {cy3 ^ 2} * {sd ^ 2} + {cz3 ^ 2} * {sd ^ 2} }\\\\ &=& \\var{v3} \\end{eqnarray*} \\]
d)
\nWe see that $\\var{Correct1},\\;\\;\\var{Correct2}\\;\\;$ are unbiased estimators for $\\mu=\\var{m}$ as their expectations are $\\var{m}$.
\ne)
\nThe most efficient estimator is $B$ as it has the smallest variance.
\nf)
Since $\\var{p}$ and $\\var{q}$ are independent we have:
$\\operatorname{E}[\\var{p}\\var{q}]=\\operatorname{E}[\\var{p}]\\operatorname{E}[\\var{q}] = \\var{m}\\times \\var{m} = \\var{m^2}$
"}]}], "allowPrinting": true, "navigation": {"allowregen": false, "reverse": true, "browse": true, "allowsteps": true, "showfrontpage": true, "navigatemode": "sequence", "onleave": {"action": "none", "message": ""}, "preventleave": true, "typeendtoleave": false, "startpassword": "", "autoSubmit": true, "allowAttemptDownload": false, "downloadEncryptionKey": "", "showresultspage": "review"}, "timing": {"allowPause": true, "timeout": {"action": "none", "message": ""}, "timedwarning": {"action": "none", "message": ""}}, "feedback": {"enterreviewmodeimmediately": false, "showactualmarkwhen": "inreview", "showtotalmarkwhen": "always", "showanswerstatewhen": "inreview", "showpartfeedbackmessageswhen": "never", "showexpectedanswerswhen": "inreview", "showadvicewhen": "inreview", "allowrevealanswer": false, "intro": "", "end_message": "", "results_options": {"printquestions": false, "printadvice": false}, "feedbackmessages": [], "reviewshowexpectedanswer": true, "showanswerstate": false, "reviewshowfeedback": true, "showactualmark": false, "showtotalmark": true, "reviewshowscore": true, "reviewshowadvice": true}, "diagnostic": {"knowledge_graph": {"topics": [], "learning_objectives": []}, "script": "diagnosys", "customScript": ""}, "contributors": [{"name": "Nikon Kurnosov", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/28343/"}], "extensions": ["stats"], "custom_part_types": [], "resources": []}