0% found this document useful (0 votes)
880 views9 pages

Sta 224 Computational Methods and Data Analysis Ii

The document is an examination paper for Karatina University's Bachelor of Actuarial Science program. It contains instructions for the exam, as well as 7 questions assessing computational methods and data analysis skills. Students are required to answer Section A and any 3 questions from Section B. The exam is 3 hours long and all working must be shown in the provided answer booklet. No mobile phones are allowed in the examination room.

Uploaded by

Kimondo King
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
880 views9 pages

Sta 224 Computational Methods and Data Analysis Ii

The document is an examination paper for Karatina University's Bachelor of Actuarial Science program. It contains instructions for the exam, as well as 7 questions assessing computational methods and data analysis skills. Students are required to answer Section A and any 3 questions from Section B. The exam is 3 hours long and all working must be shown in the provided answer booklet. No mobile phones are allowed in the examination room.

Uploaded by

Kimondo King
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

KARATINA UNIVERSITY

UNIVERSITY EXAMINATIONS
2016/2017 ACADEMIC YEAR
SECOND YEAR SECOND SEMESTER
EXAMINATION
FOR THE DEGREE OF BACHELOR OF ACTURIAL
SCIENCE
COURSE CODE: STA 224
COURSE TITLE: COMPUTATIONAL METHODS
AND DATA ANALYSIS II
DATE: 8th MAY 2017 TIME: 3
HOURS
INSTRUCTION TO CANDIDATES
1. ANSWER SECTION A AND ANY THREE QUESTIONS FROM SECTION B
2. DO ALL YOUR WORKINGS ON THE ANSWER BOOKLET PROVIDED
3. STRICTLY NO USE OF MOBILE PHONES IN THE EXAMINATION ROOM

STA 224 Page 1 of 4


SECTIONA

QUESTION ONE (15 marks)

a) Outline five components that one should consider in designing a


survey questionnaire
(5marks)
b) Outline four features of Matlab.
(4marks)
c) Write a simple code that can be used to solve the simultaneous
equations below using Matlab.
(3marks)

5x + 9y = 5

3x – 6y = 4

d) Use the forward-difference formula to determine f ' (0.6) given the


data below

(3marks)
x 0.5 0.6 0.7
f(x 0.47 0.56 0.64
) 94 46 42

QUESTION TWO (16 marks)

a) Define the term Data editing


(2marks)
b) Data editing process is divided into four major sub-process areas.
Highlight the four areas.
(4marks)

c) Use the Gauss- Seidel iterative technique to find approximate solutions


to

10 x1−x 2 +2 x3 =6,

−x 1 +11 x 2−x 3+3 x 4 =25

STA 224 Page 2 of 4


2 x 1−x 2 +10 x3 −x 4=−11

3 x2 −x3 +8 x 4 =15

t
0,0,0,0 ¿
Starting with x=¿ and iterate three times.

(10marks)

SECTION B

QUESTION THREE (13marks)

a) Write a code that can be used to creates a column vector with 5


elements in Matlab
(3marks)
b) Highlight the four elements that bring about Best Practice in tabular
presentation
(4marks)
c) Compare the trapezoidal rule and one third Simpsons rule

2
approximations to ∫ f ( x) dx when f ( x )=√ 1+x 2 with four
0

subdivisions (6marks)

QUESTION FOUR (13marks)

a) Express the Jacobi iteration method for the linear system A x=b
given by

10 x1−x 2 +2 x3 =6,

−x 1 +11 x 2−x 3+3 x 4 =25

STA 224 Page 3 of 4


2 x 1−x 2 +10 x3 −x 4=−11

3 x2 −x3 +8 x 4 =15

k k−1
in the form x =T x +c
(8marks)

b) Approximate the value of using 3/8 Simpson rule



4

 sin xdx
0

(5marks)

QUESTION FIVE (13marks)

a) Data Adjustment imputation can be manual or automated. Outline five main


categories under which automated data adjustment can be carried out.
(5marks)

b) Write a code that can be used to solve the following linear system of
0
equations using Jacobi method with ten iterations taking x =0

4 x 1 + x 2+ x3 =5

−x 1 +3 x 2+ x 3=−4

2 x 1 +2 x2 +5 x 3=1
(8marks)

QUESTION SIX (13marks)

a) Compute the eigenvalues and the associated eigenvectors of the


matrix
B= 3 4
1 0[ ]
(5marks)
b) Let H be an array, write a valid Matlab command that
i. Creates an identity matrix.
(1mk)

STA 224 Page 4 of 4


ii. Computes inverse of a matrix.
(1mk)
iii. Computes determinant of an array.
(1mk)
c) Create a Matlab code that can be used to solve f ' ' ( x) using the
second derivative midpoint formula for a set of data.
(5marks)

QUESTION SEVEN (13marks)

a) Use three-point midpoint formula to determine f ' (7.8) given the data
below

(4marks)

x 7.4 7.6 7.8 8.0


f(x - - - -
) 68.319 71.698 75.157 78.697
3 2 6 4

b) Create a valid code that solves the following system and displays only
e.

c=a+b , d=c+ asinb , e=5 d given that a=5 and b=7


(4marks)

c) Approximate the eigenvector corresponding to the dominant

[ ]
2 0 0
eigenvalue of the matrix A= 1 1 2 using the power method
1 −1 4

with four iterations (5marks)

STA 224 Page 5 of 4


MARKING SCHEME

QUESTION ONE (16 marks)

Write an expression that creates a row vector with 5 elements (2mks)


