MBA 728 Final (Financial Analysis) Flashcards

(200 cards)

1
Q

Which technique is used in regression analysis to minimize the sum of squared differences between observed and predicted values?
Question 1Answer

a.
Variance inflation factor analysis.

b.
Maximum likelihood estimation.

c.
Least squares method.

d.
Mean imputation.

A

C

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is a characteristic pattern of the ACF for an MA(1) process?
Question 2Answer

a.
It shows a sharp cutoff after lag 1.

b.
It oscillates without decaying.

c.
It remains constant for all lags.

d.
It increases exponentially with lag.

A

A

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is a distinctive property of the autocorrelation function (ACF) of a moving average MA(q) process?
Question 3Answer

a.
It increases with larger lags.

b.
All autocorrelations beyond lag q are zero.

c.
It oscillates between positive and negative values.

d.
It shows a gradual decay over time.

A

B

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

In logistic regression, what does the term ‘log odds’ refer to?
Question 4Answer

a.
The ratio of the number of events to non-events.

b.
The natural log of the odds of the dependent variable event occurring.

c.
A transformation of the independent variable.

d.
The probability of the dependent variable occurring.

A

B

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How could the matrix be constructed by using the following R code? m <- matrix(1:6, nrow = 2, ncol = 3)
Question 5Answer

a.
column-wise

b.
any manner

c.
row-wise

d.
data insufficient

A

A
Matrix() defualts to column-wise unless specifically told otherwise

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What would be the output of the following code? x <- 20; y <- 5; z <- x / y
Question 6Answer

a.
[1] 4

b.
[1] 15

c.
[1] 25

d.
[1] 0.25

A

A

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What will be the output of the following R code?

x <- 4

while (x < 9) {

x <- x + 2

if (x == 8)

break

print(x)

}
Question 7Answer

A.
[1] 6

[1] 8

B.
[1] 4

[1] 6

[1] 8

C.
[1] 6

D.
[1] 4

[1] 6

[1] 10

A

C

(x==8) means to not include 8, so it would just be 6

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How do you create a character vector in R?
Question 8Answer

a.
vec(“AAA”, “AA”, “BBB”, “BB”, “B”)

b.
set(“AAA”, “AA”, “BBB”, “BB”, “B”)

c.
character(“AAA”, “AA”, “BBB”, “BB”, “B”)

d.
c(“AAA”, “AA”, “BBB”, “BB”, “B”)

A

D

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What does autocorrelation measure?
Question 9Answer

a.
Quadratic dependence between two points on the same series observed at different times.

b.
Degree of correlation between multiple points on the different series observed at different times.

c.
Linear dependence between two points on different series observed at same time.

d.
Degree of correlation between two points on the same series observed at different times.

A

D

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

In R, when dealing with two vectors of unequal length, the shorter vector is recycled until it matches the length of the longer vector. If x <- c(1, 2, 3) and y <- c(1, 2), what will be the result of x + y?
Question 10Answer

a.
[1] 2 4 5

b.
Error due to different lengths

c.
[1] 2 4 4

d.
[1] 2 4 3

A

C

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How can you create a weighted average in R?
Question 11Answer

a.
By multiplying a vector with weights

b.
Using the sum() function

c.
Using the mean() function

d.
Applying the median() function

A

A

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is indicated by a gradual decay in the ACF and a sharp cutoff in the PACF?
Question 12Answer

a.
The series is non-stationary.

b.
An MA process is present.

c.
The series is over-differenced.

d.
An AR process is present.

A

D

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What would be the output of the following code?

numbers <- c(1, 4, 5, 8, 10, 12, 15)

count <- 0

for (num in numbers) {

if (num %% 2 != 0)

count = count + 1

}

print(count)
Question 13Answer

A.
[1] 6

B.
[1] 3

C.
[1] 4

D.
[1] 5

A

B

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What will be the output of the following function when called as calculateDifference(8, 3)? calculateDifference <- function(a, b) {diff <- abs(a - b) return(diff)}
Question 14Answer

a.
5

b.
3

c.
11

d.
24

A

A

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What will be the output of the following code?

numbers <- c(4, 2, 7, 9, 10, 3, 5)

count <- 0

for (num in numbers) {

if (num %% 2 == 0)

count = count + 1

}

print(count)
Question 15Answer

A.
[1] 3

B.
[1] 4

C.
[1] 4 2 10

D.
[1] 7 9 3 5

A

A

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

In time series analysis, what does first differencing help to remove?
Question 16Answer

a.
Mean

b.
Trend

c.
Correlation

d.
Variance

A

B

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

You intend to print numbers divisible by 5, from 20 to 50. What should replace the blank in this code?

x <- 20

while ______?______ {

if (x %% 5 == 0) {

print(x)

}

x <- x + 1

}
Question 17Answer

A.
(x > 19 & x <= 50)

B.
(x < 50)

C.
(x >= 20 & x < 50)

D.
(x >= 20)

A

A

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

You want to print numbers greater than 50 in the following vector. What should be in the blank?

x <- c(42, 55, 60, 47, 53, 49, 68)

for (i in x) {

if _____?______ {

print(i)

}

}
Question 18Answer

A.
(i > 50)

B.
(i < 50)

C.
(i = i + 10)

D.
(i %% 10 == 0)

A

A

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

In multiple regression, the presence of an interaction term implies that the effect of one predictor on the response variable depends on the value of another predictor.
Question 19Answer

a.
TRUE

b.
FALSE

A

A

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

If the 95% one-day VaR for a portfolio is $500,000, what does it imply?
Question 20Answer

a.
In 95% of days, the portfolio will lose more than $500,000.

b.
The portfolio has a 95% chance of losing exactly $500,000 in a single day.

c.
The portfolio will lose $500,000 over the course of 95 days.

d.
There is a 5% probability that the portfolio will lose more than $500,000 in one day.

A

D

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

In the context of risk management, why is Expected Shortfall (ES) often preferred over VaR?
Question 21Answer

a.
ES provides a more detailed analysis of the potential maximum loss.

b.
ES takes into account the magnitude of extreme losses.

c.
ES is less affected by the volatility of the market.

d.
ES is based on a more realistic distribution of returns.

A

B

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

How is the optimal portfolio on the efficient frontier typically determined?
Question 22Answer

a.
By choosing the portfolio with the most assets.

b.
Based on the portfolio with the lowest risk.

