ST. D Examples

docx

School

Gannon University *

*We aren’t endorsed by this school

Course

220

Subject

Economics

Date

Feb 20, 2024

Type

docx

Pages

4

Uploaded by HighnessEnergyPony41

Report
Example 1: Exam Scores Scenario: In a class of 30 students, you want to understand the variability in exam scores. The scores are as follows: 75,80,85,90,95,100,60,70,85,90,92,88,78,82,92,96,85,80,88,94,98,72,68,89,91,84, 79,76,93,8775,80,85,90,95,100,60,70,85,90,92,88,78,82,92,96,85,80,88,94,98,72,6 8,89,91,84,79,76,93,87 Calculation: 1) Find the mean (average) of the scores. 2) Subtract the mean from each score to get the deviations. 3) Square each deviation. 4) Find the average of the squared deviations. 5) Take the square root of the average from step 4.
Example 2: Monthly Sales Scenario: You want to analyze the monthly sales data for a small business over the past year. The monthly sales figures (in thousands of dollars) are as follows: 32,28,35,30,33,40,38,45,42,36,31,29 Calculation: 1) Find the mean (average) of the monthly sales. 2) Subtract the mean from each monthly sales figure to get the deviations. 3) Square each deviation. 4) Find the average of the squared deviations. 5) Take the square root of the average from step 4.
Example 3: Investment Returns Scenario: You are comparing the returns on two different investment portfolios over the past five years. The annual returns for each portfolio are as follows: Portfolio A: 10 Portfolio B: 5 Calculation: 1) Calculate the mean (average) return for each portfolio. 2) Subtract the mean from each annual return to get the deviations. 3) Square each deviation. 4) Find the average of the squared deviations for each portfolio. 5) Take the square root of the average from step 4 for each portfolio. import numpy as np # Investment returns for Portfolio A and B returns_portfolio_a = np.array([ 10 ]) returns_portfolio_b = np.array([ 5 ]) # Step 1: Calculate the mean (average) return for each portfolio mean_return_portfolio_a = np.mean(returns_portfolio_a) mean_return_portfolio_b = np.mean(returns_portfolio_b) # Step 2: Subtract the mean from each annual return to get the deviations deviations_portfolio_a = returns_portfolio_a - mean_return_portfolio_a deviations_portfolio_b = returns_portfolio_b - mean_return_portfolio_b # Step 3: Square each deviation squared_deviations_portfolio_a = deviations_portfolio_a ** 2 squared_deviations_portfolio_b = deviations_portfolio_b ** 2 # Step 4: Find the average of the squared deviations for each portfolio average_squared_deviation_portfolio_a = np.mean(squared_deviations_portfolio_a) average_squared_deviation_portfolio_b = np.mean(squared_deviations_portfolio_b) # Step 5: Take the square root of the average squared deviation for each portfolio std_deviation_portfolio_a = np.sqrt(average_squared_deviation_portfolio_a) std_deviation_portfolio_b = np.sqrt(average_squared_deviation_portfolio_b) print ( "Mean (Average) Return for Portfolio A:" , mean_return_portfolio_a) print ( "Standard Deviation of Returns for Portfolio A:" , std_deviation_portfolio_a)
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
print ( "Mean (Average) Return for Portfolio B:" , mean_return_portfolio_b) print ( "Standard Deviation of Returns for Portfolio B:" , std_deviation_portfolio_b)