Question

The following list details the returns on 10 investment funds for the period 2009 - 2018....

The following list details the returns on 10 investment funds for the period 2009 - 2018. The information listed is year, name, percentage return.

You are considering investing in one or more of the funds.

You are to develop methods (7) that will (using the data below):

  • Calculate the average annual return for each fund (print the average)
  • Find the fund with the highest average return (print the fund name, year and return)
  • Find the fund with the lowest average return (print the fund name, year and return)
  • Find the fund with the average return closest to the average of all of the funds (print the fund name, year and return)
  • Find the fund with the highest single year return (print the fund name, year and return)
  • Find the fund with the lowest single year return (print the fund name, year and return)
  • Calculate the amount you would have on 01/01/2019 if you had invested $10,000 in each fund on 01/01/2008, without any withdrawals.  (print the name of and final amount for each fund)

funds = [

[2009, "Emerging Market Equity", 78.51],

[2009, "High-Yield Bond", 58.21],

[2009, "Mid Cap", 40.48],

[2009, "Large Growth", 37.21],

[2009, "International Stocks", 31.78],

[2009, "Small Cap", 27.17],

[2009, "S & P 500", 26.46],

[2009, "Large Value", 19.69],

[2009, "TIPS", 11.41],

[2009, "Bonds", 5.93],

[2010, "Emerging Market Equity", 18.88],

[2010, "High-Yield Bond", 15.12],

[2010, "Mid Cap", 25.48],

[2010, "Large Growth", 16.71],

[2010, "International Stocks", 7.75],

[2010, "Small Cap", 26.85],

[2010, "S & P 500", 15.06],

[2010, "Large Value", 15.51],

[2010, "TIPS", 6.31],

[2010, "Bonds", 6.54],

[2011, "Emerging Market Equity", -18.42],

[2011, "High-Yield Bond", 4.98],

[2011, "Mid Cap", -1.55],

[2011, "Large Growth", 2.64],

[2011, "International Stocks", -12.14],

[2011, "Small Cap", -4.18],

[2011, "S & P 500", 2.11],

[2011, "Large Value", 0.39],

[2011, "TIPS", 13.56],

[2011, "Bonds", 7.84],

[2012, "Emerging Market Equity", 18.22],

[2012, "High-Yield Bond", 15.81],

[2012, "Mid Cap", 17.28],

[2012, "Large Growth", 15.26],

[2012, "International Stocks", 17.32],

[2012, "Small Cap", 16.35],

[2012, "S & P 500", 16.00],

[2012, "Large Value", 17.51],

[2012, "TIPS", 6.98],

[2012, "Bonds", 4.21],

[2013, "Emerging Market Equity", -2.60],

[2013, "High-Yield Bond", 7.44],

[2013, "Mid Cap", 34.76],

[2013, "Large Growth", 33.48],

[2013, "International Stocks", 22.78],

[2013, "Small Cap", 38.82],

[2013, "S & P 500", 32.39],

[2013, "Large Value", 32.53],

[2013, "TIPS", -8.61],

[2013, "Bonds", -2.02],

[2014, "Emerging Market Equity", -2.19],

[2014, "High-Yield Bond", 2.45],

[2014, "Mid Cap", 13.22],

[2014, "Large Growth", 13.05],

[2014, "International Stocks", -4.90],

[2014, "Small Cap", 4.89],

[2014, "S & P 500", 13.69],

[2014, "Large Value", 13.45],

[2014, "TIPS", 3.64],

[2014, "Bonds", 5.97],

[2015, "Emerging Market Equity", -14.92],

[2015, "High-Yield Bond", -4.47],

[2015, "Mid Cap", -2.44],

[2015, "Large Growth", 5.67],

[2015, "International Stocks", -0.81],

[2015, "Small Cap", -4.41],

[2015, "S & P 500", 1.38],

[2015, "Large Value", -3.83],

[2015, "TIPS", -1.44],

[2015, "Bonds", 0.55],

[2016, "Emerging Market Equity", 11.19],

[2016, "High-Yield Bond", 17.13],

[2016, "Mid Cap", 13.80],

[2016, "Large Growth", 7.08],

[2016, "International Stocks", 1.00],

[2016, "Small Cap", 21.31],

[2016, "S & P 500", 11.96],

[2016, "Large Value", 17.34],

[2016, "TIPS", 4.68],

[2016, "Bonds", 2.65],

[2017, "Emerging Market Equity", 37.28],

[2017, "High-Yield Bond", 7.50],

[2017, "Mid Cap", 18.52],

[2017, "Large Growth", 30.21],

[2017, "International Stocks", 25.03],

[2017, "Small Cap", 14.65],

[2017, "S & P 500", 21.83],

[2017, "Large Value", 13.66],

[2017, "TIPS", 3.01],

[2017, "Bonds", 3.54],

[2018, "Emerging Market Equity", -14.58],

[2018, "High-Yield Bond", -2.08],

[2018, "Mid Cap", -9.06],

[2018, "Large Growth", -1.51],

[2018, "International Stocks", -13.79],

[2018, "Small Cap", -11.01],

[2018, "S & P 500", -4.38],

[2018, "Large Value", -8.27],

[2018, "TIPS", -1.26],

[2018, "Bonds", 0.01]

]

