hw03

pdf

School

University of California, Berkeley *

*We aren’t endorsed by this school

Course

61B

Subject

Economics

Date

Apr 3, 2024

Type

pdf

Pages

6

Uploaded by CaptainMonkey3984

Report
0.0.1 Question 1d Suppose we are interested in using the news to predict future stock values. What additional data would we need to predict stock prices, and how could we connect that data to news articles? In addition, what attributes or characteristics of the news might help predict the stock value? Additional data we would need to predict stock prices would be historical stock trends, company-specific financial data, and reports on economic trends. We could connect that data to news articles because news articles can inform changes in a company and their stock’s performance, provide timestamps for major occurances, and sentiment/topic analysis can identify trends and sentiment towards stocks, supporting our data analysis. Attributes of the news that might predict stock value could be sentiment trends, market condition indicators, keywords on stock prices (ex. spike, increase, rise, plummet), company event patterns, etc. 1
2
Question 2d, Part ii Given your code in the previous part is correct, after running the cell below, you should be able to see the number of articles released mentioning companies for each year. The plot should look like this: In [52]: plt . figure(figsize = ( 6 , 4 )) for company in companies: sns . lineplot(data = year_news . reset_index(), x = "Year" , y = company, label = company) plt . legend(fontsize = "12" ) plt . xticks(np . arange( 2010 , 2014 ), np . arange( 2010 , 2014 )) plt . ylabel( "Number of Articles" ) plt . xlabel( "Year" ) plt . title( "Number of Articles Released (2010-2013)" ); What trends do you notice in the plot above? Feel free to reference or Google any events to explain the trends seen in the graph. What are some limitations of using data and the corresponding plot to analyze the performance of different companies or trends? 3
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
Hint: Remember the source of the articles and the subset of the articles we are analyzing in this assignment. In the plot, there is an extreme spike in the number of articles released on Apple in 2012, likely because it was the year the Apple v. Samsung lawsuits went to trial, two of the company’s top executives departed the company, the iPad Mini was launched, and other major events surrounding Apple’s management and products occured. In 2012, Facebook and Amazon also experienced upticks in the artices, while Sony and Nintendo experienced a decrease. In 2013, Sony experienced an increase in articles released compared to 2012, likely to the company’s launching of various Playstation events. Some limitations of using data and the corresponding plot is that the source of the articles is just Bloomberg articles, meaning that articles published from other agencies are not included, eliminating a large subset of the articles released. Furthermore, the subset of the data is only on articles during 2010-2013, and different companies or trends may have experienced short-term fluctuations during this short period that cannot be utilized to analyze long-term performance. The subset of companies included in the analysis is small as well. 4
Question 3c, Part ii Below we have provided a plot looking at these differences. Comment on why we see differences when calculating the sentiment of an article as the sentiment of the first sentence mentioning “microsoft” or “msft” in the article versus the sentiment of the entire article itself. How does context play a role when evaluating the sentiment of a text? In [152]: sns . kdeplot(msft_scores_2010[ 'sentiment_difference' ]) plt . xlabel( 'Sentiment difference' ) plt . title( 'Difference between full and approximate sentiment scores' ); There are differences in the sentiment when looking at the first sentences versus the entire article because the first sentence of an article may contain heavier positive or negative connotations on a company compared to the rest of the article or the first sentence may not fully encapsulate the sentiment of the article solidified later on through interview quotes, data, additional commentary, etc. Furthermore, attitudes towards a company may shift and change throughout the article and the first sentence may only contain a singular perspective/examination of a company. Context plays an important role because analyzing only a portion of an article can lead to inaccurate assessment because a holistic understanding, versus a limited window view, eliminates bias or oversimplification. 5
6
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