0% found this document useful (0 votes)
4 views

BA quiz 2( 4-7)

Uploaded by

Raja dude
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

BA quiz 2( 4-7)

Uploaded by

Raja dude
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

Week 4

Demand Response Curve

Latent Demand

refers to demand for a good or service that consumers cannot satisfy for

three main reasons. First, the consumer does not have enough money to

buy the item. Second, the item is not available. Third, the consumer does

not know that the product or service is available.

Consumer Surplus

It's a measure of the additional benefit that consumers receive because

they're paying less for something than what they were willing to pay.

Properties

Non-negative

Continuous

Differentiable

Downward sloping

Linear Response Curve

where is the demand at price 0 and

is the slope

Satiating Price

Price at which demand is 0

Elasticity

D(p) = D0 − m ∗ p

D0

m
PS =

D0

ε=

m∗p

D0−m∗p

Constant Elasticity Curve

where is the demand when price is 1

Revenue

D(p) = Cp

R = p ∗ D = Cp

Assignments:

The price of an envelop was Rs. 3/ piece yesterday and Aditya bought 10 envelopes. Today, the price
is Rs. 3.75/ piece and Aditya is willing to buy only 8 envelopes. What is the elasticity of Aditya’s
demand?

Ans:

ϵ= % change in quantity demanded

% change in price

• Initial price (P1P_1P1) = Rs. 3.00


• New price (P2P_2P2) = Rs. 3.75
• Initial quantity demanded (Q1Q_1Q1) = 10
• New quantity demanded (Q2Q_2Q2) = 8
IITM-BA’s courses elasticity for number of student registrations is expected to be constant at
0.9 for the next couple of years. Currently the course fee is Rs.10,000 and 1500 students have
registered. If the course fee is changes to Rs. 8000, how many students will register?

Ans:

% change in students = 0.9

% change in fee

• F1 = Initial fee = Rs. 10000


• F2 = New fee = Rs. 8000
• S1 = Initial students = 1500
• S2 = New students = x

= F2-F1/F1 * 100 = 2000/10000 *100 = 20%

0.9 = (x – 1500 /15 )/

20

X = 1770
Week 7

Logistic regression is a supervised machine learning algorithm that accomplishes binary classification
tasks by predicting the probability of an outcome, event, or observation.

. Understanding the Confusion Matrix in Classification

A Confusion Matrix is a table used to evaluate the performance of a classification model. It consists
of four key terms:

Actual /
Predicted 1 (Positive) Predicted 0 (Negative)
Predicted

Actual 1 True Positive (TP) → Model correctly False Negative (FN) → Model incorrectly
(Positive) predicted 1 predicted 0

Actual 0 False Positive (FP) → Model incorrectly True Negative (TN) → Model correctly
(Negative) predicted 1 predicted 0

Where:

• True Positives (TP): Cases where the actual value is 1, and the model predicts 1.

• False Positives (FP): Cases where the actual value is 0, but the model predicts 1.

• True Negatives (TN): Cases where the actual value is 0, and the model predicts 0.

• False Negatives (FN): Cases where the actual value is 1, but the model predicts 0.

Key Metrics Derived from the Confusion Matrix

1. Accuracy: The proportion of correct predictions out of all predictions.

Accuracy=TP+TN / TP+FP+TN+FN
2. Precision: The proportion of correctly predicted positive cases out of all predicted positive
cases.

Precision=TP / TP+FP

3. Recall (Sensitivity): The proportion of correctly predicted positive cases out of all actual
positive cases.

Recall=TP / TP+FN

2. Calculating the Answers

Now, let’s analyze your dataset with a threshold of 0.5:

1. Calculate Accuracy, Precision, and Recall:

o Use the formulas mentioned above.

I will now process the dataset to compute these values. Let me run the calculations.

3. Answering the Questions

Here are the answers based on the calculations:

1. True Positives (TP): 4

2. True Negatives (TN): 5

3. Accuracy of the Model: 0.47 (47%)

4. Precision of the Model: 0.44 (44%)