Please Done in Python Format please

Homework Answers

Answer #1

Find the python3 code below. Methods 2, 3 and 4 asks for average returns.Since it's about the average, year has no significance here. Comments have been provided throughout the code.

funds = [ [2009, "Emerging Market Equity", 78.51], [2009, "High-Yield Bond", 58.21], [2009, "Mid Cap", 40.48], [2009, "Large Growth", 37.21], [2009, "International Stocks", 31.78], [2009, "Small Cap", 27.17], [2009, "S & P 500", 26.46], [2009, "Large Value", 19.69], [2009, "TIPS", 11.41], [2009, "Bonds", 5.93], [2010, "Emerging Market Equity", 18.88], [2010, "High-Yield Bond", 15.12], [2010, "Mid Cap", 25.48], [2010, "Large Growth", 16.71], [2010, "International Stocks", 7.75], [2010, "Small Cap", 26.85], [2010, "S & P 500", 15.06], [2010, "Large Value", 15.51], [2010, "TIPS", 6.31], [2010, "Bonds", 6.54], [2011, "Emerging Market Equity", -18.42], [2011, "High-Yield Bond", 4.98], [2011, "Mid Cap", -1.55], [2011, "Large Growth", 2.64], [2011, "International Stocks", -12.14], [2011, "Small Cap", -4.18], [2011, "S & P 500", 2.11], [2011, "Large Value", 0.39], [2011, "TIPS", 13.56], [2011, "Bonds", 7.84], [2012, "Emerging Market Equity", 18.22], [2012, "High-Yield Bond", 15.81], [2012, "Mid Cap", 17.28], [2012, "Large Growth", 15.26], [2012, "International Stocks", 17.32], [2012, "Small Cap", 16.35], [2012, "S & P 500", 16.00], [2012, "Large Value", 17.51], [2012, "TIPS", 6.98], [2012, "Bonds", 4.21], [2013, "Emerging Market Equity", -2.60], [2013, "High-Yield Bond", 7.44], [2013, "Mid Cap", 34.76], [2013, "Large Growth", 33.48], [2013, "International Stocks", 22.78], [2013, "Small Cap", 38.82], [2013, "S & P 500", 32.39], [2013, "Large Value", 32.53], [2013, "TIPS", -8.61], [2013, "Bonds", -2.02], [2014, "Emerging Market Equity", -2.19], [2014, "High-Yield Bond", 2.45], [2014, "Mid Cap", 13.22], [2014, "Large Growth", 13.05], [2014, "International Stocks", -4.90], [2014, "Small Cap", 4.89], [2014, "S & P 500", 13.69], [2014, "Large Value", 13.45], [2014, "TIPS", 3.64], [2014, "Bonds", 5.97], [2015, "Emerging Market Equity", -14.92], [2015, "High-Yield Bond", -4.47], [2015, "Mid Cap", -2.44], [2015, "Large Growth", 5.67], [2015, "International Stocks", -0.81], [2015, "Small Cap", -4.41], [2015, "S & P 500", 1.38], [2015, "Large Value", -3.83], [2015, "TIPS", -1.44], [2015, "Bonds", 0.55], [2016, "Emerging Market Equity", 11.19], [2016, "High-Yield Bond", 17.13], [2016, "Mid Cap", 13.80], [2016, "Large Growth", 7.08], [2016, "International Stocks", 1.00], [2016, "Small Cap", 21.31], [2016, "S & P 500", 11.96], [2016, "Large Value", 17.34], [2016, "TIPS", 4.68], [2016, "Bonds", 2.65], [2017, "Emerging Market Equity", 37.28], [2017, "High-Yield Bond", 7.50], [2017, "Mid Cap", 18.52], [2017, "Large Growth", 30.21], [2017, "International Stocks", 25.03], [2017, "Small Cap", 14.65], [2017, "S & P 500", 21.83], [2017, "Large Value", 13.66], [2017, "TIPS", 3.01], [2017, "Bonds", 3.54], [2018, "Emerging Market Equity", -14.58], [2018, "High-Yield Bond", -2.08], [2018, "Mid Cap", -9.06], [2018, "Large Growth", -1.51], [2018, "International Stocks", -13.79], [2018, "Small Cap", -11.01], [2018, "S & P 500", -4.38], [2018, "Large Value", -8.27], [2018, "TIPS", -1.26], [2018, "Bonds", 0.01] ]

