17 Pages

6 components

Course: CSCI 6221, Summer 2011
School: GWU
Rating:
 
 
 
 
 

Word Count: 1830

Document Preview

Architecture Buy, Component-based dont build Fred Broks 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. Why use components? ......................................................... 1 What are software components? .......................................... 2 Component-based Systems: A Reality!! [SEI reference] ... 4 Major elements of a component: ......................................... 5 Component...

Register Now

Unformatted Document Excerpt

Coursehero >> District of Columbia >> GWU >> CSCI 6221

Course Hero has millions of student submitted documents similar to the one
below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.

Course Hero has millions of student submitted documents similar to the one below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.
Architecture Buy, Component-based dont build Fred Broks 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. Why use components? ......................................................... 1 What are software components? .......................................... 2 Component-based Systems: A Reality!! [SEI reference] ... 4 Major elements of a component: ......................................... 5 Component Architecture...................................................... 9 Blackbox vs. Whitebox...................................................... 11 Components vs. Objects .................................................... 14 Components in industry verses in-house solutions............ 15 Component disadvantages ................................................. 16 Summary ......................................................................... 17 1. Why use components? 1 Problem with OOP: Objects are too complicated and provide too limited functionality to be useful to many clients, while components such as plug-ins provide a high-level feature that can be installed and configured by users (such as web-browser plugins). Objects do not allow for plug-and-play, integrating an object into a particular system may not be possible and therefore objects cannot be provided independently. Composition and assembly of components can be done by a larger group of people who do not have to have the specialist skills required for component development. Component-based development is a critical part of the maturing process of developing and managing distributed applications. 2. What are software components? A software component is a unit of composition with contractually specified interfaces and explicit context dependencies only. A software component can be 2 deployed independently and is subject to composition by third parties. (Workshop on Component-Oriented Programming, ECOOP, 1996.) A component is a software object, meant to interact with other components, encapsulating certain functionality or a set of functionalities. A component has a clearly defined interface and conforms to a prescribed behavior common to all components within an architecture. Multiple components may be composed to build other components. Components are expected to exhibit certain behaviors and characteristics that let them participate in the component structure and interact with its environment and other components. 3 3. Component-based Systems: A Reality!! [SEI reference] Component-based systems encompass both commercialoff-the-shelf (COTS) products and components acquired through other means, such as existing applications. Developing component-based systems is becoming feasible due to the following: the increase in the quality and variety of COTS products economic pressures to reduce system development and maintenance costs the emergence of component integration technology the increasing amount of existing software in organizations that can be reused in new systems. CBSD shifts the development emphasis from programming software to composing software systems [Clements 95]. 4 4. Major elements of a component: Specification: It is more than just list of available operations. It describes the expected behavior of the component for specific situations, constraints the allowable states of the component, and guides the clients in appropriate interactions with the component. In some cases these descriptions may be in some formal notation. Most often they are informally defined. One or more implementations: The component must be supported by one or more implementations. These must conform to the specification. The implementer can choose any programming language. Component Model: o Software components exist within a defined environment, or component model. o A component model is a set of services that support the software, plus a set of rules that must be obeyed by the component in order for it to take advantage of the services. o Established component models include MSs COM+, Suns Java J2EE or JEE 5, and the Object Management Group OMGs CORBA component standard. o Each of these component models addresses the following issues: 5 How a component makes its services available to others? How component are named? How new components and their services are discovered at runtime. o Each model also provides capabilities such as: Transaction management, persistence, and Security. A packaging approach: o Components must be grouped to provide a set of services. It is these packages that are bought and sold when acquiring from a third-party sources. They represent units of functionality that must be installed on the system. o A J2EE application is packaged as an Enterprise ARchive (EAR) file, a standard Java JAR file with an .ear extension. The goal of this file format is to provide an application deployment unit that is assured of being portable. o Different components (modules) of an application may be packaged separated to achieve maximum reusability. A deployment approach: 6 o Once the packaged components are installed in an operational environment, they will be deployed. This occurs by creating an executable instance of a component and allowing interactions with it to occur. Note that we might have different instances of a component running on the same machine. o J2EE uses deployment descriptors that are defined as in XML files named ejb-jar.xml. Example: <?xml version="1.0" encoding="UTF-8"?> <application xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/application_1_4.xsd" version="1.4"> <display-name>Simple example of application</display-name> <description>Simple example</description> <module> <ejb>ejb1.jar</ejb> </module> <module> <ejb>ejb2.jar</ejb> </module> <module> <web> <web-uri>web.war</web-uri> <context-root>web</context-root> </web> </module> </application> 7 8 5. Component Architecture A component architecture is a system defining the rules of linking components together. A standard component model includes definitions for the following (WebSphere Advisor 2000): How each component must make its services available to others? How to connect one component to another. Which common utility services can be assumed to be provided by the infrastructure supporting the component model? How new components announce their availability to Component others? Architecture Principles (Rijsenbrij) Component architecture is a set of principles and rules according to which a software system is designed and built with the use of components. It must be independent from the business domain or the technology of the application. The component architecture covers three aspects of a software system. These are: Building blocks: The architecture specifies the type of building blocks systems are composed of. 9 Construction of the software system: The architecture specifies how the building blocks are joined together when developing an application. The architecture describes the role that the building blocks play in the system. Organisation: Components are divided in categories based on their functionality. The component interface is a set of methods supported by a component, and type definitions for the data used for arguments to those methods. An interface itself is a type and can be an argument for a component method. The Common Component Architecture Forum (http://www.cca-forum.org/glossary/index.html) o An Interface Definition Language understandable to all components. Interface definitions expressed in a language allow components to find out about each other either through introspection or through consulting a repository, and give component architecture the potential to dynamically add and delete components in multi-component applications (whether this potential is actually realized or not depends on a specific implementation of the architecture). o Introspection: Inspection is the process of exposing the properties, methods, and Events that a component supports. Example: Java provides Java 10 provide an interface java.beans.BeanInfo to accomplish it. o A Reusable Combining Infrastructure provides the implementation necessary to link components. It contains mechanisms enabling the components to reference each other, understands the interface definition syntax and is capable of transferring data types and component references between components. o A Binding between the interface definition syntax and a language or framework of actual component implementation. o A Composition API allows the programmer to link components into multi-component applications and save those compositions. Such a mechanism could be provided for example by a GUI or a scripting language. Examples: BML (Bean Markup language) from IBM CoML: (http://www.springerlink.com/content/k4hy95n 563m8agv8/) 6. Blackbox vs. Whitebox Abstractions and Reuse Blackbox vs. whitebox abstraction refers to the visibility of an implementation behind its interface. 11 Ideally, a blackboxs clients dont know any details beyond the interface and its specification. For a whitebox, the interface may still enforce encapsulation and limit what clients can do (although implementation inheritance allows for substantial interference). However, the whitebox implementation is available and you can study it to better understand what the box does. Blackbox reuse refers to reusing an implementation without relying on anything but its interface and specification. For example, typical application programming interfaces (APIs) reveal no implementation details. Building on such an API is thus blackbox reuse of the APIs implementation. In contrast, whitebox reuse refers to using a software fragment, through its interfaces, while relying on the understanding you gained from studying the actual implementation. Most class libraries and application frameworks are delivered in source form and application developers study a class implementation to understand what a subclass can or must do. There are serious problems with whitebox reuse across components, since whitebox reuse renders it unlikely that the reused software can be replaced by a new release. Such a replacement will likely break some of the reusing clients, as these depend on 12 implementation details that may have changed in the new release. Some authors further distinguish between whiteboxes and glassboxes, where a whitebox lets you manipulate the implementation, and a glassbox merely lets you study the implementation. 13 7. Components vs. Objects How does component architecture differ from object architecture? An object is built around the following ideas: o Inheritance o Needs other objects to be (re)used properly o The interface defines only methods o Has only properties (state) and behavior. A component differs in the following ways: o No inheritance (although the object that make up the component may inherit behavior from other objects, possibly in other components. o The component always appears as one of multiple interfaces. o The interface formalizes properties, events and behavior. o Easily reused due to its well-defined interface. o Flat hierarchy: no direct dependencies on other external objects. o Guaranteed to function in any configuration. o Has the ability to describe its own interface at runtime. 14 List of properties contrasting Components and Objects: 8. Components in industry verses in-house solutions Fixed-price contracts can be agreed on, limiting financial risks. Existing software can be customized to business needs. Interoperability problems are left to vendor In-house developers may not have the required skill. In this case component vendors may provide better solutions. 15 9. Component disadvantages Must upgrade configuration for next release Business processes may have to be changed to suit software (rather than developing software to suit business processes) Fully testing components for integration testing will be infeasible, customers may have to proceed on a most-likely will work basis (compare with applets and browsers). Components must handle downloading and dynamic (late) integration with other components. Reliance on vendors may make adjustments to software slower. 16 10. Summary Why use components? Major elements of a component: o Specification o One or more implementations o Component Model: Each of these component models addresses the following issues: How a component makes its services available to others? How component are named? How new components and their services are discovered at runtime. o A packaging approach: Example: 2EE application is packaged as an Enterprise ARchive (EAR) file, a standard Java JAR file with an .ear extension. o A deployment approach: J2EE uses deployment descriptors that are defined as in XML files named ejb-jar.xml. Component Architecture Blackbox vs. Whitebox Components vs. Objects Components in industry verses in-house solutions Component disadvantages 17
Find millions of documents on Course Hero - Study Guides, Lecture Notes, Reference Materials, Practice Exams and more. Course Hero has millions of course specific materials providing students with the best way to expand their education.