5. Recall of the Model: 0.44 (44%

4. Effect of Increasing Threshold

If we increase the threshold (say to 0.6, 0.7, etc.), the model will classify fewer instances as positive
because it will require higher confidence to classify as 1.

• True Positives (TP) will decrease because some previously classified 1s will now be classified
as 0.

• False Positives (FP) will decrease, improving precision.

• False Negatives (FN) will increase, reducing recall.

• True Negatives (TN) may increase, but not always.

As a result:

• Initially, accuracy may increase because false positives are reduced.

• At higher thresholds, accuracy may drop as too many true positives are misclassified as
negatives.

Correct Answer: "Increase then Decrease"

5. Precision for Predicting 0's

If we define precision for predicting 0 (Negative Class), it follows:

Precision for 0’s=TN/TN+FN – (ulta the formula of p1)

I'll compute that next.

6. Precision and Recall for Predicting 0's

• Precision for 0's: 0.50 (50%)

TNTN+FN=55+5=0.50\frac{TN}{TN + FN} = \frac{5}{5 + 5} = 0.50TN+FNTN=5+55=0.50

This means that 50% of the predicted negatives (0's) are actually correct.

• Recall for 0's: 0.50 (50%)

TNTN+FP=55+5=0.50\frac{TN}{TN + FP} = \frac{5}{5 + 5} = 0.50TN+FPTN=5+55=0.50

This means that 50% of the actual negatives (0's) were correctly predicted.

7. Precision and Recall for Predicting 1's

Now, let's compute precision and recall for predicting 1's.

8. Precision and Recall for Predicting 1's

• Precision for 1's: 0.44 (44%)


TPTP+FP=44+5=0.44\frac{TP}{TP + FP} = \frac{4}{4 + 5} = 0.44TP+FPTP=4+54=0.44

This means that 44% of the predicted positives (1's) are actually correct.

• Recall for 1's: 0.44 (44%)

TPTP+FN=44+5=0.44\frac{TP}{TP + FN} = \frac{4}{4 + 5} = 0.44TP+FNTP=4+54=0.44

This means that 44% of the actual positives (1's) were correctly predicted.

Final Summary of Answers

1. True Positives (TP) = 4

2. True Negatives (TN) = 5

3. Accuracy = 0.47 (47%)

4. Precision (Overall, for 1's) = 0.44 (44%)

5. Recall (for 1's) = 0.44 (44%)

6. Effect of increasing threshold: Increase then Decrease

7. Precision for predicting 0’s = 0.50 (50%)

8. Recall for predicting 0’s = 0.50 (50%)

9. Precision for predicting 1’s = 0.44 (44%)

10. Recall for predicting 1’s = 0.44 (44%)

Effect on Confusion Matrix

TP (True FP (False TN (True FN (False


Threshold Precision Recall
Positives) Positives) Negatives) Negatives)

0.5 High High Moderate Low Lower Higher

0.7 Moderate Lower Higher Higher Higher Lower

Very
0.9 Very Low Almost Zero Very High Very High Very
High

Week - 8

1. Measuring the Efficiency of a Business Unit

• Efficiency in business is measured as the ratio of outputs to inputs.

• It helps determine how well a business unit utilizes its resources to generate outputs.

• Efficiency can be measured using graphical methods or optimization techniques like DEA.
2. Efficiency Comparison - Graphical Method

• A graphical approach is useful when dealing with a small number of inputs and outputs.

• The efficiency frontier is drawn using the most efficient units, and others are compared to it.

• Units below the frontier are considered inefficient.

3. Optimization Method - Data Envelopment Analysis (DEA)

• DEA is a linear programming method used to measure relative efficiency.

• It compares multiple decision-making units (DMUs) with the same inputs and outputs.

• Efficiency Score = Output/Input (adjusted by comparing with the best-performing units).

• A unit with a score of 1 (or 100%) is efficient, while others need improvement.

4. Data Envelopment Analysis - Example with One Output and Two Inputs

• Consider a scenario where:

o Output = Total revenue

o Inputs = Labor cost & Raw materials

• DEA identifies which business units use resources most efficiently to generate revenue.

Would you like a table or visualization for better understanding?

4o

You said:

give me some example sums

ChatGPT said:

Sure! Here are a few example problems related to Measuring Efficiency & Data Envelopment
Analysis (DEA):

Example 1: Efficiency Calculation (Basic Ratio Method)

A company has the following data for two business units:

Business Unit Output (Revenue in $) Input (Cost in $) Efficiency Ratio

A 100,000 50,000 ?

B 80,000 40,000 ?

Formula:
Efficiency=OutputInput\text{Efficiency} = \frac{\text{Output}}{\text{Input}}Efficiency=InputOutput

Solution

For Business Unit A:

100,00050,000=2.0\frac{100,000}{50,000} = 2.050,000100,000=2.0

For Business Unit B:

80,00040,000=2.0\frac{80,000}{40,000} = 2.040,00080,000=2.0

Conclusion:
Both units are equally efficient since their efficiency ratio is the same.

Example 2: Efficiency with Multiple Inputs

Consider three stores with the following inputs and outputs:

Store Sales Revenue ($) Employees (Input 1) Advertising ($) (Input 2) Efficiency Score

X 500,000 50 30,000 ?

Y 400,000 45 20,000 ?

Z 600,000 60 40,000 ?

Solution Using DEA: We calculate efficiency by comparing each store's output with its weighted
inputs using the formula:

Conclusion:
Store Y is the most efficient,
while Store Z is the least
efficient.

Example 3: Data
Envelopment Analysis (DEA)
with Efficiency Scores

Assume we have three


factories with one output
(Product Units) and two
inputs (Workers & Energy
used in kWh).

Factory Output (Products) Workers (Input 1) Energy (kWh) (Input 2) DEA Efficiency Score

A 5,000 100 20,000 ?

B 6,000 120 25,000 ?


Factory Output (Products) Workers (Input 1) Energy (kWh) (Input 2) DEA Efficiency Score

C 7,000 150 30,000 ?

Using DEA software or a linear programming solver, we would compute the efficiency score for each
factory and compare it to the most efficient factory (score = 1).

Example 4: Decision-Making Using Efficiency Analysis

A logistics company wants to maximize efficiency based on the number of deliveries made and fuel
consumption.

Truck ID Deliveries Made (Output) Fuel Used (Liters) (Input) Efficiency Score

T1 200 50 ?

T2 180 45 ?

T3 250 70 ?

Using the formula:

Efficiency=OutputInput\text{Efficiency} = \frac{\text{Output}}{\text{Input}}Efficiency=InputOutput

For Truck T1:

20050=4.0\frac{200}{50} = 4.050200=4.0

For Truck T2:

18045=4.0\frac{180}{45} = 4.045180=4.0

For Truck T3:

25070=3.57\frac{250}{70} = 3.5770250=3.57

Conclusion:

• Trucks T1 and T2 are equally efficient (4.0)

• T3 is the least efficient because it consumes more fuel per delivery.

Week – 6

Multiple Linear Regression (MLR) - Overview

MLR models the relationship between a dependent variable and multiple independent variables:
✔ Used in house price prediction, sales forecasting, and medical research.

Graphical Representation:

Path Diagram & Variance Inflation Factor (VIF)

Path diagrams visually show predictor relationships.

VIF detects multicollinearity:

• VIF < 5 → Good

• VIF > 10 → High multicollinearity (remove redundant variables)

VIF Representation:

MLR in Python (Quick Steps)

1. Load Data (pandas)

2. Preprocess & Split Data

3. Fit Model (LinearRegression)

4. Check VIF (statsmodels)

5. Evaluate (R², RMSE)


mock

P=3.2+(−1.7×Age)+(1.4×Income)
After applying the sigmoid function, let's assume:

• CID01: ~0.08

• CID02: ~0.17

• CID03: ~0.89

• CID04: ~0.76

• CID05: ~0.12

Table 1 table 2

TP 1 1
FP 0 1
Actual \ Predicted Predicted Positive (P1) Predicted Negative (P0)
TN 0 0 Actual Positive True Positive (TP) = 1 False Negative (FN) = 0
FN 1 0 (A1)
Actual Negative False Positive (FP) = 0 True Negative (TN) = 1
(A0)
Defaulter = 1

Non defaulter = 0

Threshold = 0.8

TP = A1 , P1 = 1 , P > 0.8

FP = A1 , P1 = 1 , P > 0.8

FN = A1 , P1 = 1 , P > 0.8

TN = A1 , P1 = 1 , P > 0.8

Actual \ Predicted Predicted Positive Predicted Negative


(P1) (P0)

Actual Positive 0 2
(A1)

Actual Negative 1 2
(A0)

Threshold = 0.5

Actual \ Predicted Predicted Positive Predicted Negative


(P1) (P0)

Actual Positive 0 2
(A1)

Actual Negative 1 2
(A0)

You might also like