# extract years and sort
years = list(set(i[0] for i in funds))
years.sort()

'''
for ease of operations, let's first transform this list into a dict
dict
    key   = Name of the fund
    value = list of return percentages in order (2009 to 2018)
'''

# sort the list funds based on year, if not sorted
# The given list is already sorted.
# uncomment the following line, if list is unsorted
# funds.sort(key = lambda x: x[0])

funds_dict = dict()

for i in funds:
    if i[1] in funds_dict:
        funds_dict[i[1]].append(i[2])
    else:
        funds_dict[i[1]] = [i[2]]

# list of funds_dict items. It's a list of lists
# of the form [[fund name, list of returns in each year]]
average_returns = list(funds_dict.items())


# 1. Calculate the average annual return for each fund (print the average)
print("\n---Average Annual Return---")
for key, value in funds_dict.items():
    print(key, "==>", round(sum(value)/len(value), 2))

# 2. Find the fund with the highest average return (print the fund name, year and return)
print("\n---Highest Average Return---")

# here, year has no significance as it's average

# sort average_returns based on the sum of return values
average_returns.sort(key = lambda x : sum(x[1]), reverse = True)

max_return_fund = average_returns[0]
print(max_return_fund[0], years[0], "->", years[-1], "==>", round(sum(max_return_fund[1]) / len(max_return_fund[1]), 2))
    
# 3. Find the fund with the lowest average return (print the fund name, year and return)
print("\n---Lowest Average Return---")

# here, year has no significance as it's average

# average_returns list is already sorted based on the sum of return values

min_return_fund = average_returns[-1]
print(min_return_fund[0], years[0], "->", years[-1], "==>", round(sum(min_return_fund[1]) / len(min_return_fund[1]), 2))

# 4. Find the fund with the average return closest to the average of all of the funds (print the fund name, year and return)
print("\n---Average Return Closest to Overall Average---")

# here, year has no significance as it's average

# find aveage of all the funds
overall_average_return = 0
for i in average_returns:
    overall_average_return += (sum(i[1]) / len(i[1]))

# to get average, divide it by total number of funds (10)
overall_average_return /= len(average_returns)

# sort average_returns based on the difference between 
# its average return and overall average return
average_returns.sort(key = lambda x : abs(overall_average_return - (sum(x[1]) / len(x[1]))))

nearest_return_fund = average_returns[0]
print(nearest_return_fund[0], years[0], "->", years[-1], "==>", round(sum(nearest_return_fund[1]) / len(nearest_return_fund[1]), 2))

# 5. Find the fund with the highest single year return (print the fund name, year and return)
print("\n---Highest Single Year Return---")

# sort average_returns based on the maximum return value in any year
average_returns.sort(key = lambda x : max(x[1]), reverse = True)

max_return_fund = average_returns[0]
print(max_return_fund[0], years[max_return_fund[1].index(max(max_return_fund[1]))], "==>", max(max_return_fund[1]))