Below is a small sample set of documents:

GWU - CSCI - 6221
Design Patterns1. Objectives .22. Definitions .22.1. What is a Pattern?.22.2. Categories of Patterns.33. Pattern Characteristics [Buschmann]: .54. Essential Elements of a Design Pattern [Gamma et al.] .65. Describing Design Patterns [Gamma et al.]
GWU - CSCI - 6221
Fundamentals of Programming Languages1. DEFINITIONS . 22. BUILT-IN TYPES AND PRIMITIVE TYPES . 3TYPE COMPATIBILITY . 9GENERIC TYPES . 14MONOMORPHIC VERSUS POLYMORPHIC . 16TYPE IMPLEMENTATION MODELS . 18IMPLEMENTATION OF STRUCTURED TYPES . 193. SCO
GWU - CSCI - 6221
This presentation contains content that your browser may not be able to show properly. This presentation was optimized for more recent versions of Microsoft Internet Explorer. If you would like to proceed anyway, click here.
GWU - CSCI - 6221
CSci 210 - Advanced Software Paradigms Exam ReviewA. BellaachiaDepartment of Computer ScienceSchool of Engineering and Applied ScienceThe George Washington UniversityWashington, DC 200522IntroductionSoftware Development ProcessLanguage and Compu
GWU - CSCI - 6212
CS 6212 FALL 11 EXERCISE 5OCT 12 (WED)Your Name (First, Last Name):Email:1. (Making Change)Consider the denominations [1, 5, 7].(a) Give an example of C &lt; 30 for which the greedy algorithm returns an incorrect answer. Writedown what the greedy algo
GWU - CSCI - 6212
CS 6212 FALL 11 EXERCISE 6OCT 19 (WED)Your Name (First, Last Name):Email:1. (Running Times) Write down the number of times the following Python programs print hello (as afunction of the input n) using the O() notation.def hello3(n):if n &lt;= 0: retur
GWU - CSCI - 6212
CS 6212 FALL 11 EXERCISE 7OCT 26 (WED)Your Name (First, Last Name):Email:1. (Bellman-Ford Algorithm)Show the computation of the Bellman-Ford algorithm on input the following graph with destinationnode t.a352d.b13t21eopt01234t00
GWU - CSCI - 6212
CS 6212 FALL 11 EXERCISE 8NOV 9 (WED)Your Name (First, Last Name):Email:1. Maximum FlowWrite down a maximum ow for the graph below (write down the ow value at every edge). Inaddition, write down the corresponding ow value.a2.s1b2d1131c
GWU - CSCI - 6212
CS 6212 FALL 11 EXERCISE 9Your Name (First, Last Name):NOV 16 (WED)Email:1. KT Chapter 7, Execerise 20(a)Dene a ow network with the following vertices:source s, a node xi representing each balloon i, a node zj representing each condition cjand a si
GWU - CSCI - 6212
cfw_CSCI 6212Lecture 1Design and Analysis of AlgorithmsHoeteck Wee hoeteck@gwu.edu.Algorithmic ideas are pervasiveapplications.Economics, auctions and game theoryBiology, genes and genomesCombinatorial optimizationInternet search and massive d
GWU - CSCI - 6212
cfw_CSCI 6212Lecture 2Design and Analysis of AlgorithmsHoeteck Wee hoeteck@gwu.edu.Stable matching probleminput. given n men and n women,each man ranks the women from best to worst.each woman ranks the men from best to worst.goal. nd a stable m
GWU - CSCI - 6212
cfw_CSCI 6212Lecture 3Design and Analysis of AlgorithmsHoeteck Wee hoeteck@gwu.edu.AnnouncementsHomeworkHomework 1 is out and due Sep 16 (Fri), 11.59 PMHomework 0 deadline is overstart early, form study groups; individual work, no copyingGener
GWU - CSCI - 6212
cfw_CSCI 6212Lecture 4Design and Analysis of AlgorithmsHoeteck Wee hoeteck@gwu.edu.Graph traversal and connectivitygraph traversalto visit the vertices in some systematic order.s-t connectivity problem.given two nodes s and t, is there a path b
GWU - CSCI - 6212
cfw_CSCI 6212Lecture 5Design and Analysis of AlgorithmsHoeteck Wee hoeteck@gwu.edu.First representative probleminterval scheduling.Input: set of jobs with start and nish times.Constraint: a single resource that can run at most 1 job at any time.
GWU - CSCI - 6212
cfw_CSCI 6212Lecture 6Design and Analysis of AlgorithmsHoeteck Wee hoeteck@gwu.edu.Shortest paths in graphsshortest path network.(weighted) directed graph G = (V, E)each edge has a length e 0length of a (directed) path = sum of lengths of all e
GWU - CSCI - 6212
cfw_CSCI 6212Lecture 7Design and Analysis of AlgorithmsHoeteck Wee hoeteck@gwu.edu.AnnouncementsMid-term 1 in two weeks (Oct 5)Topics: lectures 1 through 7 (MST)Talk to me if you got &lt; 6 points on Homework 1.Spanning treesdenition. spanning t
GWU - CSCI - 6212
cfw_CSCI 6212Lecture 8Design and Analysis of AlgorithmsHoeteck Wee hoeteck@gwu.edu.Clusteringproblem. divide n objects into k groups (a k-clustering) so that objects in differentgroups are as far apart (different) as possible.e.g. categorizing d
GWU - CSCI - 6212
cfw_CSCI 6212Lecture 9Design and Analysis of AlgorithmsHoeteck Wee hoeteck@gwu.edu.AdministrationNext week: MidtermTopics: Lectures 1 through 7, Homework 1 and Exercises 1-4(BFS, Dijkstras, Prims, Kruskals)one double-sided cheat sheet.divide-
GWU - CSCI - 6212
cfw_CSCI 6212Lecture 10Design and Analysis of AlgorithmsHoeteck Wee hoeteck@gwu.edu.divide-and-conquer algorithmsI.closest pair of pointsII. integer multiplication.Closest pair of pointsproblem. given a list of n points in the plane (x1 , y1
GWU - CSCI - 6212
cfw_CSCI 6212Lecture 11Design and Analysis of AlgorithmsHoeteck Wee hoeteck@gwu.edu.AnnouncementsHomework 2 due Oct 24Midterm 2 Nov 2.Algorithmic paradigmsgreedy. build up a solution incrementally, optimizing some local criterion.challenge: w
GWU - CSCI - 6212
cfw_CSCI 6212Lecture 12Design and Analysis of AlgorithmsHoeteck Wee hoeteck@gwu.edu.Second representative problemweighted interval scheduling.Input: set of jobs with start times, nish times and weights.Find max weight subset of non-overlapping j
GWU - CSCI - 6212
cfw_CSCI 6212Lecture 13Design and Analysis of AlgorithmsHoeteck Wee hoeteck@gwu.edu.AnnouncementsScheduleOct 26: Shortest paths | Midterm 2 reviewNov 2: Midterm 2 | Homework 3 outNov 9, 16: Network owsToday: More dynamic programmingNov 30: Mi
GWU - CSCI - 6212
cfw_CSCI 6212Lecture 14Design and Analysis of AlgorithmsHoeteck Wee hoeteck@gwu.edu.Longest common subsequence (LCS)problem. given two strings x, y, nd the longest common subsequence.CATACTHIEROGLYPHOLOGYMICHAELANGELObrute force: try all subs
GWU - CSCI - 6212
cfw_CSCI 6212Lecture 15Design and Analysis of AlgorithmsHoeteck Wee hoeteck@gwu.edu.AnnouncementsMidterm 2 on Nov 2 (Wed)one double-sided cheat sheettopics: greedy (no MST, no clustering), divide-and-conquer, dynamic programming (upto lecture 1
GWU - CSCI - 6212
cfw_CSCI 6212Lecture 16Design and Analysis of AlgorithmsHoeteck Wee hoeteck@gwu.edu.AnnouncementsHomework 3 and 4 are upMidterm 2 : mean 28, median 30, standard deviation 6Midterm 3 on Nov 30Topics: greedy, dynamic programming and network ows.
GWU - CSCI - 6212
cfw_CSCI 6212Lecture 17Design and Analysis of AlgorithmsHoeteck Wee hoeteck@gwu.edu.Reductionscommon theme.transform abstract problem into a graph problemrun a graph algorithm we know.Reductionscommon theme.transform abstract problem into a
GWU - CSCI - 6212
cfw_CSCI 6212Lecture 18Design and Analysis of AlgorithmsHoeteck Wee hoeteck@gwu.edu.Polynomial Time Algorithmsmany tasks can be solved in polynomial time (i.e. O(nc ), where c is a constant)sorting a list of n numbers: O(n log n)minimum spanning
GWU - CSCI - 6212
cfw_CSCI 6212Lecture 19Design and Analysis of AlgorithmsHoeteck Wee hoeteck@gwu.edu.Minimum cutDenitions1. Cut: set of edges whose removal render the graph disconnected2. Minimum cut: cut of the smallest size (size = # edges in the cut)14bd
Syracuse - PSY - 205
PSY205 Personality Ch. 12 What is Personality? - Consistency - Distinctiveness - Personality refers to an individual's unique constellation of consistent behavior traits. Personality Traits - A personality trait is a durable disposition to behave in a par
Syracuse - PSY - 205
PSY205 9/6/11 Biopsychology -Memory, thinking, mental illness Pineal Gland - Where soul exerts it will on the mind Definition: Bios, psyche, logos Rene Descartes (1569-1650) - 5ft 2 - Mathematician, soldier, philosopher - I think therefore I am - People h
Syracuse - PSY - 205
PSY205 9/8/11 John B. Watson - Behaviorism: Any overt o Genetics vs. Environment? Environment - Stimulus Response Psychology vs. Common sense - Is psychology common sense? NO - Common sense is . o Made up after the fact
Syracuse - PSY - 205
PSY205 9/15/11 Carolinne Koller's Presentation Sensations &amp; Preceptions Rene Descartes - La Haye, Touraine, France - Canon &amp; Civil Law - Philo, Psych - Mind, body, soul - Contributed to psychology o Flow of &quot;animal spirit&quot; o Books Meditations on first phi
Syracuse - HST - 112
HST 112Worksheet: Communism, Fascism, National SocialismSovietCommunismItalianFascismIdeologicalUtopian, antifeatures and/or liberal,ideological core socialismClassesNature/style of Communismrulestate controlslife, everyequalNature ofSuppr
Syracuse - PSY - 223
CHAPTER 15 DRUG ADDICTION PSY 223 SPRING 2012HOW ARE DRUGS ADMINISTERED? ORAL INGESTION INJECTION INHALATION ABSORPTION THROUGH MUCOUS MEMBRANESTYPICAL MAINLININGFASTEST WAY TO GET DRUG INTO BRAIN NO CHANCE TO CHANGE BEHAVIORTHE DOSE-RESPONSE CURVE D
Syracuse - PSY - 223
PSY223 Notes 4/23/12 CH.15 Drug Addiction How Are Drugs Administered - ORAL INGESTION - INJECTION - INHALATION - ABSORPTION THROUGH - MUCOUS MEMBRANES Typical Mainlining - Fastest way to get drug into brain - No chance to change behavior Often the more yo
Syracuse - PSY - 335
PSY335Discipline Styles- Power assertiono Physical force or threat of physical force to control behavioro Taking away privileges or possessionso Used by 90% of parentsPower Assertion- Spankingo Boys spanked more often than girlso Mothers do more
Syracuse - PSY - 335
PSY335Early ChildhoodSocial and Emotional DevelopmentSelf Concept- Schema/mental representation of self- All our knowledge about who we are- Beliefs about our attributes &amp; capabilitiesSelf Concept Contents- Internalo Psychological Traitso Feelin
Syracuse - PSY - 335
PSY335Early Childhood:Cognitive Development3/28/12Conservation- After asking children to judge the quantity, length, or number.- When make incorrect judgments, children say:Conservation Errors- Reasoning errors involve Contractiono Thinking about
Syracuse - EAR - 111
EAR111 Recitation Quiz Week of 10/24 1. CO2 dissolves more readily into _. a. Warm water b. Cold water Correct answer: B 2. Which of the following is NOT a reason for ocean circulation? a. Winds b. Salinity of the water c. Temperature of the water d. Oxyg
Syracuse - PSC - 121
PSC121 Quiz 11. Match each of these with the statement below that defines the conceptC LibertyF IndividualismA EqualityE The social contractB ConstitutionalismD CapitalismA. The notion that all individuals are equal in their moral worth and thereb
Syracuse - PSC - 121
PSC121EXAM 1T or F 1. A conservative ideologue is someone who thinks that opportunity in America isno available to enough people and we should expand access to opportunity through moregovernment programsCorrect Answer: FT or F 2. A liberal thinks th
Syracuse - PSC - 121
Nicolas4/6/11Discussion Teacher: JennPSC121MEMOFor next weeks recitation you must write a one-two page memo (per the syllabusrequirements). This memo must be supported with evidence you find in the books especially Bianco and Canon. If there are sp
Syracuse - PSC - 121
PSC 121 Quiz 6ElectionsT F 1. A closed primary is one in which only those registering as a party member can voteCorrect Answer TT F 2. In presidential primaries, Republicans use winner-take-all rules for deciding whowins a states delegates while Demo
Syracuse - PSC - 121
PSC121 Quiz 7Congress1. In 2008 House districts that voted at lower levels for Obama elected:a. Equal percentages of Democrats and Republicansb. More Republicans than Democratsc. More Democrats than RepublicansCorrect Answer: BT F 2. The stimulus b
Syracuse - PSC - 121
PSC121 Quiz 8Congress1. Paul Ryans video says that over the next several decades the debt of the federalgovernment as a percentage of national income will:a Increaseb. Stay about the samec. DecreaseCorrect Answer: A2. The graphic video of tax obli
Syracuse - PSC - 121
PSC121: Quiz 3Civil Liberties and Public Opinion1. The essential reason for our civil liberties is to:a. Restrain citizen so they will operate in a reasonable way within a democracyb. Protect citizens from a government that may intimidate themc. Bala
Miami University - COM - 437*
Bolstering: The new theater productions will include interactive plays, musicals, anddance performances for children to enjoy while parents are gambling, in order to create a family atmosphere. The first underlined sentence is bolstering because we are r
Miami University - COM - 437*
April 23, 2012 Contact Information: John Smith, Communication Director FOR IMMEDIATE RELEASE Office: (609) 451-6102 Fax: (609) 851-5472 Email: john.smith@mamas.com MAMA'S CASINO ADDRESSES RECENT COMMISSION VIOLATIONS ATLANTIC CITY, NJ-The New Jersey Gamin
Miami University - SOC - 265
Professor LuMing Mao April 23, 2012Beyond Bias, Binary, and Border: Enacting a Discursive Third in Comparison RhetoricsProfessor LuMing Mao's lecture consisted of concepts I have never heard of before. He spoke about the &quot;discursive third&quot;, &quot;dao&quot;, &quot;zira
Harvard - STATS - 107
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39FMAGX -0.105296 -0.075943 0.139102 0.136679 0.060516 -0.013755 0.087637 0.02166 0.053087 -0.054276 0.054496 0.03876 -0.043688 0.030076 0.066288 0.0
Harvard - STATS - 107
Stat 107 Spring 2012 HW #5 Solutions1 (a) The following weights are obtained from Excel Solver (note: since we are dealing with minimizing an absolute value, there is NOT ONE UNIQUE SOLUTION, and the weights you get may vary slightly): Description FMAGS
Harvard - STATS - 107
### Prob #2 function##pairs.trade=function(ticker1, ticker2, from=&quot;2007-01-01&quot;, to=Sys.Date(),type=&quot;z.diff&quot;,threshold=2,closeout=T)cfw_ require(quantmod) names=c(ticker1,ticker2) y=getSymbols(ticker1,auto.assign=F,from=from,to=to) x=getSymbols
Harvard - STATS - 107
Stat 107 - Spring 2012 - HW4 SolutionsQuestion 1a)Table 1: Beta from Different Sources Google JNJ 0.53 IBM 0.65 MSFT 1.00 GOOG 1.08 GE 1.58 DIS 1.21 UPS 0.83 MU 1.25 BA 1.22 C 2.56 AAPL 1.25 Yahoo Reuters MM (SPY) 0.45 0.53 0.45 0.60 0.66 0.59 1.05 1.0
Harvard - STATS - 107
Stat 107 Spring 2012 Homework #3 Solutions1. The Portfolio which invests 35.28% in stock A and the rest in stock B gives a higher mean return (42.62%) for the same standard deviation. This is shown below: stock A stock B Portfolio mean 14.25% 62.72% 45.6
Harvard - STATS - 107
Stat 107 Spring 2012Harvard UniversityHomework 2 Solutions 1. GMC Envoys See hw2 q1.R for code. Our goal is to find the order size S that gives us the highest average profit across simulations of D. Given consumer demand D and an order size S, the deale
Harvard - STATS - 107
Interest Initial Deposit Year 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Value8% $155$167.40 $180.79 $195.26 $210.88 $227.75 $245.97 $265.64 $286.89 $309.85 $334.63 $361.40 $390.32 $421.54 $455.27 $491.69 $531.02 $573.50 $619.38 $668.93 $722.4
Harvard - STATS - 107
Stat 107 Spring 2012 Homework 1 Solutions1) 2) 3) 4) 5) See Excel file &quot;Problem 1&quot; See Excel files &quot;Problem 2.1&quot; and &quot;Problem 2.2&quot; See Excel file &quot;Problem 3&quot; See Excel file &quot;Problem 4, 5&quot; See Excel file &quot;Problem 4, 5&quot;6) Note: in this problem, we used th
Harvard - STATS - 107
#1)library(quantmod)pgr=getSymbols(&quot;PGR&quot;, auto.assign=F,from=&quot;2009-04-01&quot;,to=&quot;2012-03-31&quot;)pgradj=Ad(pgr)pgrrets.d=dailyReturn(Ad(pgr)plot(pgradj)plot(pgrrets.d)acf(pgradj)acf(pgrrets.d)round(c(mean(pgradj),sqrt(var(pgradj),length(pgradj),5)roun
Harvard - STATS - 107
#1) f=file.choose()survey=read.csv(f,header=T)names(survey)t.test(text_day~gender, var.equal = FALSE, data=survey)by(survey$text_day,survey$gender,mean,na.rm=T)by(survey$text_day,survey$gender,sd,na.rm=T)by(!is.na(survey$text_day),survey$gender,su
Harvard - STATS - 107
#1) Style Analysislibrary(quantmod)getSymbols(&quot;VWNDX&quot;,from=&quot;2009-01-01&quot;,to=&quot;2012-03-31&quot;)getSymbols(&quot;VDIGX&quot;,from=&quot;2009-01-01&quot;,to=&quot;2012-03-31&quot;)getSymbols(&quot;VHGEX&quot;,from=&quot;2009-01-01&quot;,to=&quot;2012-03-31&quot;)getSymbols(&quot;VITAX&quot;,from=&quot;2009-01-01&quot;,to=&quot;2012-03-31&quot;)VW
Harvard - STATS - 107
#Pairs Trading Companies:#Home Depot (&quot;HD&quot;) and Lowes (&quot;LOW&quot;)#Papa Johns (&quot;PZZA&quot;) and Dominoes (&quot;DPZ&quot;)#Walmart (&quot;WMT&quot;) and Target (&quot;TRGT&quot;)#McDonalds (&quot;MCD&quot;) and Taco Bell/KFC/Pizza Hut (&quot;YUM&quot;)#Dell (&quot;DELL&quot;) and HP (&quot;HPQ&quot;)#Coke (&quot;COKE&quot;) and Pepsi (&quot;