r = [7 8 9 10 11]

Components of a questionnaire:
1. Request for Cooperation—This might be a brief introductory
paragraph (or speech) at the beginning or could be a
comprehensive cover letter.
It should highlight the reason
for the survey, voluntary
participation, confidentiality, and willingness to provide a copy of results to
respondents if desired.
2. Instructions—Always simple, clear, and repetitive where necessary. Keep
to a minimum and make sure they are easy to administer if given by an
interviewer.
3. Actual Questions—See Sections on Question
Content and Question Formats.
4. Classification Data—Normally these are demographic information and
respondent characteristics to ensure the target population has been
sampled adequately.
5. Identification Data—This may include names, addresses, and telephone
numbers and/or identification numbers of participants to keep track of
respondents and to facilitate follow- up procedures.

Outline five features of MATLAB (5mks)

 It is a high-level language for numerical computation, visualization and application


development.

 It also provides an interactive environment for iterative exploration, design and problem
solving.

 It provides vast library of mathematical functions for linear algebra, statistics, Fourier
analysis, filtering, optimization, numerical integration and solving ordinary differential equations.

STA 224 Page 6 of 4


 It provides built-in graphics for visualizing data and tools for creating custom plots.

 MATLAB's programming interface gives development tools for improving code quality
and maintainability and maximizing performance.

 It provides tools for building applications with custom graphical interfaces.

 It provides functions for integrating MATLAB based algorithms with external applications
and languages such as C, Java, .NET and Microsoft Excel.

A simple code

s = solve('5*x + 9*y = 5','3*x - 6*y = 4');

s.x

s.y

QUESTION TWO (15 marks)

Define the term Data editing (2mks)

Data editing process is divided into four major sub-process areas. Highlight the four areas.
(4mks)
3^2 % 3 raised to the power of 2 (1mk)

SECTION B

QUESTION THREE (13marks)

Write an expression that creates a column vector with 5 elements (3mks)


c = [7; 8; 9; 10; 11]

Best practice in tabular presentation refers to designing tables that can be read easily
and quickly. The faster someone can read a table, the better it is (2mks)

Contrast: By making key elements of your table stand out from one another, you can

STA 224 Page 7 of 4


group or distinguish data from each other. For example, you could bold the title,
dividers, or headings. You can use different font sizes, styles, or letter cases for different
elements in your table. You can use color to emphasize backgrounds or text.

Regardless of which of these you choose for creating contrast, remember that "less is
more" when it comes to creating an effective table.

Alignment: Alignment is important for keeping your table neat and clear. For example,
all numbers in the columns should line up with each other and with their headings.
Structure your table so that all elements seem to be properly aligned with each other--
titles, headings, data, dividers, notes.

Ordering: Group items that are similar to give a sense of structure and meaning to your
table. This will also help break up the data, making it easier on the eye. Another way to
order data is to indent subordinate data when it falls below specific column data.

Spacing: Manipulating the "white areas" around the table can also help clarify and
organize the table. For example, you should always have enough space around and
between text so that it stands out. You can use space to separate groups or emphasize
them.

QUESTION FOUR (13marks)

QUESTION FIVE (13marks)

Automated imputations generally fall into one of five categories.

a. Deterministic - where only one correct value exists, as in the missing sum at the bottom
of a column of numbers. A value is thus determined from other values on the same
questionnaire.

b. Model based - use of averages, medians, regression equations, etc. to impute a value.

c. Deck - A donor questionnaire is used to supply the missing value.

Hot deck - a donor questionnaire is found from the same survey as the
questionnaire with the missing item. The "nearest neighbour" search technique
is often used to expedite the search for a donor record. In this search technique,
the deck of donor questionnaires come from the same survey and shows
similarities to the receiving record, where similarity is based on other data on the
questionnaire that correlates to the data being donated.

Cold deck - same as hot deck except that the data is found in a previously

STA 224 Page 8 of 4


conducted similar survey.

d. Mixed - In most systems there is usually a mixture of categories used in some fixed
ranked fashion for all items. Statistics Canada's GEIS (Generalized Edit and Imputation
System), for example, first uses a deterministic approach. If it is not successful, then a
hot
deck approach is tried. This is followed by a model based approach. If all these
approaches fail, then a manual imputation occurs through a human review process.

e. Expert Systems - Expert systems are only recently being applied to data editing and
much research is beginning in this area. "An expert system is an intelligent computer
program that uses knowledge and inference procedures to solve problems that are
difficult enough to require significant human expertise for their solution. Every expert
system consists of two principal parts: the knowledge base and the inference engine.
The knowledge base contains both factual and heuristic knowledge. Factual
knowledge is items commonly agreed upon by spokesmen in a particular field.
Heuristic knowledge is the less rigorous, more experiential and more judgmental
knowledge of performance or what commonly constitutes the rules of "good judgment"
or the art of "good guessing" in a field.

QUESTION SIX (13marks)

p ( A )=max | λ|where λ isan eigenvalue of A for λ=a+bi| λ|=√ (a 2+b 2)

Let H be an array, write a valid matlab command that (3mks)

Creates an identity matrix. Eye(H)

Computes inverse of a matrix. Inv(H)

Computes determinant of an array. det(H)

QUESTION SEVEN (13marks)

a = 5; b = 7;
c = a + b;
d = c + sin(b);
e=5*d

2
−( λ3−7 λ 2+ 16 λ−12 ) =−( λ−3 )( λ−2 ) λ=3∧λ=2

STA 224 Page 9 of 4

You might also like