c.
By selecting the portfolio with the highest return irrespective of risk.

d.
Through the portfolio that offers the best trade-off between risk and return.

A

D

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

What does 5*9 evaluate to in R?
Question 23Answer

a.
54

b.
45

c.
14

d.
15

A

B

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

A linear regression model is only valid if the residuals are normally distributed.
Question 24Answer

a.
FALSE

b.
TRUE

A

A

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
In portfolio construction, what is the significance of a negative covariance between two assets? Question 25Answer a. Negative covariance implies that the assets are unrelated. b. It means the assets will have the same returns. c. It suggests that the assets move in opposite directions, which can reduce risk. d. It indicates that the assets are likely to move in the same direction.
C
26
The Adjusted R-squared value can be used to compare models with a different number of predictors. Question 26Answer a. TRUE b. FALSE
A
27
In logistic regression, the role of the predictor (independent variable) is to: Question 27Answer a. Be discrete, continuous, or a combination thereof b. Always be a binary variable c. Undergo a logarithmic transformation before the analysis d. Fall within the range of 0 to 1
A
28
Which statement about the efficient frontier of risky assets is CORRECT? Question 28Answer a. All portfolios on the efficient frontier offer the lowest possible variance for their level of expected return. b. Portfolios on the efficient frontier represent the highest risk options available for any level of expected return. c. The efficient frontier includes individual assets as well as portfolios. d. The efficient frontier only includes portfolios with the lowest expected return for a given risk level.
A
29
In the context of portfolio theory, what is meant by 'systematic risk'? Question 29Answer a. The risk associated with individual stocks. b. The risk resulting from the portfolio's asset allocation. c. The risk that can be eliminated through diversification. d. The risk inherent to the entire market or market segment.
D
30
Which outcome is most likely when investing in a portfolio with assets that have high positive correlation? Question 30Answer a. Increased diversification benefits. b. Limited diversification benefits. c. Decreased overall risk of the portfolio. d. Transformation of unsystematic risk into systematic risk.
B
31
What would be the output of the following code? temperature <- -5 if (temperature < 0) { print("Freezing") } else if (temperature >= 0 & temperature < 20) { print("Cold") } else if (temperature >= 20 & temperature < 35) { print("Warm") } else { print("Hot") } Question 31Answer A. [1] "Warm" B. [1] "Hot" C. [1] "Cold" D. [1] "Freezing"
D
32
Which command in R is used to create a vector containing the values 1, 2, 3, 4, and 5? Question 32Answer a. 1:5 b. seq(1, 5) c. sequence(1:5) d. vector(1, 5)
A
33
Which component of time series analysis is intended to capture fluctuations that are not of a fixed frequency? Question 33Answer a. Irregular b. Seasonal c. Cyclical d. Trend
C Gemini Got this Wrong Saying it was A "Irregular"
34
What does the command 2^4 return in R? Question 34Answer a. 4 b. 8 c. 64 d. 16
D
35
In R, how do you create a factor with levels "Low", "Medium", "High", and "Very High"? Question 35Answer a. levels(c("Low", "Medium", "High", "Very High")) b. create.factor("Low", "Medium", "High", "Very High") c. factor(c("Low", "Medium", "High", "Very High")) d. c("Low", "Medium", "High", "Very High")
C
36
Which function in R is used to check the frequency of a time series dataset? Question 36Answer a. acf() b. ts.plot() c. diff() d. frequency()
D
37
You aim to print multiples of 3 between 10 and 30. Fill in the blank in the following code: x <- 10 while ______?______ { if (x %% 3 == 0) { print(x) } x <- x + 1 } Question 37Answer A. (x > 9) B. (x < 30) C. (x >= 10 & x < 30) D. (x >= 10 & x <= 30)
D
38
What does the following R function do when called with isOdd(7)? isOdd <- function(x) {x %% 2 != 0} Question 38Answer a. Returns TRUE if x is even b. Returns TRUE if x is odd c. Divides x by 2 d. Multiplies x by 2
B
39
A high R-squared value always means that the regression model has accurately captured the underlying relationship between the variables. Question 39Answer a. FALSE b. TRUE
A
40
What characteristic of the logistic function makes it suitable for logistic regression? Question 40Answer a. Its linear relationship with the predictors. b. Its output ranging between 0 and 1, representing probabilities. c. Its similarity to the linear regression model. d. Its ability to take any real-value number.
B
41
What is the output of the following code? x <- 5 y <- if (x > 10) { print("LARGE") } else { print("SMALL") } Question 41Answer A. [1] NA B. [1] "SMALL" C. [1] "LARGE" D. Error Message
B
42
Suppose you invest in $1000 into your mutual fund account on January 1st, 2020. Which of the following code is CORRECT to calculate the account balance at the end of March, 2020 if the account carries a rate of return of 2% every month? Question 42Answer a. 1000 * (1.02) ^ 2 b. 1000 * 0.02 * 3 c. 1000 * (1.02) ^ 3 d. 1000 * (0.02) ^ 3
C
43
The partial autocorrelation function in time series analysis is useful for: Question 43Answer a. Determining the dependence on past values b. Identifying the seasonal component c. Assessing the overall variability d. Estimating the trend component
A
44
In the context of AR models, what does the acronym ACF stand for? Question 44Answer a. Autocorrelation Function b. Auto Calculated Forecast c. Autoregressive Cumulative Frequency d. Automatic Correction Feature
A
45
What is the key characteristic of the Capital Allocation Line (CAL) when a risk-free asset is introduced? Question 45Answer a. It represents the highest risk portfolios available. b. The CAL is tangent to the efficient frontier at the optimal portfolio. c. It signifies portfolios with the lowest possible returns. d. The CAL has no relevance in the presence of a risk-free asset.
B
46
Expected Shortfall (ES) is considered a better risk measure than Value at Risk (VaR) because: Question 46Answer a. It only considers the average loss in the worst-case scenarios. b. It is easier to calculate than VaR. c. It requires less data to compute accurately. d. It accounts for all possible losses beyond the VaR threshold.
D
47
How can you convert a date to a numeric value in R? Question 47Answer a. as.Date() b. as.numeric() c. format() d. convert()
B
48
What would be the output of the following code? x <- c(4:8); y <- x*3; y Question 48Answer a. [1] 7 9 11 13 15 b. [1] 12 15 18 21 24 c. [1] 12 24 d. [1] 12 15 18 21 24 27
B
49
What will be the output of the following R code? func <- function(x) { x^2 - 2*x + 1 } func(4) Question 49Answer a. [1] 5 b. [1] 17 c. [1] 9 d. [1] 7
C
50
What is indicated by the head(x) command in R? Question 50Answer a. It shows the last six rows of x b. It displays the entire dataset c. It converts the data into xts format d. It reveals the first six rows of x
D
51
The logistic regression model is used when the outcome variable is: Question 1Answer a. A high-dimensional data set. b. A categorical variable with two levels (binary). c. A continuous variable. d. A time-series data.
B Gemini got this wrong saying it was A
52
What is the length of the vector v <- c(5:15)? Question 2Answer a. 11 b. 15 c. 5 d. 10
A
53
What would be the output of the following code? x <- c(2, 6, 3, 9, 12, 4); (x > 8) | (x <= 3) Question 3Answer a. [1] FALSE FALSE FALSE FALSE FALSE FALSE b. [1] TRUE TRUE TRUE TRUE FALSE FALSE c. [1] FALSE TRUE FALSE FALSE FALSE TRUE d. [1] TRUE FALSE TRUE TRUE TRUE FALSE
D
54
What is the primary use of the ifelse() function in R? Question 4Answer a. To create loops b. To choose between two alternatives c. To execute a single condition d. To define variables
B
55
In time series analysis, what is indicated by a lag 1 autocorrelation? Question 5Answer a. Correlation between values one time period apart b. Correlation between values two time periods apart c. Non-stationarity of the series d. Independence of the series
A
56
What does the c() function do in R? Question 6Answer a. Concatenates strings b. Converts data types c. Computes the cosine d. Creates a vector
D
57
What will be the output of the following function when called as isP(5)? isP <- function(n) {if (n <= 1) return(FALSE) for (i in 2:(n - 1)) { if (n %% i == 0) return(FALSE)} return(TRUE)} Question 7Answer a. NULL b. Error c. FALSE d. TRUE
D 5 %% 2:4 == 0 (if not then "True") 5 %% 2 = False 5 %% 3 = False 5 %% 4 = False Therefore, D. True
58
What does it mean if the residuals of a fitted time series model are white noise? Question 8Answer a. The model has overfitted the data. b. The model has not captured any systematic information in the data. c. The model has perfectly predicted all future values. d. The model has captured the systematic structure in the data.
D
59
A random walk process is characterized by: Question 9Answer a. Predictable changes b. Dependence on past values and white noise error c. Seasonal patterns d. Constant variance
B
60
What impact does the introduction of a risk-free asset have on the efficient frontier of risky assets? Question 10Answer a. The efficient frontier becomes irrelevant with a risk-free asset. b. It creates a new set of portfolios that dominate the efficient frontier. c. The efficient frontier shifts to include only high-risk portfolios. d. It eliminates the efficient frontier completely.
B
61
What is the primary effect of including a risk-free asset in a portfolio of risky assets? Question 11Answer a. It creates an opportunity to form a Capital Allocation Line (CAL). b. It decreases the portfolio's expected return. c. It increases the overall risk of the portfolio. d. It has no significant effect on the portfolio's risk or return.
A
62
What does 9 %% 4 return in R? Question 12Answer a. 4 b. 5 c. 1 d. 0
C
63
What is the output of this code? y <- 5 while (y > 1) { y <- y - 1 print(y) } Question 13Answer A. [1] 1 [1] 2 [1] 3 [1] 4 B. [1] 4 [1] 3 [1] 2 [1] 1 C. [1] 4 [1] 3 [1] 2 D. [1] 5 [1] 4 [1] 3 [1] 2
B 1 is included because the "while" comes before print. So in the last loop: While (2 > 1)? Yes, continue y <- 2-1 It matters where they "print()" is in the code.
64
How is the Total Sum of Squares (TSS) calculated in regression analysis? Question 14Answer a. By multiplying the sum of squared residuals with the degrees of freedom b. By summing the squared difference between predicted and actual values. c. By summing the squared differences between actual values and the mean of the dependent variable. d. By dividing the sum of squares by the number of observations
C
65
What is an important feature of logistic regression in terms of prediction? Question 15Answer a. It can predict precise numerical outcomes. b. It always requires large sample sizes. c. It is used to predict the mean of the data. d. It predicts the probability of different categorical outcomes.
D
66
How does the variance of a portfolio change with the addition of assets with low or negative correlation? Question 16Answer a. It remains constant regardless of the assets' correlation. b. The variance of the portfolio increases significantly. c. The variance decreases, offering better risk-return opportunities. d. The change in variance is unpredictable and random.
C
67
What is demonstrated by daily_xts <- xts(x = daily_data, order.by = dates) in R? Question 17Answer a. Generating random numbers b. Merging two datasets c. Creating a time series object d. Reading data from a CSV file
C
68
How can you tell if an ARMA model's residuals look like white noise? Question 18Answer a. No autocorrelations exist at any lag. b. There are significant autocorrelations at all lags. c. The residuals vary widely from 0. d. The residuals display a clear increasing or decreasing trend.
A
69
Suppose you have a portfolio. The value at risk of your portfolio is: Question 19Answer a. the portfolio loss that you may experience with a certain probability in the worst case b. the standard deviation of your portfolio over a specified holding period c. the average portfolio loss that you may experience over a specified holding period d. the amount of capital needed to recover your portfolio loss
A
70
The 99% value at risk means that: Question 20Answer a. there is 99% chance that the loss will exceed the value at risk b. there is 1% chance that the loss will not exceed the value at risk c. there is 99% chance that the expected shortfall will exceed the value at risk d. there is 1% chance that the loss will exceed the value at risk
D
71
What is the primary purpose of using seasonal differencing in time series analysis? Question 21Answer a. To address seasonality in the data b. To enhance the trend c. To identify irregular components d. To calculate the mean
A
72
The pacf is necessary for distinguishing between Question 22Answer a. an MA and an ARMA model b. different models from within the ARMA family c. an AR and an ARMA model d. an AR and an MA model
C Gemini & ChatGPT thought it was D Prof's Explanation: Looking at the ACF, we can distinguish between MA and AR/ARMA. Then, the PACF is necessary for distinguishing between AR and ARMA because it cuts off after lag p in AR(p) and tails off in ARMA(p, q).
73
What would be the output of the following code? x <- "5"; class(x) Question 23Answer a. [1] "matrix" b. [1] "numeric" c. [1] "character" d. [1] "logical"
C It is not numeric becuase anything enclosed in " " is treated as a charcter string in R
74
A while loop in R is used to: Question 24Answer a. Repeat a code block until a condition is met b. Repeat a code block a fixed number of times c. Execute a code block once d. Skip a code block
A
75
What would be the output of the following R code? f <- function(x) { x + 2 } f(5) Question 25Answer a. [1] 7 b. [1] 8 c. [1] 10 d. [1] 5
A
76
In R, how is the 'Recycling Rule' applied when you add two vectors, x <- c(1, 2, 3) and y <- c(1, 2)? Question 26Answer a. y is recycled to match the length of x. b. x is truncated to match the length of y. c. It results in an error. d. Only the first two elements of x are used.
A
77
In a time series, what does the presence of a linear increasing trend usually suggest? Question 27Answer a. There is high seasonality b. The series is stationary c. The need for differencing to achieve stationarity d. The series is weakly stationary
C
78
In the context of the efficient frontier, what does the global minimum-variance portfolio represent? Question 28Answer a. The portfolio with the highest possible return for any level of risk. b. The portfolio that includes only risk-free assets. c. The portfolio with the lowest possible risk across all portfolios. d. The portfolio with the least amount of systematic risk.
C
79
In portfolio theory, how is the risk (standard deviation) of a portfolio affected by adding an asset with a negative correlation to existing assets? Question 29Answer a. The change in risk depends on the asset's return, not its correlation. b. The portfolio's risk decreases. c. The portfolio's risk remains unchanged. d. The portfolio's risk increases.
B
80
What is the result of executing this code? x <- -10 y <- if (x >= 0) { print("POSITIVE") } else { print("NEGATIVE") } Question 30Answer A. [1] "NEGATIVE" B. [1] NA C. [1] "POSITIVE" D. Error Message
A
81
In regression analysis, what is the purpose of conducting an ANOVA (Analysis of Variance)? Question 31Answer a. To test the significance of individual predictors b. To determine the overall fit of the model c. To calculate the mean value of the response variable d. To plot the regression line
B
82
What function is used to convert a numeric vector into an R time series object? Question 32Answer a. as.xts() b. rnorm() c. ts() d. seq()
C
83
What does the acronym ARMA stand for in time series analysis? Question 33Answer a. Autocorrelation Regression Model Analysis b. Automated Regression and Mean Analysis c. Analysis of Residuals and Mean Approximation d. Autoregressive Moving Average
D
84
What does the autocorrelation function (ACF) primarily reveal in a time series? Question 34Answer a. The mean and variance b. The overall direction of the data c. The correlation between lagged values of the series d. The presence of a linear trend
C
85
Consider the following function in R. What does it return when called with power(2, 3)? power <- function(x, n) {x^n} Question 35Answer a. 9 b. 6 c. 4 d. 8
D
86
In R, a while loop is most appropriate when: Question 36Answer a. The number of iterations is unknown and depends on a condition b. You only need to execute the loop once c. You need to iterate over a list d. You have a fixed number of iterations
A
87
What is the result of 3 + 4 in R? Question 37Answer a. 7 b. 12 c. 34 d. Error
A
88
How do you add names to each element in a numeric vector ret in R? Question 38Answer a. annotate(ret) <- c("Name1", "Name2") b. label(ret) <- c("Name1", "Name2") c. name(ret) <- c("Name1", "Name2") d. names(ret) <- c("Name1", "Name2")
D
89
What does the term 'partial regression coefficient' in multiple regression analysis refer to? Question 39Answer a. The coefficient that measures the relationship between two predictor variables. b. The average change in the response variable for a one-unit change in the predictor, holding other predictors constant. c. The coefficient obtained from univariate regression of each predictor. d. The change in the response variable when all predictors are set to zero.
B
90
A regression model with an R-squared value of 1 indicates a perfect fit to the data with no prediction error. Question 40Answer a. TRUE b. FALSE
A
91
If the 95% one-day VaR for an investment is $5,000 and the average loss for the worst 5% of days is $7,000, what is the Expected Shortfall (ES) at the 95% confidence level? Question 41Answer a. $7,000 b. $6,000 c. $12,000 d. $5,000
A
92
Calculate the ending balance of a $2,500 investment after 1 year with a monthly return of 1%. Question 42Answer a. 2500 * 0.01 * 12 b. 2500 * (0.01) ^ 12 c. 2500 * (1.01) ^ 12 d. 2500 * (1.01) ^ 11
C
93
You want to print all odd numbers from 5 to 15. Which of the following codes could be in the blank? x <- 5 while ______?______ { if (x %% 2 != 0) { print(x) } x <- x + 1 } Question 43Answer A. (x >= 5 & x <= 15) B. (x > 4 & x < 15) C. (x < 15) D. (x > 5)
A
94
What would be the output of the following code? class(3 < 6) Question 44Answer a. [1] "matrix" b. [1] "numeric" c. [1] "character" d. [1] "logical"
D
95
What is a key characteristic of a portfolio on the efficient frontier? Question 45Answer a. It guarantees no loss of principal. b. It consists solely of the highest returning assets. c. It offers the highest return for a given level of risk. d. It contains only risk-free investments.
C
96
What would be the output of the following code? x <- matrix(data = c(1, 7, 4, 9), nrow = 2, ncol = 2) x Question 46Answer A. [,1] [,2] [1,] 9 7 [2,] 4 1 B. [,1] [,2] [1,] 1 9 [2,] 4 7 C. [,1] [,2] [1,] 1 7 [2,] 4 9 D. [,1] [,2] [1,] 1 4 [2,] 7 9
D This is calling for 2 rows & 2 columns Matrices default to columns first, so 1 & 7 go in the firts column since there are 2 rows. 4 & 9 go into the second column Therefore D
97
Which of the following is an example of a vector in R? Question 47Answer a. Sys.Date() b. c("2019-01-01", "2019-01-02") c. "2019-01-01" d. 100
B
98
In logistic regression, the outcome variable is typically: Question 48Answer a. Continuous and normally distributed. b. Any type, including numeric or categorical. c. Categorical, often binary. d. A ratio or interval variable.
C
99
Which command in R is used to assign the numeric value 120 to a variable samsung_stock? Question 49Answer a. samsung_stock == 120 b. samsung_stock = 120 c. assign(samsung_stock, 120) d. samsung_stock <- 120
D
100
Linear regression can only be used with quantitative predictor variables. Question 50Answer a. FALSE b. TRUE
A
101
When simulating an AR(1) process, what does setting the mean μ = 0 ensure? Question 1Answer a. The series starts at a value of 0. b. The mean of the series does not contribute to its variation. c. The process will have a strong upward trend. d. The process will have a strong seasonal component.
B
102
What would be the output of the following code? x <- c(2:6); x < 4 Question 2Answer a. [1] 2 3 b. [1] TRUE TRUE FALSE FALSE FALSE c. [1] TRUE TRUE TRUE FALSE FALSE d. [1] 2 3 4
B
103
What is the purpose of the 'cor()' function in R in the context of regression analysis? Question 3Answer a. To perform correlation analysis between variables b. To plot a scatter plot c. To calculate the regression coefficients d. To standardize variables
A
104
What does the command rbind(stock1, stock2) do in R? Question 4Answer a. Combines two stock vectors side by side. b. Binds two stock vectors or data frames by rows. c. Calculates the return between stock1 and stock2. d. Merges the data of stock1 and stock2 into a single vector.
B
105
In logistic regression, the intercept can be interpreted as: Question 5Answer a. The slope of the logistic regression model. b. An adjustable parameter to increase model accuracy. c. The log odds of the outcome when all predictor variables are zero. d. The expected mean value of the response variable.
C
106
Determine the output of the following code: x <- 15 y <- if (x %% 5 == 0) { print("DIVISIBLE") } else { print("NOT DIVISIBLE") } Question 6Answer A. [1] "DIVISIBLE" B. [1] "NOT DIVISIBLE" C. Error Message D. [1] NA
A
107
What will the following R function output when called as greetPerson("Alice")? greetPerson <- function(name) {paste("Hello", name, "!")} Question 7Answer a. "Alice!" b. "Hello" c. "Hello Alice!" d. "greetPerson Alice"
C
108
Choose the correct code for the output: _____?______ if (Netflix > 500) { print("Netflix is greater than 500") } else { print("Netflix is less than or equal to 500") } [1] "Netflix is less than or equal to 500" Question 8Answer A. Netflix <- 600 B. Netflix <- 500 C. Netflix <- 510 D. Netflix <- 501
B
109
Which statement best describes the impact of adding a risk-free asset to a portfolio of risky assets? Question 9Answer a. It increases the portfolio's total risk. b. It leads to lower diversification benefits. c. It allows for the creation of a Capital Allocation Line that offers a range of risk-return combinations. d. It results in a decrease in the overall expected return of the portfolio.
C
110
What will be the output of the following R code? modFunc <- function(x, y) { x %% y } modFunc(10, 3) Question 10Answer a. [1] 1 b. [1] 0 c. [1] 2 d. [1] 3
A
111
Suppose you invest in $10,000 into your mutual fund account on January 1st, 2020. Which of the following code is CORRECT to calculate the account balance at the end of June, 2020 if the account carries a rate of return of 3% every month? Question 11Answer a. 10000 * (1.03) ^ 5 b. 10000 * (0.03) ^ 6 c. 10000 * (1.03) ^ 6 d. 10000 * 0.03 * 6
C Gemini got this wrong initially, saying it was D
112
How is the 'OR' logical operator represented in R? Question 12Answer a. & b. | c. || d. OR
B
113
What data type is FALSE in R? Question 13Answer a. Character b. Logical c. Numeric d. Integer
B
114
What are the correct statements about ARIMA(p, d, q) models? Question 14Answer a. ARIMA models can't handle seasonal components. b. The “I” in ARIMA stands for “indifferent.” c. ARIMA includes differencing to remove trends. d. An ARIMA model is used for non-stationary data.
C
115
What role does the minimum-variance frontier play in portfolio selection? Question 15Answer a. It is used to identify the portfolios with the highest returns regardless of risk. b. It represents the portfolios with the lowest possible variance for a given expected return. c. It indicates portfolios that offer the highest risk for any level of expected return. d. It shows the highest possible variance for a given expected return.
B
116
Which of the following is a characteristic of a weakly stationary process? Question 16Answer a. Periodic fluctuations b. Constant mean c. Changing autocorrelation structure d. Increasing variance over time
B
117
In regression analysis, a large standard error of the regression coefficient implies high precision in estimating the coefficient. Question 17Answer a. FALSE b. TRUE
A
118
In linear regression, the presence of heteroscedasticity violates the assumption of constant variance. Question 18Answer a. FALSE b. TRUE
B
119
What does the merge() function's 'left' join option do in R? Question 19Answer a. Combines all rows from both objects b. Combines all rows from the left object only c. Combines rows with non-matching dates d. Combines rows based on the left-most columns
B
120
What is the correct way to create a date object from a string in R? Question 20Answer a. as.Date("2008-09-15") b. new Date("2008-09-15") c. createDate("2008-09-15") d. date("2008-09-15")
A
121
How can you calculate the weighted average return of a portfolio in R? Question 21Answer a. By dividing the sum of all returns by the number of assets. b. By multiplying the mean return by the total weight. c. By adding all returns and then dividing by the sum of weights. d. By multiplying each return by its weight and then summing the results.
D
122
Which statement is not true regarding the interpretation of odds ratios in logistic regression? Question 22Answer a. An odds ratio of 1 means the predictor has no effect. b. An odds ratio less than 1 indicates an increased likelihood of the event occurring. c. The odds ratio can never be less than 0. d. An odds ratio greater than 1 suggests an increased likelihood of the event occurring.
B
123
In portfolio theory, what is the primary goal of diversification? Question 23Answer a. To reduce unsystematic risk by investing in a variety of assets. b. To maximize the returns of the portfolio irrespective of risk. c. To focus exclusively on low-risk assets. d. To ensure that the portfolio contains only high-return assets.
A
124
In time series analysis, what is the primary purpose of the 'Partial Autocorrelation Function (PACF)'? Question 24Answer a. To measure the overall variance in the series b. To identify seasonal patterns c. To predict future values in the series d. To assess the direct relationship between an observation and its lag
D
125
How does R handle the modulo operation 5 %% 4? Question 25Answer a. Returns the quotient of 5 divided by 4. b. Subtracts 4 from 5. c. Multiplies 5 by 4. d. Returns the remainder of 5 divided by 4.
D
126
What will the following function return when called as revVector(c(1, 2, 3))? revVector <- function(vec) {rev(vec)} Question 26Answer a. c(3, 2, 1) b. c(1, 2, 3) c. c(3, 1, 2) d. c(2, 1, 3)
A
127
In regression analysis, how is the adjusted R-squared different from the regular R-squared? Question 27Answer a. Adjusted R-squared is always higher than regular R-squared. b. Adjusted R-squared is only used in simple linear regression. c. Adjusted R-squared considers the number of predictors in the model. d. Adjusted R-squared measures the correlation between variables.
C
128
How do you calculate the square root of a number in R? Question 28Answer a. sqr(number) b. root(number) c. sqrt(number) d. square(number)
C
129
You created the following vectors: x <- c(1, 2, 3, 4) y <- c(5, 6, 7, 8) What code will create the following matrix? [,1] [,2] [,3] [,4] x 1 2 3 4 y 5 6 7 8 Question 29Answer A. cbind(x, y) B. matrix(x, y) C. c(x, y) D. rbind(x, y)
D
130
What will be the output of the following R code? dataset <- c(10, 15, 20, 25, 30, 35, 40) sum_even <- 0 for (item in dataset) { if (item %% 2 == 0) sum_even = sum_even + item } print(sum_even) Question 30Answer A. [1] 100 B. [1] 70 C. [1] 10 25 40 D. [1] 15 35
A
131
What does a Sharpe ratio less than 1 indicate about a portfolio's performance? Question 31Answer a. The portfolio has a high level of systematic risk. b. The portfolio is offering less return per unit of risk than a portfolio with a Sharpe ratio greater than 1. c. The portfolio's return is less than the risk-free rate. d. The portfolio's return is equal to the risk-free rate.
B
132
How does the ! operator work in R? Question 32Answer a. Negates the logical value of each element b. Subtracts 1 from each element in a vector c. Adds 1 to each element in a vector d. Reverses the order of elements in a vector
A
133
In time series analysis, what does the end() function in R determine? Question 33Answer a. The end time of the series b. The final value of the series c. The last autocorrelation coefficient d. The ultimate trend in the data
A
134
What does exp(2) evaluate to in R? Question 34Answer a. 4 b. 7.389056 c. 2 d. 8
B
135
What would be the output of the following code? fruits <- c("Banana", "Apple", "Orange", "Grape") for (fruit in fruits) { if (fruit == "Orange") { break } print(fruit) } Question 35Answer A. [1] "Banana" B. [1] "Banana" [1] "Apple" [1] "Orange" C. [1] "Banana" [1] "Apple" [1] "Grape" D. [1] "Banana" [1] "Apple"
D
136
What does the c(TRUE, 4.2) command result in when used in R? Question 36Answer a. [1] 1.0 4.2 b. [1] TRUE "4.2" c. [1] TRUE 4.2 d. [1] "TRUE" "4.2"
A In R, the c() function combines values into a vector. When you mix different data types in a vector, R coerces all elements to the lowest common type to maintain type consistency. In this case: TRUE is a logical value. 4.2 is a numeric (double). R will coerce TRUE to numeric, because numeric is a more general type than logical. TRUE becomes 1.0
137
Which factor is crucial for accurately calculating Value at Risk (VaR)? Question 37Answer a. The historical correlation between asset returns. b. The use of real-time market data. c. The liquidity of the underlying assets. d. The selection of an appropriate confidence level.
D
138
In the case of two assets with a perfect negative correlation, what is the effect on the portfolio's risk? Question 38Answer a. The risk of the portfolio increases significantly. b. The risk is reduced but not completely eliminated. c. The risk of the portfolio remains the same as the individual assets. d. The portfolio's risk is completely eliminated.
D
139
Write a loop to print the numbers 2 to 8. Which condition should be in the blank? x <- 2 while _____?______ { print(x) x <- x + 1 } Question 39Answer A. (x > 1 & x <= 8) B. (x >= 2 & x < 8) C. (x > 2 & x < 8) D. (x < 8)
A
140
Which of the following is not true about Expected Shortfall (ES)? Question 40Answer a. The use of VaR as apposed to just ES tends to lead to a more conservative approach in terms of risk exposure. b. ES attempts to address the shortcomings of the VaR model. c. ES is derived from the VaR at risk for a portfolio or investment. d. ES is also called Conditional VaR.
A
141
In the context of AR models, what does the current value of the series depend on? Question 41Answer a. Independent variables. b. Past values of the series and random error. c. Future values of the series. d. Seasonal patterns.
B
142
What is the primary use of the as.Date() function in R? Question 42Answer a. To extract the date part from datetime b. To format date and time c. To create date sequences d. To convert character data to dates
D
143
When calculating Value at Risk (VaR) for a 10-day period, what assumption is mainly made? Question 43Answer a. The VaR decreases linearly over the 10-day period. b. The 10-day VaR is ten times the one-day VaR. c. The losses over the 10-day period are normally distributed. d. The losses are independent and identically distributed over each day.
D
144
The range of the logit function (logit(π)) in the domain π=[0,1] is: Question 44Answer a. (0, ∞) b. (0, 1) c. (-∞, 0) d. (- ∞, ∞)
D
145
In autoregressive models, ______________________________ . Question 45Answer a. current value of dependent variable is influenced by current and past values of independent variables. b. current value of dependent variable is influenced by current and past values of error terms. c. current value of dependent variable is influenced by both past values of dependent variables and error term. d. current value of dependent variable is influenced by current values of independent variables.
C
146
What does a scatter plot with a fitted regression line show in regression analysis? Question 46Answer a. The relationship between predictor and response variables b. The mean value of the data points c. The standard deviation of the data d. The error terms of the regression model
A
147
In portfolio management, what does a negative Sharpe ratio indicate? Question 47Answer a. The portfolio has a high level of unsystematic risk. b. The portfolio is underperforming the risk-free rate of return. c. The portfolio's return is equal to the risk-free rate. d. The portfolio is outperforming the risk-free rate of return.
B
148
What does the Autocorrelation Function (ACF) help identify in time series data? Question 48Answer a. Variance b. Correlation structure c. Randomness d. Mean
B
149
What indicates a good fit of an ARMA model when checking the ACF of the residuals? Question 49Answer a. Large residuals that highlight model accuracy. b. Increasing trend in the residuals. c. Seasonal patterns in the residuals. d. Residuals are close to 0, indicating white noise.
D
150
Given the following code and output, what should be in the blank? Amazon <- 5 repeat { print(Amazon) Amazon = Amazon + 3 if ____?_____ { break } } [1] 5 [1] 8 [1] 11 Question 50Answer A. (Amazon == 14) B. (Amazon <= 14) C. (Amazon > 14) D. (Amazon == 11)
A
151
In R, what does the function install.packages("xts") do? Question 1Answer a. Loads the 'xts' package into the current session. b. Installs the 'xts' package. c. Uninstalls the 'xts' package. d. Checks if the 'xts' package is installed.
B
152
What does the term 'collinearity' refer to in the context of regression analysis? Question 2Answer a. The accuracy of the regression model. b. A high correlation between two or more predictor variables. c. The variance of the residuals. d. A linear relationship between the predictor and the response variable.
B
153
In logistic regression, if a coefficient is close to zero, it implies that: Question 3Answer a. The predictor is the most significant variable in the model. b. The model is not suitable for the given data. c. The predictor has a strong negative effect on the outcome. d. The predictor has a minimal impact on the probability of the outcome.
D
154
Which of the following is the correct way to define a default value for a parameter in R functions? Question 4Answer a. myFunc <- function(x, y ? 1) { ... } b. myFunc <- function(x, y == 1) { ... } c. myFunc <- function(x, y = 1) { ... } d. myFunc <- function(x, y: 1) { ... }
C
155
In R, nested if statements are used for: Question 5Answer a. Handling multiple conditions b. Reducing memory usage c. Simplifying code d. Speeding up execution
A
156
In R, what does the & operator signify in logical operations? Question 6Answer a. Logical XOR b. Logical AND c. Logical OR d. Logical NOT
B
157
Which method is used to remove both trends and seasonality in a time series? Question 7Answer a. Logarithm transformation b. Linear regression c. Differencing with appropriate lag d. Moving average smoothing
C
158
Which symbol is used for the 4-digit year in date formatting in R? Question 8Answer a. %m b. %y c. %d d. %Y
D
159
Why is logistic regression preferred over linear regression for binary outcomes? Question 9Answer a. Because it can process more data. b. Because it predicts numerical values. c. Because it is computationally faster. d. Because it models the probability of binary outcomes.
D
160
What is the command in R to print "Hello world!"? Question 10Answer a. print("Hello world!") b. println("Hello world!") c. console.log("Hello world!") d. echo("Hello world!")
A
161
What is the impact of a perfectly negative correlation (correlation coefficient = -1) between two assets in a portfolio? Question 11Answer a. It eliminates the possibility of diversification. b. It increases the expected return of the portfolio. c. It leads to the highest possible portfolio standard deviation. d. It allows the construction of a portfolio with zero variance.
D
162
When is a time series considered weakly stationary? Question 12Answer a. When the series displays a trend. b. When the series shows a seasonal pattern. c. When the series has a constant mean and variance over time. d. When there are abrupt changes to the level of the series or the variance.
C
163
How do you multiply two vectors x and y in R? Question 13Answer a. x / y b. x + y c. x * y d. x - y
C
164
If you have $100 in variable x and $150 in variable y, what R command will sum these amounts? Question 14Answer a. x * y b. total(x, y) c. sum(x, y) d. combine(x, y)
C
165
In time series analysis, what does the presence of a cyclical component indicate? Question 15Answer a. A consistent trend over time b. Regular patterns repeating within a year c. Long-term fluctuations that repeat after irregular intervals d. Short-term fluctuations in the series
C
166
Determine the correct condition for this code to match the output: Tesla <- 30 repeat { print(Tesla) Tesla = Tesla - 4 if ____?_____ { break } } [1] 30 [1] 26 [1] 22 [1] 18 Question 16Answer A. (Tesla == 14) B. (Tesla < 20) C. (Tesla == 18) D. (Tesla < 14)
A
167
You have the following codes and the result. ______?_______ if (temperature > 30) { print("It's hot outside") } else { if (temperature > 20) { print("It's warm outside") } else { print("It's cold outside") } } [1] "It's cold outside" The blank could be: Question 17Answer A. temperature <- 25 B. temperature <- 15 C. temperature <- 35 D. No Answer
B
168
What does the diff() function primarily accomplish in time series data? Question 18Answer a. It calculates the mean of the series b. It generates a cumulative plot c. It calculates the autocorrelation d. It takes the first difference of the series to remove trends
D
169
What is the outcome of 13 %% 2 in R? Question 19Answer a. 4.5 b. 4 c. 1 d. 2
C
170
The autocorrelation function (ACF) in time series analysis is used to: Question 20Answer a. Predict future values b. Identify the correlation structure of the data c. Estimate mean and variance d. Transform non-stationary to stationary data
B
171
The process of differencing a time series is most effective in dealing with: Question 21Answer a. Non-constant variance b. Linear trends c. High autocorrelation d. Constant mean
B
172
What does the R command credit_rating <- c("AAA", "AA", "BBB", "BB", "B") create? Question 22Answer a. A list b. A numeric vector c. A character vector d. A matrix
C
173
In R, how would you subset a vector ret to get the first two elements? Question 23Answer a. ret[1:2] b. ret[[1, 2]] c. subset(ret, 1:2) d. slice(ret, 1:2)
A
174
The coefficient of determination (R-squared) can never be negative. Question 24Answer a. TRUE b. FALSE
A
175
You aim to print odd numbers from 3 to 9. Fill in the blank in the following code: x <- 3 repeat { _____?______ if (x >= 9) break x <- x + 2 } Question 25Answer A. print(x) B. print(3) C. print(x-2) D. x <- x – 2
A
176
In terms of risk, how does a well-diversified portfolio compare to individual assets? Question 26Answer a. It has the same level of risk as the most risky individual asset. b. It has higher risk than individual assets. c. It typically has lower risk than individual assets. d. The risk level is unrelated to that of individual assets.
C
177
Identify the model for the following process: Yt = c + Ø1 Yt-1 + θ1 εt-1 + εt Question 27Answer A. ARIMA(0, 1, 1) B. ARMA(1, 0) C. AR(1) D. ARIMA(1, 0, 1)
D
178
In logistic regression, a logit link function is used to: Question 28Answer a. Connect the linear predictors to the probability of the outcome. b. Linearly relate the predictors to the outcome variable. c. Convert all variables into binary form. d. Transform the predictors to a logarithmic scale.
A
179
When comparing VaR and ES, it is correct to say that: Question 29Answer a. ES is often used to complement the information provided by VaR. b. VaR and ES are always identical values for any given portfolio. c. VaR is a more comprehensive measure of risk than ES. d. ES is always less than or equal to VaR.
A
180
Suppose you invest in $1000 into your mutual fund account on January 1st, 2020. Which of the following code is CORRECT to calculate the account balance at the end of March, 2020 if the account carries a rate of return of 2% every month? Question 30Answer a. 1000 * (1.02) ^ 3 b. 1000 * (0.02) ^ 3 c. 1000 * 0.02 * 3 d. 1000 * (1.02) ^ 2
A
181
Which of the following best describes the relationship between a portfolio's expected return and the weighted average of its component expected returns? Question 31Answer a. The expected return of a portfolio is typically lower than the weighted average of its components. b. The expected return of a portfolio is equivalent to the weighted average of its component expected returns. c. Portfolio expected return is unrelated to the weighted average of its components. d. The portfolio’s expected return is always higher than the weighted average of its components.
B
182
In risk management, Value at Risk (VaR) is best used to: Question 32Answer a. Estimate the potential loss for a portfolio under normal market conditions. b. Predict the future performance of a portfolio. c. Determine the exact amount of loss in adverse market conditions. d. Calculate the required return for a portfolio.
A
183
Which component in time series analysis is responsible for capturing long-term progression or decline in the data? Question 33Answer a. Seasonal component b. Trend component c. Residual component d. Cyclical component
B
184
What is the result of samsung_stock <- 120; class(samsung_stock) in R? Question 34Answer a. "logical" b. "integer" c. "character" d. "numeric"
D
185
What will be the output of this R function when called as divide(10, 2)? divide <- function(x, y) {x / y} Question 35Answer a. 5 b. 12 c. 2 d. 20
A
186
What would be the output of the following code? age <- 65 if (age < 18) { print("Minor") } else if (age >= 18 & age < 60) { print("Adult") } else { print("Senior") } Question 36Answer A. [1] "Adult" B. No Output C. [1] "Senior" D. [1] "Minor"
C
187
Here is the R output from fitting an ARMA(1, 1) model to a data set x. arma11 <- sarima(x, p = 1, d = 0, q = 1) arma11 $fit Call: arima(x = xdata, order = c(p, d, q), seasonal = list(order = c(P, D, Q), period = S), xreg = xmean, include.mean = FALSE, transform.pars = trans, fixed = fixed, optim.control = list(trace = trc, REPORT = 1, reltol = tol)) Coefficients: ar1 ma1 xmean 0.9103 0.5689 0.0544 s.e. 0.0286 0.0608 1.9522 sigma^2 estimated as 2.752: log likelihood = -386.5, aic = 781 $degrees_of_freedom [1] 197 $ttable Estimate SE t.value p.value ar1 0.9103 0.0286 31.8467 0.0000 ma1 0.5689 0.0608 9.3573 0.0000 xmean 0.0544 1.9522 0.0278 0.9778 $AIC [1] 3.905022 $AICc [1] 3.905634 $BIC [1] 3.970988 What is the estimate of the autoregressive parameter? Question 37Answer A. 0.5689 B. 0.0286 C. 0.9103 D. 0.0608
C
188
To convert a character string to a date in R, you would use: Question 38Answer a. strToDate() b. as.character() c. as.Date() d. toString()
C
189
Which of the following is an assumption of linear regression? Question 39Answer a. The relationship between variables is nonlinear. b. The predictors are dependent on each other. c. The residuals are normally distributed. d. The response variable is categorical.
C
190
What is the primary function of the 'lm()' command in R programming for regression analysis? Question 40Answer a. To calculate the standard deviation b. To calculate the mean of a dataset c. To perform linear regression d. To plot data points
C
191
What does a high positive correlation between portfolio assets imply about diversification benefits? Question 41Answer a. It has no impact on diversification benefits. b. Diversification benefits are minimized. c. It indicates perfect diversification. d. Diversification benefits are maximized.
B
192
In the context of portfolio theory, what does a positive covariance between two assets indicate? Question 42Answer a. The assets move in the same direction. b. The covariance has no impact on the direction of asset movements. c. The assets have identical returns. d. The assets move in opposite directions.
A
193
The main difference between Value at Risk (VaR) and Expected Shortfall (ES) is: Question 43Answer a. ES is less accurate than VaR. b. ES considers the average loss beyond the VaR threshold, while VaR does not. c. VaR is a measure of market risk, whereas ES is a measure of credit risk. d. VaR accounts for the average loss in the worst-case scenario, while ES does not.
B
194
What will the following R function return when called as getL(c(1,2,3,4,5))? getL <- function(vec) { return(length(vec)) } Question 44Answer a. 5 b. 1 c. 10 d. 15
A
195
In the context of regression analysis, what does the term 'residual' refer to? Question 45Answer a. The difference between observed and predicted values b. The intercept of the regression line c. The slope of the regression line d. The correlation coefficient
A
196
What is the command to convert an xts object back into a data frame? Question 46Answer a. to.data.frame() b. convert.data.frame() c. frame() d. as.data.frame()
D
197
In R, which function would you use to see the attributes of stock_dataframe? Question 47Answer a. summary(stock_dataframe) b. describe(stock_dataframe) c. attributes(stock_dataframe) d. show(stock_dataframe)
C
198
What would be the output of the following code? x <- c(1:4); y <- c(6:9); z <- x + y; z Question 48Answer a. [1] Null b. [1] 9 11 13 c. [1] 7 9 11 13 d. [1] 7 9 11 13 14
C
199
You want to print even numbers from 10 to 20. Which of the following conditions could NOT be in the blank to stop the loop? x <- 10 repeat { if _____?_____ { break } if (x%%2 == 0) { print(x) } x <- x + 1 } Question 49Answer A. (x == 21) B. (x >= 21) C. (x > 22) D. (x > 20)
C
200
What is the role of the Capital Allocation Line (CAL) in portfolio theory? Question 50Answer a. It indicates the maximum return possible for a given level of risk. b. It represents the trade-off between risk and return for portfolios that include only risky assets. c. It shows the relationship between the expected return and the standard deviation of all possible risky asset portfolios. d. It illustrates the trade-off between risk and return for portfolios that include a risk-free asset.
D