TELE 9753 Advanced Wireless Communications Tutorial 4 - Receive Diversity Question 1 Consider a BPSK modulation that achieves a bit error rate of Pb = 10−3 on the AWGN channel. Find the outage probability of this BPSK modulation for the Rayleigh fading channel with selection combining (SC) diversity for M = 1 (no diversity), M = 2 and M = 3, where M denotes the number of receive antennas. Assume equal branch SNRs with γ = 15 dB. Homework 4 Requirements 1. Write down your full name, student number, and signature. 2. Detail the steps of your analysis/calculations/solutions. A single answer without derivations or expla-nations is not acceptable. 3. Hand in a hard copy in the following class or submit it via Teams. Question 1 Consider a QPSK modulation that achieves a bit error rate of Pb = 10−3 on the AWGN channel. Find the outage probability of this QPSK modulation for the Rayleigh fading channel with selection combining (SC) diversity for M = 1 (no diversity), M = 2 and M = 3. Assume unequal branch SNRs with γ1 = 10 dB, γ2 = 15 dB, and γ1 = 20 dB. Hint: Determine the bit error probability formula and evaluate the Q-function using Q-function table or mathematic softwares (e.g., Matlab or Mathematica). Please be aware that this question assumes unequal branch SNRs, where M = 1 contains γ1 , but M = 2 contains both γ1 and γ2 . Question 2 Assume that four branch diversity is used, where each branch receives an independent Rayleigh fading signal. If the average SNR is 20 dB on each branch, determine the probability that the SNR will drop below 10 dB. Compare this with the case of a single receiver without diversity. Consider SC first, then MRC.
Module No: TRP222 Title: Professional Skills Credit Value: Pass/Fail Level: 2 Semester: Academic Year 2024-25 Assessment Brief Number of assessments: Two This is a pass/fail module. To pass this module students have to attend 60% of the sessions (which is 2 out of 4 sessions). Students also need to complete the MySkills exercise, and submit a CV and Cover letter. Assignment 1: CV and Covering Letter For this assignment, you will submit a CV following the template, based on you applying to an example placement advert as well as Covering Letter. Format 2 elements to the assignment. You need to submit ALL parts via Blackboard, 2 separate documents: ● Your CV, following the template provided (either a word or pdf document) ● A Covering Letter following the template structure (either a word or pdf document) Your CV and Covering Letter should be tailored to the specific advert outlined in the assignment session. Assignment 2: mySkills Exercise (SPR Semester) *MySkills Exercise- For this assessment, you are required to submit three written Development Experiences (approximately 250 words each) reflecting on how you have developed key skills during their second year. Each Development Experience should focus on a different Sheffield Graduate Attribute, and they may select any three attributes from the following areas: myLearning, myImpact, and mySelf. You are free to choose any experiences from your second year, but we recommend they draw from their experience on the TRP215 Researching the City fieldtrip (e.g. hearing from practitioners) and/or from their own work experiences (internships etc.) and applying for these opportunities. Marking criteria You need to submit all 3 elements in order to pass this element of the module. If you fail to submit one element you will not be able to pass this module. Discussion with your Academic Tutor: Discussing your MySkills Exercise with your academic tutor during the SPR Semester (time to be confirmed) is essential. This meeting will serve as a check-in for your submission, offering an opportunity to reflect on your progress and receive valuable verbal feedback to support your development. Submission guidelines You only get one chance to submit on Blackboard for this module so ensure that all 3 elements are selected before submitting. Please note: Any required extensions must be negotiated and agreed with USP office. . How you will receive feedback on your work: You will receive written feedback on your CV and Covering Letter via Blackboard. You will receive your feedback within 4 to 6 weeks of the submission deadline for the assessment. If, due to unforeseen circumstances (such as illness), it is not possible to return work within this timescale, all students will be notified. Use of Generative AI Please make sure you are aware of and follow the School of Geography and Planning guidelines on the use of Generative AI that are set out in your student handbook. This requires you to declare any use of GenerativeAI tools in assessed work.
BGP Measurements Project – Summer 2025 Motivation In this assignment, we will explore Internet Measurements, a field of Computer Networks which focuses on large scale data collection systems and techniques that provide us with valuable insights and help us understand (and troubleshoot) how the Internet works. There are multiple systems and techniques that focus on DNS measurements, BGP measurements, topology measurements, etc. There are multiple conferences in this area, which we invite you to explore and keep up with the papers that are published. The IMC conference is one of the flagship conferences in this area:ACM Internet Measurement Conference A gentle introduction into the Internet Measurement field is to work with large scale BGP measurements and data to study topics such as: • Characterizing growth of the Internet using various measures, such as number of advertised prefixes, the number of Autonomous Systems, the percentage growth of prefixes advertised by Autonomous System, and the dynamics of Autonomous System path lengths • Inferring problems related to short-lived Announcement and Withdrawals, • Inferring possible DDoS attacks by identifying community countermeasures such as “Remote Triggered Blackholing” Introduction In this project we will use the BGPStream tool and its Python interface PyBGPStream to understand the BGP protocol and interact with BGP data. The goal is to gain a better understanding of BGP and to experience how researchers, practitioners, and engineers have been using BGPStream to gain insight into the dynamics of the Internet. If you are interested in going deeper, you can use these same tools to observe and analyze real-time BGP data or download and analyze other historical BGP data. Project Overview and Background The zip file accompanying this assignment contains the code and data needed to implement the functions in the file bgpm.py. You will submit only bgpm.py to Gradescope and all your code for the project must be contained within bgpm.py. This project description, in combination with the comments in bgpm.py, comprise the complete requirements for the project. There are two complete sets of data included in the zip file and the provided test harness in check_solution.py will test each of your functions against both sets of data. You are welcome to copy and modify check_solution.py to better suit your development and debugging workflow, but you will have the best chance of success with the hidden data set used for grading if your final submission passes all the tests in the unmodified check_solution.py. This project is designed to work in the class VM where the BGPStream libraries are installed. Your code will need to run without modification in the course VM. Some of the functions will have runtimes of several minutes. There is a lot of data to process, so the best way to speed up those functions is by focusing on the efficiency of your implementation. It is possible, but not supported, to install BGPStream and PyBGPStream on your local machine. Please don’t ask TA staff for help if you decide to do this. Gradescope imposes a hard time limit of 40 minutes for a grading session. We have no control over this and will not be able to make any allowances if your submission does not complete within that time limit. Required Background For this project, we will be using BGPStream, an open-source software framework for live and historical BGP data analysis, supporting scientific research, operational monitoring, and post - event analysis. BGPStream andPyBGPStreamare maintained by theCenter for Applied Internet Data Analysis(CAIDA). Read the resources A high-level overview about how the BGPStream tool was developed was published by CAIDA in BGPStream: A Software Framework for Live and Historical BGP Data Analysis. This paper provides useful background and practical examples using BGPStream, so be sure to read it. Additionally, you should read African peering connectivity revealed via BGP route collectors, which provides a practical illustration of how the BGP collection system works. Run Example Code Snippets All the tasks are to be implemented using the Python interface to BGPStream. You are strongly encouraged to browse the following resources to familiarize yourself with the tool, and to run the example code snippets: - PyBGPStream API:https://bgpstream.caida.org/docs/api/pybgpstream - PyBGPStream API Tutorial:https://bgpstream.caida.org/docs/tutorials/pybgpstream - PyBGPStream Repository:https://github.com/CAIDA/pybgpstream - Official Examples:https://github.com/CAIDA/pybgpstream/tree/master/examples Important Note As will become apparent when you peruse the above documentation and tutorial information, the majority of BGPStream use cases involve gathering data – either live or historical – directly from the Route Collectors (which we refer to simply as “collectors”). The code for accessing a collector or set of collectors directly usually looks like this: stream = pybgpstream.BGPStream( record_type="updates", from_time="2017-07-07 00:00:00", until_time="2017-07-07 00:10:00 UTC", collectors=["route-views.sg", "route-views.eqix"], filter="peer 11666 and prefix more 210.180.0.0/16" ) Each of the parameters to pybgpstream.BGPStream() winnows the data retrieved from the collector(s). Because we are using pre-cached historical data in this project, you will not need to specify a collector or a time range. You also don’t need to use any additional filtering. For this project, you can use set up and configure your streams with: stream = pybgpstream.BGPStream(data_interface="singlefile") stream.set_data_interface_option("singlefile", type, fpath) where type is one of [“rib-file”, “upd-file”] and fpath is a string representing the path to a specific cache file. When processing multiple files, you will create one stream per file. Familiarize Yourself with the BGP Record Format and BGP Attributes It is critical that you understand the BGP record format, especially the meaning and content of the fields (data attributes). A detailed explanation of BGP records and attributes can be found in RFC 4271: A Border Gateway Protocol 4 (BGP-4). It’s also worth spending some time exploring the provided data using theBGPReadercommand line tool (“a command line tool that prints to standard output information about the BGP records and the BGP elems that are part of a BGP stream”). Doing so will be particularly helpful in understanding how the fields described in RFC 4271 and elsewhere map to the BGP record and BGP elem concepts used by BGPStream and PyBGPStream. Because PyBGPStream allows you to extract the BGP attributes from BGP records using code, you will not have to interact with the BGP records in this format, but it is, nevertheless, helpful to see some examples using BGPReader to understand the fields. The next section shows Here, we will show sample command line output from BGPReader for illustration purposes: # read records from an update file, filtering for IPv4 only bgpreader -e --data-interface singlefile --data-interface-option upd-file=./rrc04/update_files/ris.rrc04.updates.1609476900.300.cache --filter 'ipv 4' # read records from a rib file, filtering for IPv4 only bgpreader -e --data-interface singlefile --data-interface-option rib-file=./rrc04/rib_files/ris.rrc04.ribs.1262332740.120.cache --filter 'ipv 4' Update Example The box below contains an example of an update record. In the record, the “ | ” character separates different fields. In yellow we have highlighted the type (A stands for Advertisement), the advertised prefix (210.180.224.0/19), the path (11666 3356 3786), and the origin AS (3786). update |A |1499385779.000000 |routeviews |route- views.eqix |None |None |11666 |206.126.236.24 |210.180.224.0/19 |206. 126.236.24 |11666 3356 3786 |11666:1000 3356:3 3356:2003 3356:575 3786:0 3356:22 11666:1002 3356:666 3356:86 |None |None RIB Example The following is a Routing Information Base (RIB) record example. Consecutive “ | ” characters indicate fields without data. R |R |1445306400.000000 |routeviews |route- views.sfmix |||32354 |206.197.187.5 |1.0.0.0/24 |206.197.187.5 |3235 4 15169 |15169 ||| Setup Do not rely on the directory layout of the provided data. Gradescope does not mirror the directory layout from the provided files. Specifically, in your final submission, do not directly access the filesystem in any way and do not import all or part of either os or pathlib. All filesystem interaction will occur via PyBGPStream and the file paths will be taken from the Python list in the parameter named cache_files that is passed to each function. Cache Files / Snapshots Locate the directory rrc04/rib_files included with this assignment. This directory contains RIB dump files. Each filename (e.g., ris.rrc04.ribs.1262332740.120.cache) includes the collector’s name (ris.rrc04), the type of data (ribs), and theUnixtimestampof the data (1262332740, which you can convert to a date via either of the two above links). Each of the cache files is a snapshot of BGPM data collected by the collector at the time of the timestamp. In the rest of this assignment the term “snapshot” refers to the data in a particular cache file. Do not pull your own data. Your solution will be graded using cached data only. You will need to write code to process the cache files. Each entry in cache_files is a string containing the full path to a cache file. To access a given path, your code will need to set up the appropriate data interface in your BGPStream() constructor: stream = pybgpstream.BGPStream(data_interface="singlefile") stream.set_data_interface_option("singlefile", type, fpath) where type is one of [“rib-file”, “upd-file”] and fpath is a string representing the path to a specific cache file. When processing multiple files, you will create one stream per file. Tip: Your code shouldn’t make assumptions about the number of cache files. Task 1. Understanding BGP Routing table Growth In this task you will measure the growth over time of Autonomous Systems and advertised prefixes. The growth of unique prefixes contributes to ever-growing routing tables handled by routers in the Internet core. As optional background reading, please read the seminal paperOn Characterizing BGP Routing Table Growth. Task 1A: Unique Advertised Prefixes Over Time This task will use cache files from the rib_files subdirectories. These are RIB files, so you will pass “rib-file" in your call to set_data_interface_option(). Using the data from cache files, measure the number of unique advertised prefixes over time. Each file is an annual snapshot. Calculate the number of unique prefixes within each snapshot by completing the function unique_prefixes_by_snapshot(). Make sure that your function returns the data structure exactly as specified in bgpm.py. Task 1B: Unique Autonomous Systems Over Time This task will use cache files from the rib_files subdirectories. These are RIB files, so you will pass “rib-file" in your call to set_data_interface_option(). Using the data from the cache files, measure the number of unique Autonomous Systems over time. Each file is an annual snapshot. Calculate the number of unique ASes within each snapshot by completing the function unique_ases_by_snapshot(). Make sure that your function returns the data structure exactly as specified in bgpm.py. Note: Consider all paths in each snapshot. Here, we consider all AS that appear in the paths (not only the origin AS). You may encounter corner cases of paths with the following form.: “25152 2914 18687 {7829,14265}”. In this case, consider the AS in the brackets as a single AS. So, in this example, you will count 4 distinct ASes. Task 1C: Top-10 Origin AS by Prefix Growth This task will use cache files from the rib_files subdirectories. These are RIB files, so you will pass “rib-file" in your call to set_data_interface_option(). Using the data from the cache files, calculate the percentage growth in advertised prefixes for each AS over the entire timespan represented by the snapshots by completing the function top_10_ases_by_prefix_growth(). Make sure that your function returns the data structure exactly as specified in bgpm.py. Consider each origin AS separately and measure the growth of the total unique prefixes advertised by that AS from its first appearance to its last appearance. To compute this, for each origin AS: 1. Identify the snapshots where the origin AS first appears and last appears in the dataset. Note: Don’t make assumptions about when an AS can appear - an AS is not guaranteed to appear in every snapshot, nor is it guaranteed to appear in the first and last snapshots. 2. Calculate the percentage increase of the advertised prefixes, using the identified first and the last snapshot appearances. For example, assuming 5 given cache files, let’s say AS X first appeared in the 2nd snapshot and last appeared in the 4th and advertised the following number of prefixes: 0, 124, 215, 512, 0 The percentage increase would then be: 124/(512 - 124) = 3.13 or 313% 3. Report the top 10 origin AS that experienced the largest growth, and sort those from smallest to largest. Note: There are no ties, so don’t worry about implementing tie-breaking. Edge case: When calculating the prefixes originating from an origin AS, you may encounter paths of the following form.: “25152 2914 18687 {7829,14265}”. This is an edge case, and it should affect only a small number of prefixes. In this case, you consider the entire set of AS “{7829,14265}” as the origin AS. Task 2: Routing Table Growth: AS-Path Length Evolution Over Time In this task you will measure if an AS is reachable over longer or shorter path lengths as time progresses. Towards this goal you will measure the AS path lengths, and how they evolve over time. This task will use cache files from the rib_files subdirectories. These are RIB files, so you will pass “rib-file" in your call to set_data_interface_option(). Using the data from the cache files, calculate the shortest path for each origin AS in each snapshot by completing the function shortest_path_by_origin_by_snapshot(). Make sure that your function returns the data structure exactly as specified in bgpm.py. For each snapshot, you will compute the shortest AS path length for each origin AS in the snapshot by following the steps below: - Identify each origin AS present in the snapshot. For example, given the path “11666 3356 3786”, “3786” is the origin AS. - For each origin AS, identify all the paths for which it appears as the origin AS. - Compute the length of each path by considering each AS in the path only once. In other words, you want to remove the duplicate entries for the same AS in the same path and count the total number of unique AS in the path. - Example: Given the path “25152 2914 3786 2914 18313” , ”18313” is the origin AS and ”2914” appears twice in the path. This is a path of length 4. - Among all the paths for an AS within the snapshot, compute the shortest path length. - Filter out all paths of length 1. - Corner cases: The data that we are working with are real data, which means that there may be few corner cases. In the vast majority of cases, paths have a straightforward form. of “25152 2914 3786”, but you might encounter corner cases such as: a. If an AS path has a single unique AS or a single repeated AS (e.g., “25152 25152 25152”), the path has length 1 and should be ignored b. An AS path entry that looks like “{2914,14265}” is an aggregate or AS_SET and constitutes a single AS path entry. It does not need to be parsed in any way. You can read more about aggregation in RFC 4271. Example: The length of the AS path “25152 2914 18687 {2914,14265} 2945 18699” is 6. Example: The length of the AS path “25152 2914 18687 18687 {18687}” is 4. The entries “18687” and “{18687}” are distinct, so you only de-duplicate “18687” . c. You can ignore all other corner cases. Task 3: Announcement-Withdrawal Event Durations In this task, we will measure how long prefix Announcements last before they are withdrawn. This matters because, when a prefix gets Advertised and then Withdrawn, this information propagates and affects the volume of the associated BGP traffic. Optional background reading on this topic can be found inThe Shape of a BGP Update. This task will use cache files from the update_files subdirectories. These are update files, so you will pass “upd-file" in your call to set_data_interface_option(). Using the data from the cache files, we will measure how long prefix Announcements last before they are withdrawn by completing the function aw_event_durations(). Make sure that your function returns the data structure exactly as specified in bgpm.py. In defining Announcement Withdrawal (AW) events, we will only consider explicit withdrawals. An explicit withdrawal occurs when a prefix is advertised with an (A)nnouncement and is then (W)ithdrawn. In contrast, an implicit withdrawal occurs when a prefix is advertised (A) and then re-advertised (A) - usually with different BGP attributes. To compute the duration of an Explicit AW event for a given peerIP/prefix, you will need to monitor the stream of (A)nnouncements and (W)ithdrawals separately per peerIP/prefix pair. - Example: Given the stream: A1 A2 A3 W1 W2 W3 W4 for a specific peerIP/prefix pair, you have an implicit withdrawal A1-A2, another implicit withdrawal A2-A3, and, finally, an explicit withdrawal (and AW event) A3-W1. W1-W2, W2-W3, and W3-W4 are all meaningless, as there’s no active advertisement. The duration of the AW event is the time difference between A3 and W1. Again, we are only looking for last A and first W. - Example: Given the stream: A1 A2 A3 W1 W2 W3 W4 A4 A5 W4 for a specific peerIP/prefix pair, we have two AW events at A3-W1 and A5-W4. - We consider only non-zero AW durations. Task 4: RTBH Event Durations In this task you will identify and measure the duration of Real-Time Blackholing (RTBH) events. You will need to become familiar with Blackholing events. Good resources for this includeRFC 7999, Section 2,BGP communities: A weapon for the Internet (Part 2), and the videoNokia - SROS: RTBH - Blackhole Community. This task will use cache files from the update_files_blackholing subdirectories. These are update files, so you will pass “upd-file" in your call to set_data_interface_option(). Using the data from the cache files, we will identify events where prefixes are tagged with a Remote Triggered Blackholing (RTBH) community and measure the time duration of the RTBH events by completing the function rtbh_event_durations(). Make sure that your function returns the data structure exactly as specified in bgpm.py. The duration of an RTBH event for a given peerIP/prefix pair is the time elapsed between the last (A)nnouncement of the peerIP/prefix that is tagged with an RTBH community value and the first (W)ithdrawal of the peerIP/prefix. In other words, we are looking at the stream of Announcements and Withdrawals for a given peerIP/prefix and identifying only explicit withdrawals for an RTBH tagged peerIP/prefix. To identify and compute the duration of an RTBH event for a given peerIP/prefix, you will need to monitor the stream of (A)nnouncements and (W)ithdrawals separately per peerIP/prefix pair. - Example: Given the stream: A1 A2 A3(RTBH) A4(RTBH) W1 W2 W3 W4 for a specific peerIP/prefix pair, A4(RTBH)-W1 denotes an RTBH event and the duration is calculated by taking the time difference between A4(RTBH) and W1. - Note: There can be more than one RTBH event in a given stream. For example, in the stream A1 A2 A3(RTBH) A4(RTBH) W1 W2 W3 W4 A5(RTBH) W5, there are two RTBH events: A4(RTBH)-W1 and A5(RTBH)-W5. - Example: Given the stream A1 A2 A3(RTBH) A4 A5 W1 W2 for a specific peerIP/prefix pair, the announcement A3(RTBH) followed by A4 is an implicit withdrawal. There is no explicit withdrawal and, thus, no RTBH event. - In case of duplicate announcements, use the latest. - Consider only non-zero duration events.
MGMT 316 Decision Modelling for Managers An examination of selected managerial problem structuring methodologies and analytic approaches to decision-making, emphasising an applied computer-oriented approach, and the development of decision-making, problem-solving and judgmental skills, particularly for situations involving risk and uncertainty. The course involves the development of algorithms and building of computer models. About this course The course guides students through the processes of identifying and framing managerial decision problems, developing a range of models to gain insight into the decision problem, evaluating these models and making recommendations for actions to be taken. It requires the development and use of both quantitative and qualitative decision-making tools. The course is taught in a computer laboratory setting to facilitate the use of computer tools including Excel and R in both instructional and self-learning cases. Course learning objectives Students who pass this course should be able to: 1. Interpret major frameworks, approaches, concepts and conceptual vocabulary relevant to decision modelling for managers 2. Critically analyse different frameworks and modelling approaches and use them to enhance decision making capabilities 3. Identify key elements of managerial decision situations, and develop robust solutions through decision modelling 4. Understand the importance of critical analysis and critical assessment of decision models and the outcomes of decision modelling outcomes of decision modelling 5. Understand the importance of leadership in setting managerial problem-solving objectives and decision criteria as a basis for decision and policy modelling 6. Communicate clearly in written, diagrammatic and oral form. a critical assessment of decision models and the outcomes of decision modelling 7. Recognise ethical and social responsibility issues related to decision and policy modelling How this course is taught This course is optimised for on campus learning and you are encouraged to participate in the learning activities synchronously. The course can also be completed online if required. Lectures will be delivered on campus. Lecture recordings will be available. There will be on campus and online tutorial/workshop options. Tutorials/workshops provide hands-on support and guidance to facilitate use of the modelling skills ands software tools used in the class. It is strongly recommended that students less familiar or confident in the use of the tools attend these workshops in person. Lecture recording release setting: Universal access - recordings fully available for the trimester. Lecture recordings are intended as a useful supplement to learning but not as a full substitute for lecture attendance. Assessment Data Presentation and Forecasting case Type: Individual Mark: 40% Decision Analysis and Risk Management case Mark: 25% Simulation case Mark: 15% Critical Essay Mark: 20%
School of Information Technology and Electrical Engineering Semester 2, 2022 CSSE2010/CSSE7201 Assignment 2 Due: 4:00pm (AEST) Friday October 28, 2022 Weighting: 20% (100 marks) Objective As part of the assessment for this course, you are required to undertake an assignment which will test you against some of the more practical learning objectives of the course. The assignment will enable you to demonstrate your understanding of • C programming • C programming for the AVR • The Microchip Studio environment. You are required to modify a program in order to implement additional features. The program is a basic template of the board game ‘Snakes and Ladders’ (a description is given on page 3). For IN students: the AVR ATmega324A microcontroller runs the program and receives input from a number of sources and outputs a display to an LED matrix, with additional information being output to a serial terminal and – to be implemented as part of this assignment – a seven segment display and other devices. For EX students: the AVR ATmega328P microcontroller runs the program and receives input from a number of sources and outputs a display to a serial terminal and – to be implemented as part of this assignment – a seven segment display and other devices. The version of Snakes and Ladders provided to you has very basic functionality – it will present a start screen upon launch, respond to button presses or a terminal input ‘s’ to start the game, then display the board for the game Snakes and Ladders with a player cursor that flashes on and off along with the starting square, end square and the snakes and ladders. You can add features such as moving the player, the snake and ladder functionality, dice rolling, timing, pausing, sound effects, etc. The different features have different levels of difficulty and will be worth different numbers of marks. Note that marks are awarded based on demonstrated functionality only. Don’t Panic! You have been provided with approximately 2000 lines of code to start with – many of which are comments. Whilst this code may seem confusing, you don’t need to understand all of it. The code provided does a lot of the hard work for you, e.g., interacting with the serial port and the LED display/serial terminal. To start with, you should read the header (.h) files provided along with game.c and project.c. You may need to look at the AVR C Library documentation to understand some of the functions used. Intro/getting started videos are available on blackboard, along with a video demonstrating some of the expected functionality to be implemented. Grading Note As described in the course profile, if you do not score at least 10% on this assignment (before any late penalty) then your course grade will be capped at a 3 (i.e. you will fail the course). If you do not obtain at least 50% on this assignment (before any late penalty), then your course grade will be capped at a 5. Your assignment mark (after any late penalty) will count 20% towards your final course grade. Program Description The program you will be provided with has several C files which contain groups of related functions. The files provided are described below. The corresponding .h files (except for project.c) list the functions that are intended to be accessible from other files. You may modify any of the provided files. You must submit ALL files used to build your project, even if you have not modified some provided files. Many files make assumptions about which AVR ports are used to connect to various IO devices. You are encouraged not to change these. • project.c – this is the main file that contains the event loop and examples of how time-based events are implemented. You should read and understand this file. • game.h/game.c – this file contains the implementation of the board used to store the state of the game and the position of the player cursor. You should read this file and understand what representation is used for the board state and the cursor position. You will need to modify this file to add required functionality. • display.h/display.c – this file contains the implementation for displaying the current state of the board. This file contains useful functions for displaying the board to the LED matrix (internal students) or the terminal display (external students). This file contains the same functions for IN and EX students but with significantly different implementations. • buttons.h/buttons.c – this contains the code which deals with the push buttons. It sets up pin change interrupts on those pins and records rising edges (buttons being pushed). For EX students this code also handles button debouncing. • ledmatrix.h/ledmatrix.c (IN students only) – this contains functions which give easier access to the services provided by the LED matrix. It makes use of the SPI routines implemented in spi.c • pixel_colour.h (IN students only) – this file contains definitions of some useful colours. Colours are defined in terminalio.h for EX students. • serialio.h/serialio.c – this file is responsible for handling serial input and output using interrupts. It also maps the C standard IO routines (e.g. printf() and fgetc()) to use the serial interface so you are able to use printf() etc for debugging purposes if you wish. You should not need to look in this file, but you may be interested in how it works and the buffer sizes used for input and output (and what happens when the buffers fill up). • spi.h/spi.c (IN Students only) – this file encapsulates all SPI communication. Note that by default, all SPI communication uses busy waiting (i.e. polling) – the “send” routine returns only when the data is sent. If you need the CPU cycles for other activities, you may wish to consider converting this to interrupt based IO, similar to the way that serial IO is handled. • terminalio.h/terminalio.c – this encapsulates the sending of various escape sequences which enable some control over terminal appearance and text placement – you can call these functions (declared in terminalio.h) instead of remembering various escape sequences. Additional information about terminal IO will be provided on the course Blackboard site. • timer0.h/timer0.c – sets up a timer that is used to generate an interrupt every millisecond and update a global time value that is used to time various game events. Snakes and Ladders Description This assignment involves creating a replica of the board game ‘Snakes and Ladders’. Snakes and Ladders is a turn-based game played on a board between two or more players, however the template provided initially supports only one player. Each player takes their turn by rolling a (6-sided) dice to determine how many spaces to move their token forward. The board in the supplied base code features various snakes and ladders, which can either move a player closer to or further away from the end of the map. The winner is the first player to reach the final square. The board is arranged as below in an 8 column by 16 row layout (displayed on the LED matrix (IN) or serial terminal (EX)). Player’s move across each row, alternating direction each row. Players start at the square (0, 0) and begin by moving towards the right. Figure 1: Left: direction the player moves across each row of the board. Right: Example layout with snake and ladder game elements included and labelled (different to the provided layout). In addition to rolling a dice to progress across the board, players may move to different positions on the board by landing on the start of a snake or ladder. If the player moves on to the bottom position of a ladder, then the player is automatically moved to the top of the ladder, moving them closer to the end tile. Snakes work the same way, however move the player from the top of the snake to the bottom, moving them away further from the final square. Snakes and ladders are represented by coloured squares on the board, with snakes indicated in red and ladders indicated in green. A brief overview of the behaviour of the snakes and ladders is shown in Figures 2 and 3. Figure 2: A player that lands at the bottom square of a ladder is moved to the top of the ladder. If the player moves to position (4,2), then the ladder moves the player to position (4, 5). Figure 3: A player that lands at the top square of a snake is moved to the bottom of the snake. If the player moves to position (6,4), then the snake moves the player to position (3,1). The snakes and ladders can be vertical, as shown for the ladder in Figure 2, or in other configurations, such as diagonal, as shown for the snake in Figure 3. The middle sections of snakes and ladders are allowed to cross (as in the layout of the supplied board), however a tile can only contain one start or end of a snake or ladder. Due to the limited colour options for the game displays, the start and locations of snakes and ladders are not differentiated, and therefore the start and tiles are visually identified by comparing the y coordinates. Initial Operation The provided program has very limited functionality. It will display a start screen which detects the rising edge on the push buttons B0, B1, B2 and B3, and also the input terminal character ‘s’. Pressing of any of these will start a game with the start configuration and a flashing cursor. Once started, the program detects a rising edge on the button B0, but no action is taken on this input. Wiring Advice When completing this assignment, you will need to make additional connections to the ATmega324A/ATmega328P. To do this, you will need to choose which pins to make these connections to. For IN students, there are multiple ways to do this, so the exact wiring configuration will be left up to you, and you should communicate this using your submitted feature summary form. Hint: consider what peripherals each feature requires and any pin limitations this imposes. Due to the reduced number of external pins available with the Arduino Uno for EX students, all pins must be used to add all features and working out a valid configuration can be quite tricky. As a result, a configuration is provided below which you are encouraged to use to ensure everything fits. Note that pins D1 and D0 are the UART pins, which are being used to communicate to the serial terminal and no connections should be made to them (the Arduino board has inbuilt connections). Recommended EX wiring IN wiring Program Features Marks will be awarded for features as described below. Part marks will be awarded if part of the specified functionality is demonstrated. Marks are awarded only on demonstrated functionality in the final submission – no marks are awarded for attempting to implement the functionality, no matter how much effort has gone into it, unless the feature can be demonstrated. You may implement higher-level features without implementing all lower level features if you like (subject to prerequisite requirements). The number of marks is not an indication of difficulty. It is much easier to earn the first 50% of marks than the second 50%. You may modify any of the code provided and use any of the code from learning lab sessions and/or posted on the course Blackboard site. For some of the easier features, the description below tells you which code to modify or there may be comments in the code to guide you. NOTE: there is a pass hurdle of 10% for this assignment which can be achieved by completing the first two tasks (Start Screen and Move Player with Buttons). Minimum Performance (Level 0 – Pass/Fail) Your program must have at least the features present in the code supplied to you, i.e. it must build and run, show the start screen, and display the initial board when a button or ‘s’ is pressed. No marks can be earned for other features unless this requirement is met, i.e. your assignment 2 mark will be zero. Start Screen (Level 1 – 4 marks) Modify the program so that when it starts (i.e. the AVR microcontroller is reset) it outputs your name and student number to the serial terminal (for both IN and EX students). Do this by modifying the function start_screen() in file project.c. Move Player with Buttons (Level 1 – 8 marks) The provided program does not allow for the player token to be moved. Modify the program so that button B0 (connected to pin B0 for IN students, connected to pin C0 for EX students) moves the player one space forward and button B1 moves the cursor two spaces forward (useful to move past snakes/ladders in future tasks). Note that you will have to handle the direction of movement changing when the player reaches the end of the current row. The player should additionally not be allowed to move past the end tile shown in Figure 1. Note: for IN students, the axis of the game board are different to the labelled axis on the LED matrix. As shown in Figure 1, the x axis is the horizontal axis, the y axis is the vertical axis. In the play_game()function in the file project.c, when button B0 is pressed, the function move_player_by(n) in the file game.c is called. This function is currently empty, start by filling in the move_player_by function, there are some hints to get you started and assist you with considering the changing movement direction. Then update play_game()to detect B1 and move the player accordingly. Move Player with Terminal Input (Level 1 – 8 marks) The provided program does not register any terminal inputs once the game has started. Modify the program such that pressing ‘w’/‘W’ moves the current player up one space, ‘s’/‘S’ moves the player down, ‘a’/‘A’ moves the player left and ‘d’/‘D’ moves the player right. Both the lower case and upper case of each letter must move the cursor. This functionality will be useful when testing other elements of the game. Instead of moving the player according to the normal rules, the player can be moved to arbitrary positions with the ‘wasd’/‘WASD’ keys. In addition, the player must wrap around the display i.e. if the ‘s’/‘S’ key is pressed in row 0 the player should be moved to the top row (row 15). On the start screen, the game can be started by pressing ‘s’ or ‘S’, looking at the function start_screen() should give you an idea of how to read serial input from the terminal. A function move_player(dx,dy) has already been defined with some hints to implement. Note that if you press the directional arrows, they might also move your cursor in an unexpected direction, this is because they use escape characters that contain ‘A’ and ‘D’. We will not be considering escape characters when testing and will only use the letters of the alphabet, digits and spacebar as potential inputs. Flashing Player Icon (Level 1 – 5 marks) The supplied program contains code to flash the player pixel on and off every 500 ms to make the player icon more visible and when/if two player game is implemented, also help to distinguish the current player. Modify the program so that moving the player restarts the flashing cycle i.e. the player should not flash until 500 ms after the cursor has been moved. Some code for this timing and flashing is provided in project.c. Dice Rolling (Level 1 – 11 marks) In addition to manually moving the player with the buttons, implement a ‘dice rolling’ mechanism to move the player a ‘random’ number (between 1 and 6 to simulate a 6-sided die) of spaces forward. One way to simulate a ‘random’ dice roll is to use a timer/counter setup to increment at a fast interval. The number of spaces to move is decided by the timer counter value when the dice rolling is stopped. You can also see the AVR C library reference for random number generation. Note: the dice value must be a value between 1 and 6 (inclusive). The dice roll begins by pressing Button B2 or the ‘r’/‘R’ key and is stopped when Button B2 or the ‘r’/‘R’ key is pressed again. Display the current state of the dice (whether it is currently rolling or not) on the terminal and, if the dice is rolling, also turn on an LED. The dice value should change between 10-20 times per second to give the appearance of randomness (this will be shown visually in the next task). If the dice has previously been rolled and is not currently rolling, the last rolled value should be shown on the display. If the dice has not yet been rolled, display ‘0’. Also see the demo video for a preview of what this functionality should look like. Seven Segment Display (Level 1 – 8 marks) Output the current dice roll value and number of turns the game has lasted on the seven segment display. The number of turns (starting at 0 and incremented every time a move is made) should be shown on the left digit of the display. When the number of turns exceeds 9, this display should wrap around (i.e. the ‘ones place’ of the number of turns should be displayed at all times). Note the number of turns should only be incremented when the player is moved by the buttons or dice roll – the turn count should not increase when moving the player with the terminal input. The dice roll should be shown on the right digit with the following rules: if the dice is currently being rolled, the current value should be shown on the seven segment display. If the dice has been previously rolled but is not currently rolling, the value of the last dice roll should be shown. If the dice has not yet been rolled, display ‘0’. Snake and Ladder Functionality (Level 1 – 7 marks) Implement the Snake and Ladder functionality, i.e. when a player lands at the top of a snake or the bottom of a ladder, the player should move to the opposite end of the snake/ladder. This will involve reading through game.c functions and comments to see how the snakes and ladders are implemented. The positions of the snakes and ladders are provided in the base code – this task involves detecting these objects and moving the player accordingly. Briefly, each object on the game board is represented by an 8-bit integer, with the object type stored in the upper 4 bits and the identifier number (if applicable) is stored in the lower 4 bits. A snake or ladder is represented by a SNAKE_START/LADDER_START object with the same identifier number as a SNAKE_END/LADDER_END object. Therefore, if the player moves to a SNAKE_START/LADDER_START object, you can extract the identifier and search the board for the corresponding SNAKE_END/LADDER_END object. The included get_object_type() and get_object_identifier() functions will be useful here. Game Over (Level 1 – 7 marks) Add functionality to detect if a player has won the game i.e. has reached the final square of the board (The player should stop at the final square even if the number of moves would move the player past the final square). If a win is detected then a message should be shown on the terminal indicating which player has won the game. A new game should be able to be started after the game has ended (by pressing any button or using the ‘s’/‘S’ key). Some of this code has already been provided for you in project.c/game.c. Two Player Game (Level 2 – 8 marks) Add support for a two player game, selectable by pressing ‘2’ before the game begins (a one player game should be able to be selected by pressing ‘1’ and should be the default). In a two player game, the current player will switch after a move is made (either by the fixed-space movement buttons, moving the player with the terminal/keyboard inputs or with a dice roll). Player 2 should be displayed using a different colour to distinguish from player 1. Several (unused) colours have been provided in pixel_colour.h (IN) /terminalio.h (EX) or you can additionally define your own colours. Custom Game Board (Level 2 – 7 marks) Modify the program to support multiple different game boards. Before starting a new game, toggle between the original and custom game boards by pressing the ‘b’/‘B’ key. A message should be shown on the terminal indicating which map has been selected (even if the board has not been toggled i.e. always show the current board number to be used). The map selection should be able to be updated at game over as well (if game over has been implemented). The custom map should be of similar complexity to the original map (i.e. it should contain at least as many snakes/ladders as the original and should not be a trivial design). Game Timing (Level 2 – 6 marks) Add the ability to toggle between different difficulties with different times for players to make moves. There are 3 difficulties – easy, medium and hard. • Easy difficulty has no time limit and is the default game behaviour. • Medium difficulty has a time limit of 90 seconds per player. • Hard difficulty has a time limit of 45 seconds per player. When playing one of the timed difficulties, each player has a fixed amount of time to win the game. If either player runs out of time then they forfeit the game and the other player is declared the winner. During a timed game, the time remaining should be displayed for the current player on the terminal. The remaining time must count down and should show the remaining time in seconds for each player when the remaining times is 10+ seconds. When the remaining time is less than 10 seconds, the remaining seconds and tenths of seconds should be shown. The game difficulty may be changed at any point by pressing: • ‘e’/’E’ – select easy difficulty • ‘m’/’M’ – select medium difficulty • ‘h’/’H’ – select hard difficulty When the difficulty is changed the timer is reset to the original time i.e. you do not have to remember the remaining time when switching difficulties. Game Pause (Level 2 – 6 marks) Modify the program so that if the button B3 or ‘p’/‘P’ key on the serial terminal is pressed then the game will pause. When ‘p’ or ‘P’ key on the serial terminal is pressed again, the game recommences. (All other button/key presses/inputs should be discarded whilst the game is paused – i.e. the player cannot be moved.) The player cursor flashing must be unaffected – e.g. if the pause happens 200ms before the player cursor is going to flash off, then the player cursor should not flash off until 200ms after the game is resumed, not immediately upon resume. Other functionality such as the seven segment display should be unaffected i.e. both digits of the seven segment display should still be shown (without ghosting etc.) if implemented. Visual Effects (Level 3 – 5 marks) (This assumes that you have implemented “Snake and Ladder Functionality” above.) Implement visual animations on the display when certain game events occur. These animations must involve multiple pixels and must not only change the colour of game elements (i.e. there must be a timing element to the effects). Implement visual animations for the following events: • When the player lands on a snake or ladder, show the player moving up/down the ladder/snake. • When the player moves, show the individual spaces being moved. • When the game is won. If the game is paused during an animation, the animation should pause instantly and resume when the game is unpaused. Sound Effects (Level 3 – 5 marks) Add sound effects to the program which are to be output using the piezo buzzer. Different sound effects (tones or combinations or tones) should be implemented for at least three events. (At least one of these must be sequences of tones for full marks.) For example, choose three of: • Player being moved • Player landing on a snake • Player landing on a ladder • Game start-up • Game over • Constant background tune Do not make the tones too annoying! Pressing the ‘q’ or ‘Q’ key on the serial terminal must be used to toggle sound on and off, sound should be on when the game starts. You must specify which AVR pin the piezo buzzer must be connected to. (The piezo buzzer will be connected from there to ground.) Your feature summary form. MUST indicate which events have different sound effects. Sounds must be tones (not clicks) in the range 20Hz to 5kHz. Sound effects must not interfere with game play, e.g. the speed of play should be the same whether sound effects are on or off. Joystick (Level 3 – 5 marks) Add support to use the joystick to move the player left, right, up and down. This must include support for auto-repeat – if the joystick is held in one position then, after a short delay, the code should act as if the joystick was repeatedly moved in that direction. If a player is moved onto a snake or ladder with the joystick, the turn should switch immediately after the player moves up/down the snake or ladder. You may also wish to include a small delay after the player changes before the joystick moves the player again. If multiple axis of the joystick are activated the cursor should move diagonally. Your movement must be reasonable – i.e. a reasonable player could stop at whichever space they desired. Your cursor must be shown to move through all positions and be able to be stopped at that position if the joystick is released. Be sure to specify which AVR pins the U/D and L/R outputs on the joystick are connected to. Be aware that different joysticks may have different min/max/resting output voltages and you should allow for this in your implementation – your code will be marked with a different joystick to the one you test with. For external students, this will be marked more leniently as your joystick likely differs more substantially. Scrolling Map Display (Level 3 – 5 marks) Extend the size of the game board beyond the inital 8×16 display to 8×24. This will involve extending the original map and any custom map you have implemented. Since the larger map exceeds the size of the display, the display will need to scroll to always keep the current player visible (though it may be possible for the other player, if implemented, to be outside of the display). The display should scroll smoothly, i.e. the scroll should occur one row at a time. Assessment of Implementation of Features The program improvements will be worth the number of marks shown above. You will be awarded marks for each feature up to the maximum mark for that feature. Part marks will be awarded for a feature if only some part of the feature has been implemented or if there are bugs/problems with your implementation (which may include issues such as incorrect data direction registers). Your additions to the game must not negatively impact the playability or visual appearance of the game. Note also that the features you implement must appropriately work together, for example, if you implement game pausing then sound effects should pause. Features are shown grouped in their levels of approximate difficulty (level 1, level 2, and level 3). Note that maximum marks for level 3 features are capped at 15, as indicated in the feature summary forms at the end of this document. Submission Details The due date for the assignment is 4:00pm Friday 28 October 2022. The assignment must be submitted via Blackboard. You must electronically submit a single .zip file containing ONLY the following: • All of the C source files (.c and .h) necessary to build the project (including any that were provided to you – even if you haven’t changed them); • Your final .hex file (suitable for downloading to the ATmega324A/ATmega328P AVR microcontroller program memory, see the getting started videos to locate the hex file); and • A PDF feature summary form. (see below). Do not submit .rar or other archive formats – the single file you submit must be a zip format file. All files must be at the top level within the zip file – do not use folders/directories or other zip/rar files inside the zip file. If only the .hex file is submitted with no source files then your submission will not be marked. The .hex file will be used if the marker is unable to compile/build the submitted source files. If you make more than one submission, each submission must be complete – the single zip file must contain the feature summary form, the hex file and all source files needed to build your work. We will only mark your last submission and we will consider your submission time (for late penalty purposes) to be the time of submission of your last submission. It is the responsibility of the student to ensure that their submission is correctly uploaded to the Blackboard submission portal with all of the files they intend to submit. This can be ensured by downloading your zip file after submission is made, un-zipping the submission to check all files are correctly included and checking whether you are able to compile the project successfully. The feature summary forms are on the last pages of this document, there is a separate feature summary form. for IN and EX students. A separate electronically-fillable PDF form. will be provided on Blackboard. This form. can be used to specify which features you have implemented and how to connect the ATmega324A/ATmega328P to peripherals so that your work can be marked. If you have not specified that you have implemented a particular feature, we will not test for it. Failure to submit the feature summary with your files may mean some of your features are missed during marking (and we will NOT remark your submission). You can electronically complete this form. or you can print, complete and scan the form. Whichever method you choose, you must submit a PDF file with your other files. If you have any assumptions or comments to convey to the marker, include these on the feature summary form. Incomplete or Invalid Code If your submission is missing files (i.e. won’t compile and/or link due to missing files) then we will substitute the original files as provided to you. No penalty will apply for this, but obviously no changes you made to missing files will be considered in marking. If your submission does not compile and/or link in Microchip Studio version 7 for other reasons, then the marker will make reasonable attempts to get your code to compile and link by fixing a small number of simple syntax errors and/or commenting out code which does not compile. A penalty of between 10% and 50% of your mark will apply depending on the number of corrections required. If it is not possible for the marker to get your submission to compile and/or link by these methods then you will receive 0 for the assignment (and will have to resubmit if you wish to have a chance of passing the course). A minimum 10% penalty will apply, even if only one character needs to be fixed. Compilation Warnings If there are compilation warnings when building your code (in Microchip Studio, with default compiler warning options) then a mark deduction will apply – 1 mark penalty per warning up to a maximum of 10 marks. To check for warnings, rebuild ALL of your source code (choose “Rebuild Solution” from the “Build” menu in Microchip Studio) and check for warnings in the “Error List” tab. General Deductions If there are problems in your submitted assignment that do not fit into any of the above feature categories, then some marks may be deducted for these problems. This could include problems such as general lag, errors introduced to the original program etc. Late Submissions As per the ECP, late submissions (i.e. submitted after 4:00pm AEST Friday 28 October 2022) will result in a penalty. A late penalty of 10% of the maximum possible mark for the assessment item will be deducted per calendar day (or part thereof), up to a maximum of seven (7) days. After seven days, no marks will be awarded for the item. A day is considered to be a 24-hour block from the assessment item due time. Negative marks will not be awarded. Requests for extensions should be made via the process described in the course profile (before the due date) and be accompanied by documentary evidence of extenuating circumstances (e.g. medical certificate or personal statement). The application of any late penalty will be based on your latest submission time. Notification of Results Students will be notified of their results via Blackboard’s “My Grades”.
18-698 / 42-632 Neural Signal Processing Spring 2025 Problem Set 1 This problem set is due on Thursday, February 13, 11:59pm. Please show your work by writing down each step to get from the problem to your answer. If you have questions, please post them on the Piazza Q&A webpage, rather than emailing the course staff. This will allow other students with the same question to see the response and any ensuing discussion. Please submit your work as a single PDF file on Gradescope, which is linked from Canvas. When preparing your solutions, please complete each problem on a separate page. Grade-scope will ask you select the pages that contain the solution to each problem. Submissions can be written in LaTeX or they can be handwritten and photocopied using a scanner or smartphone camera. Handwritten work should be clearly labeled and legible. 1. A neuron spikes according to a homogeneous Poisson process at 10 spikes per sec-ond. The recording equipment is broken and drops each spike independently with 50% probability. (a) (5 points) What is the expected time until the second spike is recorded? (b) (10 points) What is the probability that the second recorded spike occurs after one second? 2. You insert an electrode into the brain. Unbeknownst to you, the electrode sits next to two neurons. Each neuron spikes independently according to a homogeneous Poisson process with rate λ1 and λ2, respectively. (a) (5 points) What is the probability that no spikes are observed during the first t seconds? (b) (5 points) Given that no spikes are observed in the first s seconds, what is the probability that no spikes are observed in the first s + t seconds? (c) (10 points) What is the probability that the first spike observed came from neuron 1? (d) (10 points) What is the probability that 2 of the first 3 spikes came from neuron 1? (e) (5 points) At some point during your experiment, the recording equipment breaks down and begins dropping spikes randomly with probability p. What is the probability that the first spike observed (after breakdown) came from neuron 1? 3. Neurons 1 and 2 each spike according to a homogeneous Poisson process with rate λ1 and λ2, respectively. (a) (20 points) What is the expected time of the first spike of neuron 2, given that neuron 1 spikes before neuron 2? (b) (15 points) What is the probability that neuron 1 spikes m times before neuron 2 spikes n times? (Hint: your final answer can have a summation in it.) 4. (15 points) A neuron spikes according to a homogeneous Poisson process with rate λ. The duration of the nth ISI is tn (n = 1, ..., N). Estimate the neuron’s firing rate by finding the λ that maximizes (Hint: Work with log probabilities. Your final answer can have a summation in it.)
Problem 1 Find a Karush-Kuhn-Tucker point of the following quadratic programming problem: Problem 2 Consider the design of a storage vessel that has the form. of a cylinder. The required volume is 25 m3. The cost of the side of the cylinder is $150/m2, while the top and bottom cost $190/m2 and 260/m2 respectively. Formulate a nonlinear programming problem to determine the optimal dimensions of this vessel, and solve with GAMS/Pyomo using a number of NLP solvers that you can identify (e.g. MINOS, CONOPT, KNITRO and IPOPT if you use GAMS). Do you get the same solution by changing the starting points and using different solvers? Please submit your source code file as well. Problem 3 Consider the nonlinear programming problem: Assuming that f(x) and h(x) are continuous and differentiable in the n-dimensional vector x, derive the Karush-Kuhn-Tucker conditions for the above problem. Problem 4 Suppose you are given the steady-state model of a process that is represented by the system of nonlinear equations, h(x) = 0, where dim(h) = dim(x). If you have an NLP algorithm available for solving this problem, how would you formulate the NLP to find the solution for the system of equations? Problem 6 Consider the following nonlinear optimization problem. a) Please plot the feasible region and objective function, and then determine the optimal solution graphically. b) Write down the Karush-Kuhn-Tucker (KKT) conditions of the above problem, and check if the optimal solution satisfies the KKT conditions. c) Solve this problem using at least two NLP solvers (e.g. CONOPT, MINOS, SNOPT, IPOPT, etc.) and compare the resulting solutions. d) What conclusion can you draw from this example on solving NLP problems using standard NLP algorithms? Problem 7 Consider the following nonlinear programming problem. a) What are the optimality conditions that any optimal solution of this problem must satisfy? b) Does the solution point at x1 = 2, x2 = 1 satisfy the optimality condition? Why or why not? c) Does the solution point at x1 = 1, x2 = 2 satisfy the optimality condition? Why or why not?
1. Suppose an investor has preferences represented by the utility function w1−γ u(w) = . 1 − γ and has wealth w0. In the market there are two assets: a risky asset whose return can be either low, r1, or high, r2, with probabilities π and 1 − π; a risk-free asset with return rf . Suppose r1 < rf < r2. a) derive the demand for the risky asset (checking for interior and for corner solutions, if any); b) Discuss how the demand changes with a change in welfare; c) Discuss how the demand changes with a change in rf . 2. Consider an economy with one risk-free asset whose net return is rf = 0.05 and one risky asset whose return is either r1 = 0.01 with probability π or r2 = 0.10 with probability 1 − π. a) For which values of π does a risk neutral investor invest in the risky asset? How much would they invest? b) For which values of π does a risk averse investor invest in the risky asset? How much would they invest? c) Suppose an investor has preferences represented by the natural logarithm utility function, u(c) = log(c), and initial wealth equal to 10. Which share of his wealth does he invest in the risky asset? Suppose his wealth is 100. Which share of his wealth does he invest in the risky asset? Explain. 3. Consider an economy with a risk-free asset whose net return is rf , and one risky asset whose net return, r, is normally distributed, with mean E(r) and variance σ2. An investor has preferences represented by the following utility function: u(w) = − 1 γ e−γw. The investor makes investment decisions in period 0 and only consumes in period 1. a) Does this investor have decreasing, constant or increasing absolute risk aversion? decreasing, constant or increasing relative risk aversion? b) Explain why this investor’s demand of the risky asset is equal to that of an investor with mean-variance utility u(w) = E(w) − γ V ar(w). c) The net return of the risky asset in this economy can be written as r = x−p , where x is the payoff paid by the asset (e.g., the dividend) in period 1 and p is the price paid in period 0. Assume there is a fixed supply a¯ of the asset. Derive the equilibrium price of the risky asset, p, as a function of the expected payoff, the risk-free return, the coefficient of risk aversion and the variance of the risky return. d) Using the result obtained in c, explain the effect of a reduction in the risk free rate on the price of the risky asset. (Note that this is equivalent to the effect of a central bank’s decision to lower interest rates on the stock market index.) 4. Consider two securities with net rates of return ri and rj. Suppose that these two securities have identical expected rates of return and identical variance. The correlation coefficient between ri and rj is ρ. Find the weighted portfolio that achieves the minimum variance. How do the weights depend on ρ? 5. Consider a two-period economy in which investors have pref- erences represented by: ln(ct) + βE[ln(ct+1)]. The subjective discount factor is β = 0.9. The supply of the risky asset is a¯ = 1. Households have an endowment et = 10 at time t; at time t +1 their endowment et+1 is equal to 6 with probability 2/3 and 9 with probability 1/3. In the economy there is an asset paying a payoff, xt+1, equal to 0 with probability 1/3 or to 6 with probability 2/3. Specifically, xt+1 and et+1 have the following joint distribution: xt+1 = 0 xt+1 = 6 et+1 = 6 1/3 1/3 2/3 et+1 = 9 0 1/3 1/3 1/3 2/3 1 a) Compute the price of this asset; b) Suppose the subjective discount factor were β = 0.8 instead of β = 0.9; would the price be lower or higher than that computed for question “a”? c) Consider another asset with the same payoffs, 0 and 6, but with the following joint distribution: xt+1 = 0 xt+1 = 6 et+1 = 6 1/2 0 1/2 et+1 = 9 0 1/2 1/2 1/2 1/2 1 Find the price of this asset and explain why it is higher or lower than (or equal to) the price you computed for question “a”. d) What is the expected return of the first asset? What is the risk-free grossreturn, Rf, in this economy? Explain your results.
Corporate Tax Return Project ACCTG 410 In this scenario, you will practice entering the following: Balance Sheet Income Statement Instructions This practice return will help you become more familiar with corporate return preparation. Use the scenario information and the attached source documents to complete the 2023 Federal Form. 1120 and any schedules necessary. Forms may be obtained at www.irs.gov. For any information not provided, please use reasonable assumptions. Attached Source Documents Balance Sheet Income Statement ADDITIONAL INFORMATION The company provided the following additional information: The company took a physical count of its inventory on the last day of the year. On that date, it was determined that ending inventory was $360,000. This is not reflected in the financial statements below. Dividends received were from stock investment in less than 20% owned U.S. corporations. The corporation’s estimated bad debt expense for the year was $5,000. Actual bad debts were $1,000. Tax depreciation for the year was $50,000 Meals and Entertainment include the corporation’s expenses for a suite at Harrisburg River Front Stadium, home of professional baseball Harrisburg Senators. The cost of the suite was $10,000, which includes event tickets for $4,000. Life Insurance Premiums were paid on term policies covering the lives of two owners. The corporation is the beneficiary. Each of the four $37,500 timely made estimated tax payments were recorded as Federal Income Taxes Paid. The corporation distributed a cash dividend of $60,000 during the year. FINANCIAL STATEMENTS A tentative Balance Sheet and Income Statement for the corporation are given below.
520.624 Integrated Photonics Group-velocity dispersion calculations Homework #4 due 3/29/18 at 11:59 PM This assignment is based mostly on utilizing the finite-difference mode-solver that we are using in class. (You can download this from Professor Thomas Murphy’s website http://www.photonics.umd.edu/software/wgmodes/) You will need to alter the code to incorporate group- velocity dispersion simulations. The code basic_fullvector.m that we are using in class is altered from what is available on his website, so you should save this code for your use. Model the total group-velocity dispersion (GVD) of a waveguide for one mode (either the fundamental TE, or the fundamental TM). Total GVD incorporates BOTH material AND waveguiding dispersion and can be implemented by solving the waveguide mode over a wavelength range (maybe 100 different wavelength values) while using a Sellmeier or Cauchy fit to the material dispersion (you will need to find these expressions for the materials you choose) to represent the refractive indices of all materials involved at each wavelength. After determining the effective refractive index for the particular mode of interest for each wavelength over the range, you must take a numerical second derivative. See reference 1 for guidance. You will show that you can calculate the D-parameter of the GVD by iteratively solving the mode at different wavelengths. You should do this for two different waveguide geometries so you can compare how changing the geometry moves the zero-GVD point. You will need use some sort of loop (ex: for loop) in the code and include the working code in the assignment, and as a .m file in blackboard so I can try running it as well. The submitted work should include: a. A diagram with your waveguide geometry and materials as well as a description of the two sizes that you have simulated. Make sure your simulation domain is defined properly so you have reached convergence! b. Aplot of the 1) effective index of the fundamental mode, 2) the group index, and 3) the D-parameter of the GVD as a function of wavelength for the respective waveguides (these should be on the same plot for comparison). c. A quick explanation of your results. It doesn’t have to be extremely formal, it just has to stand on its own so that I can understand what you designed and why. d. The code that you created as a .m file submitted to blackboard (Note that you can choose silicon as your waveguiding material, or some other material if it is silicon- based): References: [1] Turner, A.C., Manolatou, C., Schmidt, B.S., Lipson, M., Foster, M.A., Sharping, J.E. and Gaeta, A.L., “Tailored anomalous group-velocity dispersion in silicon channel waveguides,” Optics Express, Vol. 14, No. 10, p. 4357-4362 ,15 May 2006.
Similar to Assignment 1, this assignment also gives you an opportunity to leverage on the existing knowledge in the financial performance research and your newly acquired skill in machine learning. The emphases in this assignment are your critical analysis skill to evaluate and provide insightful critics on data, and data analytics estimators of both the conventional statistical approaches and the machine learning algorithms. We are not expecting you to be an avid computer programmer to create an AI. We want you to leverage on the AI to teach an AI. Yes! You can leverage on ChatGPT to assist you with Python code for the data analysis. Be mindful that, ChatGPT or other generative AI are tools to get things done. They can hallucinate and give false responses. You are still responsible for the accuracy and the final writing. Bankruptcy prediction 1. § Bankruptcy prediction using machine learning. Data source: Company Bankruptcy Prediction | KaggleLinks to an external site. Sentiment analysis 1. § Sentiment analysis on product/service review. Data source: British Airways Passenger Reviews (2016 - 2023) | KaggleLinks to an external site. Sustainability and profitability · · Emission and profitability. Data source: 10-year ASX data: emission data asx all.xlsx 1. Once you have decided on a project, download the appropriate dataset from their respective repositories. Also, take a look at this recording to get some ideas on how to approach this assignment. This is a high level overview. 2. Go to Science Direct collection at ECU Library. You will need your ECU access credential to log into the database. Here is the link to the repository. 3. Search for research articles related to your project. You will use some of them as a foundation for your own analysis. Use the following questions to guide your endeavour. These questions will assist you to make your analysis relevant. 1. 1. What are the findings? 2. Where applicable, what are the variables, including the control variables, they use and why? 3. What are the limitations of these existing studies? 4. How would your analysis extend the existing research? 4. Using appropriate machine learning algorithms and conventional statistical methods, write a report on the followings. 1. 1. The estimators you use in the data analytics. This is the core of your discussion. 1. Which estimators you use for the analysis? E.g., neural network, logistic regression, k-nearest neighbour. 2. Explain why you choose them. What are their strengths and limitations? 3. How well each estimator performs such as their accuracy? 4. Discuss any limitations in the data, how these affect the estimators' performance, and how you address them. 2. Extract inisghts from the data. Discuss the implications of your findings within a business decision context. Position yourself as an advisor for a group of investors. See the examples below. 1. Bankruptcy prediction: Which metrics (financial ratios) are important and why they are relevant to your client's investment decision. 2. Sentiment analysis: How strong the correlation between the sentiment and the variables of interest? What would be your advice for your clients? 5. Write a 2000-word report on your analysis. The professional report is to be presented to an intelligent, non-specialist audience. You can use these headings to structure your report. 1. Introduction. 2. Methodology. 3. Results, insights, discussion, and recommendation. 4. Limitations and conclusion. 5. References. Your report is intended for managerial level decision makers. They don’t need standardised beta and p-values. They need actionable results. Include persuasive data visualisation where necessary
Individual Assignment 1 Question 1 a) A short e-survey is released, asking the following question: “How many cups of tea do you drink a day?”. The available answers were “0”, “1”, “2“, and “3 or more”. What type of data will the answers to the e-survey give us? i) Nominal ii) Ordinal iii) Discrete iv) Continuous b) A random variable U is defined with the probability density function below: Which of the following is the value of P(U < 0.5)? i) 0.2174 ii) 0.4375 iii) 0.7022 iv) 0.9775 Question 2 The dataset airquality in R gives information about the air quality in New York City in 1973. It is made up of six variables, but the two we will focus on are both daily measurements taken at LaGuardia Airport - the maximum daily temperature in degrees Farenheit (Temp), and the average wind speed in miles per hour at 7am and 10am (Wind). a) Create a histogram of the Temp data, and include it in your submission. State whether this histogram shows that the Temp data is skewed, and if so, whether the skew is positive or negative. b) Create a scatterplot comparing the Temp and Wind data, and include it in your submission. Comment on the relationship between the maximum temperature at LaGuardia in a day, and the average speed of the wind at 7am and 10am at LaGuardia on the same day. (What I am asking here is for you yo comment on any overall relationship between max temperature and average windspeed, that gives us some sense of how daily maximum temperature and daily average windspeed are related.) Question 3 An understanding of probability can sometimes be used to detect cases of fraud and deception. Here is a (very small and minor) example of such a process. I ask a student to help in an experiment. They are asked to perform. a task 200 times. Each task is the same - they must toss a fair coin six times, and write down the sequence of Heads (H) and Tails (T) results they get. Note that, as the coin is fair, P(H) = P(T) = 1/2 for each toss. a) In this question, we will assume the result of each coin toss will be independent of the results of all other coin tosses. Explain, in language referencing the specific situation described in this question, what it means to assume independence in this way. b) Denote by Xi the random variable which represents the number of H results for the ith task, i = 1, . . . , 200. State, giving the value of each parameter, the distribution each Xi must have. c) Find the probability that all six results for a single task are H. NOTE: You will need to show your working. d) Find the expected number of the 200 sequences which will show six H results. I am aware that the student might not actually perform. the task, and instead just write out 200 sequences of six letters each to save time. If they do this, I know that they will try to make those sequences look like they’d come from the results of a fair coin. Luckily, there is a way to test whether this may have happened. When someone cheats in this kind of experiment, they almost never write a sequence which is all H results, or all T results. It doesn’t look “random” enough for them. As the answer to 1.3d) shows, though, we expect such results happen at least occasionally. e) Let Y be the random variable which expresses the number of the 200 sequences which contain six H results, assuming the student did correctly perform. the task set. State, giving the value of each parameter, the distribution Y must have. f) Find the probability that Y = 0; that is, the probability that no sequence comprises of six heads, assuming the student correctly performed the task. NOTE: You will need to show your working. g) The student hands in their 200 sequences, and there are indeed no sequences comprising of six H results. A friend tells you that your answer to 1.3f) gives the probability the student did not cheat. State, giving an explanation, whether your friend is correct or incorrect. Question 4 Let X ~ Pois(0.7), and let Y ~ Pois(λ). Find: 1. P(X = 1). 2. P(X > 1). NOTE: You will need to show your working. 3. An algebraic expression for P(Y = 4|Y > 1) in its simplest form. NOTE: You will need to show your working.
Assignment Objectives Implement a simple IR tool that does the following: · Pre-processes text - Tokenisation - Stopword removal using this list of words (right click and save as). You MUST use this list. - Porter stemming. You can use packages for this part, such as Snowball or NLTK. · Creates a positional inverted index Your index can have whatever structure you like, and can be stored in any format you like, but you will need to output it to a text file using the format specified below. · Uses your positional inverted index to perform. - Boolean search - Phrase search - Proximity search - Ranked IR based on TFIDF Additional details · Use the collections from Lab 2 for testing your system. You can download from here. Focus on the trec collection which contains 1000 sample news articles. Note 1: use the file in XML format. You need to make your code able to parse it. It worth noting that the XML format is a standard TREC which might not be parsed directly using XML parsers. You might need to add header and footer to the file to make it parsable by existing tools. It is allowed to do so if needed (or feel free to code your own parser). Note 2: For the trec collection, please include the headline of the article to the index. Simply the document text should include the headline and text fields. For positions of terms, please start counting from the headline and continue with the text. Note 3: Term position is counted AFTER stop words removal. · The test collection to be released 4 days before the deadline. It will be of the same exact format of trec.sample.xml. The size of this collection will be around 5000 documents (5 times of the current version). If your system is running fine with the current collection, it should be straightforward to run smoothly with the new collection. · For tokenisation, you can simply split on every non-letter character, or you can have special treatment for some cases (such as - or '). Please explain in your report your selections and why you did so. · For stopping Please use the stop words list mentioned above. · Again, for stemming, you do NOT need to write your own stemmer. Use any available package for Porter stemmer. Write down in your report which one used. You need to use Porter stemmer, not anything else. · For the TFIDF search function, please use the formula from lecture 7, slide 15 with title "TFIDF term weighting". Note: this is different from other implementations of TFIDF in some toolkits, so please implement it as shown in lecture. · Please use the queries in Lab 2 and Lab 3 for testing your code. A new list of queries to be released with the collection 4 days before the deadline. These 4 days should be more than enough to run the new queries and get the results. · Notes about the expected queries: - Queries are expected to be very similar to that in the labs. - Two query files will be provided, one for Boolean search, and the other for ranked retrieval. - Boolean queries will not contain more than one "AND" or "OR" operator at a time. But a mix between phrase query and one logical "AND" or "OR" operator can be there (like query q9 in Lab 2). Also "AND" or "OR" can be mixed with NOT, e.g. Word1 AND NOT Word2. - 10 queries would be provided in a file named queries.boolean.txt in the following format: 1 term11 AND term12 2 "term21 term22" - For proximity search queries, it will have the format "#15(term1,term2)", which means find documents that have both term1 and term2, and distance between term1 and term2 is less than or equal to 15 (after stop words removal). - 10 free text queries for ranked retrieval will be provided in a file named queries.ranked.txt in the following format: 1 this is a sample query Submissions and Formats You need to submit the following 5 files: 1. index.txt: a formatted version of your positional inverted index. Each line of this file describes a token, a document it appears in, and its position within that document: term:df docID: pos1, pos2, .... docID: pos1, pos2, .... where df is the document frequency of the term. Example: newspaper:2 23: 2,15 93: 234 ....... Here, the token "newspaper" appeared in 2 documents, where it appeared in document 23 twice at positions 2 and 15, and document 93 once in position 234. Each document ID (docID) should be in a separate line that starts with a "tab" ("t" in Python). Positions of term should be separated by a comma. Lines should end with a line break (" " in Python). 2. results.boolean.txt: contains results of the queries.boolean.txt in the following query_number,document_id format: 3. 1,710 4. 1,213 2,103 This means that for query "1" you retrieved two documents - numbers "710" and "213". For query "2" you retrieved one document - "103". The two values on each line should be separated by a comma. Lines should end with a line break (" " in Python). Your boolean results file should list every matching document, per query. 5. results.ranked.txt: contains results of the queries.ranked.txt in the following query_number,document_id,score format: 6. 1,710,0.6234 7. 1,213,0.3678 2,103,0.9761 This means that for query "1" you retrieved two documents - document number "710" (with score 0.6234) and document number "213" (with score 0.3678). For query "2" you retrieved one document, number "103", with score 0.9761. Scores should be rounded to four decimal places. The three values on each line should be separated by a comma. Lines should end with a line break (" " in Python). Print results for queries in order of their score - that is, all results for query "1" are sorted by score, then results for query 2, 3, ... 10. Your ranked results file should list only up to the top 150 results per query. 8. code.py: a single file containing the code used to generate index.txt, results.boolean.txt and results.ranked.txt. If you will use something other than Python, let us know before submission! Please try to make your code as readable as possible: commented code is highly recommended. Please DO NOT submit the collection file with the code! 9. report.pdf: Your report on the work. This is 2 to 4 pages and should include: - details on the methods you used for tokenisation and stemming - details on how you implemented the inverted index - details on how you implemented the four search functions - a brief commentary on the system as a whole and what you learned from implementing it - what challenges you faced when implementing it - any ideas on how to improve and scale your implementation Your report SHOULD NOT contain any code or screenshots of code. It should be a high-level description of how your code works and the decisions you made while implementing your information retrieval system. Submit ONLY these five files! Do not submit any of the assignment files. Submission should be done over Learn Challenge (for extra marks) If you aim for extra marks in this CW and potentially achieving fullmark, you can do this challenge. Rerun the same queries for Boolean and Ranked IR, but without applying stopping this time in indexing or queries. Comment on the change you noticed in the retireved results in your report. No need to submit the results files. We just need your comment on the observed results and how they changed. Notes: · Only attempt this challenge after you implement the whole system. Main marks will be on the results above not the challenge. · You don't need to wait for test data to run this experiment, since we don't need the results files here. We only need your comment about your observed change in results in the report, which you can test on the lab data. · Please comment in the report about the changes you noticed in: 1) Retreived results, 2) Processing time for index and queries, 3) size of the index. Feel free to add any other comment on this run. · We expect only small number of students to do this challenge for extra marks. So don't feel bad if you didn't get the time to do it. Marking The assignment is worth 10% of your total course mark and will be scored out of 100 points as follows: · 50 points for the outputs of your system, including index.txt (10 points), results.boolean.txt (20 points), and results.ranked.txt (20 points) - Note: Your output does not have to exact match reference outputs, since different configurations will lead to different outputs. However, it has to still align with it, so it does not list totally non-relevant documents! · 10 points for having your code aligned with what is mentioned in the report. · 40 points for a clear and detailed report (including 20 points for those who did the challenge). · -20 point as a penalty if the format of files is not as described above. · -20 point as a penalty if your code is not submitted as a single code file. Files cw1collection.zip
Angewandte Finanzmathematik 2024: Introduction to the Black–Scholes World 1 Practicalities and background Upon passing the exam, attending and solving the exercises give a bonus to the final grade. We assume that the following concepts are familiar: 1. Probability space, random variables, expectation, convergence concepts. 2. Conditional expectations, martingales. 3. The fundamentals of discrete time financial mathematics. For a remote graphical access to Matlab, you can login to the computers ❼ math12.math.lmu.de ❼ mathw0g.math.lmu.de You will need 1. a program supporting X11-forwarding (e.g. Cygwin), 2. SSH program with rdp connections (e.g. Bitvise), 3. a VPN connection to LRZ (Anyconnect client, downloadable from LMU service portal). Alternatively, you can use the online version of Matlab. 2 Introduction 2.1 Popular financial products Throughout the course, St i denotes the market price of an asset i at time t. Example 2.1 (Put and call options). A European call option on the asset i is a contract where the seller has the obligation to deliver the asset i at the given maturity time T for a given strike price K. At time T, the buyer has the possibility to exercise the option, that is, to buy the asset from the seller at price K. The gain for the buyer is cC := (ST i − K) + := max{ST i − K, 0}, since he can get the asset from the option seller at price K and sell it immediately on the market with the market price ST i . We call cC the payoff of the call option. A European put option on the asset i is a contract where the seller has the obligation to buy the asset i at the given maturity time T for a given strike price K. At time T, the buyer has the possibility the exercise the option, that is, to sell the asset to the seller at price K. The payoff for the buyer becomes cP := (K − ST i ) + := max{K − ST i , 0}. Put and call options are prototype examples of Vanilla options that depend only on the terminal price of the underlying asset. When this is not the case, the option is called path-dependent. Example 2.2 (Asian options). An Asian call option with maturity T and strike K has the payof cAC := (S¯ T i − K) +, where S¯ T i is the ”average price” of the asset over the time interval [0, T]. The exact form. of the average price is part of the contract, e.g., it could be arithmetic mean of the prices at given time points t1, . . . , tN = T so that ¯ST i = N 1 P N k=1 St i k . For a set A, we denote ✶A(s) = 1 if s ∈ A and ✶A(s) = 0 otherwise. Example 2.3 (Down-and-out and other Barrier options). Given a strike K, ma-turity T and a barrier B > 0, the down-and-out call option has the payof The payoff of an up-and-in call option with the same strike and maturity is Barrier put options have similar payoffs. For example, down-and-in put options have payoffs of the form. Options that depend on multiple underlying assets are called rainbow options. Example 2.4 (Basket options). Given a set of assets indexed by i = 1, . . . , I and positive coefficients ai, i = 1, . . . I, the payoff of the corresponding basket call option is Similarly, the basket put option has the payof Example 2.5 (Spread options). Given two assets S1 and S2 , the payoff of the corresponding spread call option is Similarly, the spread put option has the payof Example 2.6 (Calls and puts on max and min). Given to assets S1 and S2, the payoff of the corresponding call-on-max option is Similarly, the put-on-min option has the payof Many options depend on quantities that are not tradable on markets. Example 2.7 (Options on non-tradables). Let ξT be the temperature (somewhere of interest) at time T, and consider options with the payoffs with a given strike K. Example 2.8 (American options*). The holder of an American option may choose to exercise the option at any time before the terminal time T. For exam-ple, for an American call on S i with strike K, the payoff, if the holder chooses to exercises the option at time t, is In contrast to all the above options, the holder of an American faces an opti-mization problem when to exercise the option. 2.2 Exercises In all the exercises, examples in Matlab online help pages help you to write the actual code. Exercise 2.2.1. Write Matlab functions (as .m-files) of the payoff functions in Examples 2.1–2.6. Write them as functions of the underlying asset prices and strikes. Exercise 2.2.2. Using the plot-function, plot the European call option, for a fixed strike K, as a function of the underlying asset price ST . Plot the European call option as a function of the underlying asset price ST for two different strikes in the same figure. Exercise 2.2.3. Using the mesh-function (or surf-function), draw a 3D-graph of the spread call option as a function of the underlying asset prices ST 1 and ST 2 . 2.3 Basic properties of Brownian motion Let (Ω, F,(Ft) T t=0, P) be a filtered probability space. We consider continuous time stochastic processes only on the ”time interval” [0, T]. A family S := (St)t∈[0,T] of Rd–valued random variables St is called an R d–valued continuous time stochastic process. The process is called adapted if St is Ft-measurable for each t ∈ [0, T]. Given ω ∈ Ω, the function t 7→ St(ω) is called as a path, or a trajectory or a realization, of the process S. Instead of considering a stochastic process as an indexed family of R d -valued random variables, one may thus think of a stochastic process as a family of random paths, trajectories, etc. In some cases (less in this course), it is helpful to think of a stochastic process S as a function (ω, t) 7→ St(ω) from the product space Ω × [0, T] to R d . If the paths of a continuous time process are P-almost surely continuous, then the process is called a continuous stochastic process. For a random variable η ∈ (Ω, F, P), we denote η ∼ N(µ, σ2 ) when η is a normally distributed random variable with mean µ and standard deviation σ. Remark 2.9. We often use the property that for η ∼ N(0, σ2 ) and positive integer m, there is a constant L such that Eη2m = Lσ2m, Definition 2.10. An adapted continuous stochastic process W is a Brownian motion, if it has independent increments in the sense that, for all 0 ≤ t0 < t1 < · · · < tn the random variables {Wti − Wti−1 | i = 1, . . . n} are independent, and Wt − Ws ∼ N(0, t − s) for all 0 ≤ s < t ≤ T, From now on we assume, unless stated otherwise, that given a Brownian motion W, it starts at zero, that is, W0 = 0. Exercise 2.3.1. Show that a Brownian motion W is a martingale, that is, for all s < t ≤ T, s > 0, we have E|Wt| < ∞ and E[Wt | Fs] = Ws. Here we assume that the increments of W are independent of the filtration in the sense that, for all s < t, the random variable Wt − Ws is indenpendent of Fs. This is the case, .e.g., when the filtration is generated by W. In the definition of Brownian motion, it possible to omit the assumption that the paths are continuous. This follows from the famous Kolmogorov’s conti-nuity criterion. Recall that a continuous function f : [0, T] → R is α-H¨older continuous if there is L ∈ R such that |ft − fs| ≤ L|t − s| α ∀ 0 ≤ s ≤ t ≤ T. Theorem 2.11 (Kolmogorov’s continuity criterion). Let S be a stochastic pro-cesses with E |St − Ss| a ≤ L|t − s| 1+b ∀ s < t (2.1) for some constants a ≥ 1, b, L > 0. Then there exists a continuous stochastic process S˜ that is a modification of S in the sense that P(S˜ t = St) = 1 for all t. Moreover, S˜ is α-H¨older continuous almost surely for any α ≤ b/a. Exercise 2.3.2. Using Remark 2.9, show that, for any ϵ > 0, Brownian motion has (1/2 − ϵ)-H¨older continuous paths almost surely. From the computational perspective, Brownian motion has the important prop-erty that it can be approximated by piece-wise constant ”discrete-time random walks” that have independent increments. Such random random walks are easy to simulate which is the basis of Monte Carlo methods that is the main topic of the course. Recall that a sequence of random variables (η ν ) converges in distribution to the random variable η if P(η ν ≤ x) → P(η ≤ x) for all x ∈ R such that x 7→ P(η ≤ x) is continuous (i.e., for all x such that the cumulative distribution function of η is continuous at x). A sequence of vectors of random variables (η1 ν , . . . ηk ν ) converges in distribution to (η1, . . . , ηk) if P((η1 ν , . . . , ηk ν ) ≤ x) → P((η1, . . . , ηk) ≤ x) for all x ∈ R k such that x 7→ P((η1, . . . , ηk) ≤ x) is continuous. Theorem 2.12 (The central limit theorem). Let for an i.i.d. (ξk)∞ k=1 sequence of random variables with Eξk = 0 and E(ξk) 2 = 1. We have (2.2) for a random variable η ∼ N(0, 1). For continuous time stochastic processes S (n) , n = 1, 2, . . . and S, S (n) converges in finite dimensional distributions to S, denoted by if, for all integers k and all 0 ≤ t0 < · · · < tk ≤ T, Theorem 2.13. Let for an i.i.d. (ξk)∞ k=1 sequence of random variables with Eξk = 0 and E(ξk) 2 = 1. Then for a Brownian motion W. Proof. Using the central limit theorem and ⌊nt n ⌋ → t when n → ∞, we get as n → ∞. Let now t < u. The random variables Yu (n) − Yt (n) are independent from the variables Yt (n) , since and the random variables ξk (n) are independent. Repeating the previous argu-ments we get We observe that the variables ∆Yt (n)i:= Yt (n)i− Yt (n)i−1 are mutually independent for all 0 ≤ t0 < t1 < · · · < tN ≤ T. Thus the process Y (n) has independent increments, and so The proof is finished by the next exercise. Exercise 2.3.3. Recall the continuous mapping theorem: If (η0 ν , . . . , ηk ν ) −−→ d (η0, . . . , ηk), then f(η0 ν , . . . , ηk ν ) −−→ d f(η0, . . . , ηk) for any continuous function f : Rk → Rn. Use the continuous mapping theorem to finish the proof of Theorem 2.13.
Problem 1 9=2+3+2+2 points In this exercise we will consider four different specifications for forecasting monthly Australian total employed persons. The dataset (available on Wat-tle) AUSEmploy2022.csv contains three columns; the first column contains the date; the second contains the number of employed persons for that month (FRED data series LFEMTTTTAUM647N), and the third contains Australian GDP for that month. The data runs from January 1995 to January 2022. Let Mi be a dummy variable that denotes the i’th month of the year. Let Di be a dummy variable which denotes the i’th quarter of the year. The four specifications we consider are where Ee t = 0 for all t. a) For each specification, describe this specification in words. b) For each specification, estimate the values of the parameters, and com-pute the MSE, AIC, and BIC. If you make any changes to the csv file, please describe the changes you make. As always, you must include your code. c) For each specification, compute the MSFE for the 1-step and 5-step ahead forecasts, with the out-of-sample forecasting exercise beginning at T0 = 50. d) For each specification, plot the out-of-sample forecasts and comment on the results. Problem 2 6 points Consider the following AR(1) process with drift: yt = µ + ρyt−1 + εt , where the errors also follow an AR(1) process: εt = φεt−1 + ut , for t = 1, . . . , T, ε0 = 0, and ut are iid N(0, σ2). Suppose φ is known. Derive the log likelihood function given the observations y = (y1, . . . , yT)' and the initial y0. Find the maximum likelihood estimators for µ, ρ, and σ2. Problem 3 16=3+3+4+6 points The file USCPI.csv contains U.S. inflation rate (computed from consumer price index) from 1947Q2 to 2011Q2. (a) Fix φ = 0.3. Use the data to fit the AR(1) model in Question 2. Obtain the maximum likelihood estimates for µ, ρ, and σ2. (b) Now, we estimate φ instead of fixing it at 0.3. Obtain the maximum like-lihood estimates for φ, µ, ρ, and σ 2 . (c) Instead of AR(1) errors, consider the following AR(1) model with MA(1) errors: yt = µ + ρyt−1 + εt , εt = ut + ψut−1, for t = 1, . . . , T, where u0 = 0 and ut are iid N(0, σ2) for t ≥ 1. Derive the log likelihood function given the observations y = (y1, . . . , yT)' and the initial y0. (d) Use the inflation data to obtain the maximum likelihood estimates for ψ, µ, ρ, and σ 2 . Which model fits the data better? AR(1) or MA(1) errors? Problem 4 6 points Consider the ARX(1) model yt = µ + at + ρyt−1 + et where the errors follow an AR(2) process et = φ1et−1 + φ2et−2 + ut , u ∼ N (0, σ2I) for t = 1, . . . , T and e−1 = e0 = 0. Suppose φ1, φ2 are known. Find (analyti-cally) the maximum likelihood estimators for µ, a, ρ, and σ2. [Hint: First write y and e in vector/matrix form. You may wish to use different looking forms for each. Find the distribution of e and y. Then apply some appropriate calculus. You may want to let H = I − φ1L − φ2L2, where I is the T × T identity matrix, and L is the lag matrix.]
CED 6910 01 (70700) Capstone: Master’s Project Fall 2024 COURSE REQUIREMENTS This course will be delivered using the Hybrid NUflex learning modality. 1) This class is conducted as an interactive seminar, and unless you are an authorized remote learner, you are required to participate synchronously in every session of this class. I will join you at the class location in person. You will be able to ask questions, discuss, and interact with other students and me in person in real-time. Northeastern University has removed indoor mask requirements on its Boston campus, in accordance with new public health guidance. Face coverings are optional. 2) In addition to these hybrid weekly seminar sessions, each student (including authorized remote learners) is expected to meet with the Instructor virtually once weekly in a smaller individual project group. I will join you virtually at the scheduled class time for these project group sessions using a video platform, usually Zoom or Teams. You will be able to ask questions, discuss, and interact with other students and me in real-time. I will also be available for virtual office hours on request by email. For additional information, please refer to your advisor regarding any supplemental materials about class attendance, participation, and other aspects impacting student and instructor engagement. Technical Requirements Courses are available on Northeastern University's Canvas at the following link: http://canvas.northeastern.edu. Canvas Technical support and resources, including 24/7 phone (1-833-450-3937) and chat, can be found on the help icon in Canvas. Northeastern Technical support can be accessed at 617-373-4357 (xHELP) or [email protected].] Each student is responsible for accessing the internet for this course and research purposes. Therefore, Internet access is required for this course and will not be accepted as an excuse for missed work. If you know that you will be traveling, make sure you plan accordingly. Note regarding email/voicemail: Please include your name and class title if you email. Please allow up to 48 hours for an email reply. If you leave a voicemail, please remember to include your name, class title, and phone number. All class correspondence will go to your assigned NEU email account. Any emails sent to the whole class will go to your NEU email. You must use your NEU/Husky email account when contacting your Instructor and when retrieving or posting files to the class shared Google drive. Course Prerequisites CED 6040 Applied Econometrics This course should be taken last in the CED program. Course Description As the Capstone course for the MS in Commerce and Economic Development, this course is designed to motivate and frame. the application of economics and, if applicable, the declared student's concentration (Economic Analysis, Economic Entrepreneurship, Data Analytics, Financial Economics) to the development of problems interdisciplinary economic policy analysis. To that end, Each student is expected to engage deeply with economic thought, employing high-quality social science research methodologies to generate insights into issues of business and social importance. This course explores theoretical, methodological, and empirical issues concerning critical problems in economic activity development. Within this context, students will design and carry out interdisciplinary policy analysis, motivated by a critical set of problems with significant business and social implications. The Fall 2024 capstone course centers on the integration of Behavioral Finance, Economics, and Agent-Based Modeling (ABM) across three faculty-led research projects. Students will work on one of the three projects, each providing opportunities for hands-on application of course concepts. The projects will allow students to gain a comprehensive understanding of how behavioral finance, economics, and ABM can be used together to address complex economic challenges, culminating in actionable insights and policy recommendations. EXPECTATIONS Weekly Workload o Unless noted in specific assignments, each student is responsible for making a minimum of 3-page slide presentation discussing their self-guided learning in the Course Materials during each of the two weekly seminar meetings: 1) Thursday meeting with the entire class, and 2) Monday project seminar with individual project teams. o Students should expect 2 hours per week of classroom-related seminars and 1 hour per week of project meetings, totaling 3 hours of synchronous weekly learning. Additionally, students should anticipate a minimum of 9.5 hours per week of self-guided out-of-class work. Over the 12-week course, this amounts to a total of 36 hours of faculty instruction and 114 hours of self-guided work, for a combined minimum total of 150 hours of work for the semester. o Students should also work with a tutor, including participation in the 60-minute weekly tutor sessions, providing additional support and guidance throughout the term. o APA citations Attendance Policy All students are required to attend all scheduled classroom sessions: on-the-ground students must attend the class in person, authorized remote learning students are required to attend synchronously or asynchronously. Students are required to engage with all posted material. Student engagement with the classroom session material and the weekly posted material is tracked. The absence of meeting with the classroom sessions and the weekly instructional materials results in losing scores allocated for the weekly classroom activity.
Module Eleven Homework Assignment Methods for Calculating Exhaustion/Optimal Depletion of an Exhaustible Resource Please Submit Answers as a Word Document not a PDF Question One. In 2012, according to the U.S. Energy Information Administration (EIA) world known estimated reserves of oil (i.e., the stock of il = S) were roughly 1525 billion barrels. In that same year, annual world consumption/extraction of oil (R0) was roughly 32 billion barrels according to the International Energy Agency (IEA). Assume that all of the oil that is extracted (R) in a year is also consumed, so we can use the terms extraction and consumption interchangeably. Assume that world oil consumption (i.e., extraction) grows at a steady rate of 2% through time in the future. Calculate the exponential exhaustion index for oil given current world oil market trends? Question Two. For this question, use the same estimate of world reserves of oil, 1525 billion barrels, that was used in the first question. Also, use the same estimate of annual world consumption of oil, 32 billion barrels in 2012, as in Question One. Assume that the world oil price, Brent crude, averaged roughly $122/barrel during 2012 (according to the U.S. EIA). Suppose that the long run price elasticity of demand for oil is -0.5. Also, assume that all of the oil that is extracted (R) in a year is also consumed, so we can use the terms extraction and consumption interchangeably. Assume an optimal extraction rate based upon a 3% discount rate. Based you calculations on the following demand curve for oil, P(R), which has the following functional form.: P(R) = Ke–aR where the demand for oil is determined by: - the quantity of oil extracted (i.e., consumed), R - the parameter, K, the choke price of oil - and a parameter, a Given this information: 1. What is the choke price for oil (K)? 2. What is the optimal year that the world should exhaust (i.e., “run out”) of oil (T)? 3. What is the optimal level of consumption (i.e., extraction) of oil (R0) in 2012 (i.e., 2012 is considered the “initial year”)? 4. What is the optimal price of oil (P0) in the initial year of consumption/extraction, 2012? Question Three. Why do you think that the exponential exhaustion index and the optimal depletion methodology come up with such different answers about when the world “runs out” of oil? Suppose that oil supply was added into the optimal depletion model, how do think that this would affect the answers you just derived? Note: One omission in this analysis is that we have not factored in the environmental damage associated with oil use, so the term “optimal” should be considered only from a private standpoint. We are not taking a social perspective in this example. Directions Review the questions above along with the course materials and readings for this Unit. After reviewing these items and assessing each individual question, respond to each question thoroughly. Scoring Rubric Area Weight of Row Unacceptable Satisfactory Exemplary Methods for Calculating Exhaustion/Optimal Depletion of an Exhaustible Resource 6 points (0 – 4.79 points) Demonstrates an understanding and synthesis of some of the concepts assessing the scarcity/optimal depletion of an exhaustible resource. (4.8 – 5.39 points) Demonstrates an understanding and synthesis of most of the concepts assessing the scarcity/optimal depletion of an exhaustible resource. (5.4 or greater points) Demonstrates an understanding and synthesis of all of the concepts assessing the scarcity/optimal depletion of an exhaustible resource.
Researching Everyday Communication 2024-25 You should ensure that you understand the general requirements for submitting assignments to ELAL modules, including requirements for word counts, referencing style, etc. See the Department of Linguistics and Communication Handbook, available via the UG Canvas Hub for more information. For any assignment requiring you to collect your own data, you have general ethical approval as long as you have completed an online ethics declaration for the academic year 2024/25. Where an assessment does not explicitly ask you to undertake primary research activity (i.e. your own data collection), you should not collect any data without speaking to the module convenor and completing a separate application for ethics review. It is your responsibility to exercise appropriate judgment here, and to read the guidance available in the Department of Linguistics and Communication Handbook. Assignment 1: 1,000-word Research Proposal This assignment will allow you to demonstrate that you can: (a) write a research question, (b) consider ethics in relation to data collection, (c) plan a small research project. You will write a research proposal following the 3 questions at the bottom of this assignment. Your submission must answer all listed questions. For this assignment, you must choose a communication type to focus on from: (a) Multimodality, (b) Soundscapes, (c) Discourse Analysis, or (d) Reception / Audience Response. You will then write a research question for your chosen data type. Here are some examples (you may not use these): o How do L’Oreal advertisements make use of text and images to create a desirable product? o What do Aldi and Waitrose soundscapes sound like and how does it reflect the branding of each supermarket? o How do people change their story when sharing it with strangers compared to close friends? o What effects audiences’ evaluations of film adaptations of famous books? For your submission, answer the following 3 questions. In brackets you will find suggested word counts for each. Make sure to ground your answers in your own reflections with support from academic references that provide evidence for your decisions. 1. What type of communication did you select? Provide a definition. (250 words) 2. What is your research question? Explain the question and how you wrote it. (250 words) 3. What type of data would allow you to answer your research question? Briefly outline how you plan to collect this data. (500 words) a. Are there ethical considerations with your data collection? If yes, explain how you will address those when you collect your data.