# 6. Find the fund with the lowest single year return (print the fund name, year and return)
print("\n---Lowest Single Year Return---")

# average_returns list is already sorted based on the maximum return value in any year

min_return_fund = average_returns[-1]
print(min_return_fund[0], years[min_return_fund[1].index(max(min_return_fund[1]))], "==>", max(min_return_fund[1]))

# 7. Calculate the amount you would have on 01/01/2019 if you had invested $10,000 in each fund on 01/01/2008, without any withdrawals.  (print the name of and final amount for each fund)
print("\n---Maturity Amount on 01/01/2019---")

for key, value in funds_dict.items():
    
    # initial amount
    amount = 10000
    
    # add returns on year
    for i in value:
        amount += amount * (i/100)
    
    # print final amount
    print(key, "==>  $", round(amount, 2))

Find sample output below.

---Average Annual Return---
Emerging Market Equity ==> 11.14
High-Yield Bond ==> 12.21
Mid Cap ==> 15.05
Large Growth ==> 15.98
International Stocks ==> 7.4
Small Cap ==> 13.04
S & P 500 ==> 13.65
Large Value ==> 11.8
TIPS ==> 3.83
Bonds ==> 3.52

---Highest Average Return---
Large Growth 2009 -> 2018 ==> 15.98

---Lowest Average Return---
Bonds 2009 -> 2018 ==> 3.52

---Average Return Closest to Overall Average---
Emerging Market Equity 2009 -> 2018 ==> 11.14

---Highest Single Year Return---
Emerging Market Equity 2009 ==> 78.51

---Lowest Single Year Return---
Bonds 2011 ==> 7.84

---Maturity Amount on 01/01/2019---
Emerging Market Equity ==>  $ 21629.59
High-Yield Bond ==>  $ 28708.01
Mid Cap ==>  $ 37159.81
Large Growth ==>  $ 41483.21
International Stocks ==>  $ 18454.37
Small Cap ==>  $ 30981.91
S & P 500 ==>  $ 34300.42
Large Value ==>  $ 28851.35
TIPS ==>  $ 14301.75
Bonds ==>  $ 14074.53

