Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Answer the following questions by submitting your answers to Autolab via the A0 Programming assign- ment. Submit your solution in a single .cpp file. Expect
Answer the following questions by submitting your answers to Autolab via the "A0 Programming" assign- ment. Submit your solution in a single .cpp file. Expect this section to take 6-10 hours of setting up your environment, reading through documen- tation, and planning, coding, and testing your solution. Problem 8. (80 points) A time series is a sequence of measurements taken at regular successive intervals For example, the sequences and (5,10888), (10, 10949), (15,10967), (20, 10900), (25, 10821), (30, 10956) are both time series where each pair has the form (time,value), which represents the time a measurement was taken and the value taken at that time. The first series begins at time 0 and ends at time 4 and the second series begins at time 5 and ends at time 30, so the time series need not begin or end at any particular time value. Also notice that the first sequence is measured every 1 time units while the second is measured every 5 time units Your task is to read in a data file named data.csv containing a possibly incomplete time series and fill in the gaps by linearly interpolating the values. The updated series should be written to a file named data-updated.csv (the filenames should be hardcoded). Linear interpolation is done by computing a line between the two points at a gap and evaluating the e formula at the missing points -Given two points (t1, v1) and (t2,, the slope is Tn-(V2-V1)/(#2-t1) The line formula is y-mx +b, so you must solve for b The format of the data will be a non-empty comma separated file containing pairs of unsigned 64-bit integers corresponding to the time series, with one pair per line A gap occurs when two adjacent measurements differ by more than the smallest gap found within the entire sequence. Consider the following example
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started