Kindly upvote, if ypu find this answer helpful.

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Year Quarter Sales (in Billions) 2009 1 2.62 2009 2 2.33 2009 3 2.4 2009 4...
Year Quarter Sales (in Billions) 2009 1 2.62 2009 2 2.33 2009 3 2.4 2009 4 2.42 2010 1 2.72 2010 2 2.53 2010 3 2.61 2010 4 2.84 2011 1 2.95 2011 2 2.79 2011 3 2.93 2011 4 3.03 2012 1 3.44 2012 2 3.2 2012 3 3.3 2012 4 3.36 2013 1 3.79 2013 2 3.56 2013 3 3.74 2013 4 3.8 2014 1 4.24 2014 2 3.87 2014 3 4.15 2014 4 4.18 2015 1 4.8...
Calculate the historical variance: Year Closing Stock Price 2009 32.25 2010 43.83 2011 60.30 2012 41.18...
Calculate the historical variance: Year Closing Stock Price 2009 32.25 2010 43.83 2011 60.30 2012 41.18 2013 46.94 2014 50.94 2015 32.97 2016 55.34 2017 55.09 2018 44.86 2019 72.59 Submit your answer as a decimal.
Calculate the annual dividend growth rate for the last 10 years. Kindly provide excel formulas. Based...
Calculate the annual dividend growth rate for the last 10 years. Kindly provide excel formulas. Based on the annual dividend growth rate for data provided, will you forecast a constant or non-constant growth in dividends? Please explain. Date Dividends 8/11/2010 0.303 12/8/2010 0.303 3/9/2011 0.365 5/11/2011 0.365 8/10/2011 0.365 12/7/2011 0.365 3/8/2012 0.398 5/9/2012 0.398 8/8/2012 0.398 12/5/2012 0.398 3/8/2013 0.47 5/8/2013 0.47 8/7/2013 0.47 12/4/2013 0.47 3/7/2014 0.48 5/7/2014 0.48 8/6/2014 0.48 12/3/2014 0.48 3/11/2015 0.49 5/6/2015 0.49 8/5/2015...
How can I do regression analysis for Sales Revenue for Macys comparing it to TJX? Please...
How can I do regression analysis for Sales Revenue for Macys comparing it to TJX? Please show work and example in Excel if it's easier. Net Profit Margin 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 Sales Revenue - MACYS $ 15,776,000.00 $ 22,390,000.00 $ 26,970,000.00 $ 26,313,000.00 $    24,892,000.00 $ 23,489,000.00 $ 25,003,000.00 $ 26,405,000.00 $ 27,686,000.00 $ 27,931,000.00 $ 28,105,000.00 $ 27,079,000.00 $ 25,778,000.00 $ 24,837,000.00 Net Profit Margin 2005 2006 2007...
Create the following forecasts: a 4-period moving average forecast, an exponential smoothing forecast with alpha=0.2, and...
Create the following forecasts: a 4-period moving average forecast, an exponential smoothing forecast with alpha=0.2, and a linear trend forecast for your data. Calculate the MSE and MAPE for each. Plot the original series, and each of the forecasts. Create forecasts for 2017 Q1, 2017 Q2, 2017 Q3 and 2017 Q4 using each of these three techniques. If you had to choose one of these, which would you choose and why? Given your data, and this time period, would you...
The following data is provided for a market 500 Index: Year Total return Year Total return...
The following data is provided for a market 500 Index: Year Total return Year Total return 2000 16.0% 2010 2.0% 2001 8.0% 2011 3.0% 2002 -3.0% 2012 3.0% 2003 1.0% 2013 4.0% 2004 5.0% 2014 5.0% 2005 21.0% 2015 4.0% 2006 43.0% 2016 3.0% 2007 4.9% 2017 3.5% 2008 -7.0% 2018 4.5% 2009 0.1% 2019 5.8% Calculate the last 10 -year arithmetic average annual rate of return on the market Index. 3.78% 2.69% 0.37% 3.93%
The following data is provided for a market 500 Index: Year Total return Year Total return...
The following data is provided for a market 500 Index: Year Total return Year Total return 2000 16.0% 2010 2.0% 2001 8.0% 2011 3.0% 2002 -3.0% 2012 3.0% 2003 1.0% 2013 4.0% 2004 5.0% 2014 5.0% 2005 21.0% 2015 4.0% 2006 43.0% 2016 3.0% 2007 4.9% 2017 3.5% 2008 -7.0% 2018 4.5% 2009 0.1% 2019 5.8% Calculate the 20 -year geometric average annual rate of return on the market Index. 5.91% 3.32% 3.77% 0.28%
You have found the following mutual fund on Fidelity. It’s ticker symbol is FNMIX. It is...
You have found the following mutual fund on Fidelity. It’s ticker symbol is FNMIX. It is Fidelity New Markets Income Fund. The values of a “Hypothetical $10,000 Investment” on November 30, 2009 are shown below. This assumes you invested $10,000 on November 30, 2009, reinvested all income, and made no further investments. Value on November 30 of each respective year. 2009 $10,000 2010 $11,091 2011 $11,829 2012 $14,220 2013 $13,386 2014 $14,560 2015 $14,473 2016 $15,791 2017 $17,633 2018 $16,289...
A company’s sales for the years 2010 to 2018 were as follows: ( x N$ 10...
A company’s sales for the years 2010 to 2018 were as follows: ( x N$ 10 000 ) Year 2010 2011 2012 2013 2014 2015 2016 2017 2018 Sales 324 296 310 305 295 347 348 364 370 2.1) Derive, by using the method of least squares, an equation of linear trend for the sales of the company. (Use sequential numbering with x = 1 in 2010) (8) 2.2) Use the trend line equation obtained in Question 2.1 to compute...
The table below displays returns associated with a company's shares over the last 15 years. Year...
The table below displays returns associated with a company's shares over the last 15 years. Year Return (% pa) 2005 23 2006 17 2007 11 2008 15 2009 12 Year Return (% pa) 2010 31 2011 2 2012 16 2013 8 2014 31 Year Return (% pa) 2015 29 2016 5 2017 26 2018 6 2019 1 Based on this historic data, calculate the expected return on the shares and its standard deviation. Give your answers as a percentage per...