All questions for this project will be answered in the Project 3 Gradescope assignment. Read through this guidance to find the relevant material and R commands, as well as the required tasks, but note that the only deliverable for this project is to answer the questions in the Gradescope assignment and upload a R script containing all your work for this project.
This assignment is individual effort. You may reference any published resource (in print or online) and receive help from any individual; however, the work you turn in must be an accurate representation of your knowledge and understanding of the problem. It is NEVER acceptable to copy any portion of another’s work and submit it as your own. Here are a few blatant examples of copying:
Helping your classmates understand the concepts is encouraged, but only provide assistance up to your depth of understanding. If you have to look at your solution while giving help, you are most likely beyond your depth of understanding. Do not give your solution to another cadet in any form (hard copy, soft copy, or verbal).
By the end of this project you will:
fitModel() to model
a datasetIn this project, we will expand our understanding of derivatives and mathematical modeling by examining an aircraft sortie generation dataset from a historical air campaign, Operation Allied Force. An aircraft sortie is a single operational flight by one aircraft (from takeoff to landing) executed to perform a specific mission such as training, reconnaissance, transport, or combat.
Operation Allied Force was the North Atlantic Treaty Organization’s (NATO) 78-day air campaign conducted from 24 March to 10 June 1999 against the Federal Republic of Yugoslavia (Serbia and Montenegro). It marked the first sustained combat operation in NATO’s history and was executed without ground combat forces, relying solely on the projection of airpower to compel Serbian leader Slobodan Milošević to halt ethnic cleansing and military operations in Kosovo. The campaign began with limited, precision strikes on Serbian air defenses, command-and-control nodes, and early-warning radar, but rapidly expanded to include infrastructure, logistics, and fielded forces throughout Serbia and Kosovo.
Over time, NATO air assets surged from roughly 400 to more than 1,000 aircraft, primarily from the U.S. Air Force and allied European partners, flying about 38,000 sorties, including more than 10,000 strike sorties. Adverse weather, restrictive rules of engagement, and political constraints initially limited effectiveness, but intensified operations in late May — notably against Belgrade’s power grid, bridges, and ground forces — precipitated Serbian withdrawal. On 10 June 1999, Milošević accepted NATO terms, ending the conflict. The operation demonstrated both the strategic potential and limitations of coercive airpower, emphasizing the critical role of precision strike capability, logistical sustainment, and coalition coordination in modern air campaigns. Reference Link: 1999 - Operation Allied Force
Below a graphic depicting the Air Force bases involved in support Operation Allied Force.
We will use dataframes from two files in this project. Both contain
daily sortie generation data from the Operation Allied Force air
campaign. The first file, allied_force1.csv, contains data
from the first 40 days of the campaign (24 March to 2 May 1999). The
second file, allied_force2.csv is expanded, and contains
the full 78 days of sortie data from 24 March until the campaign’s end
on 10 June 1999. The data used in this project is notional synthetic
data, but is still highly representative of events in the real conflict.
Each dataset includes data columns called \(Day\) and \(Sorties\). The \(Day\) column represents the day of the
Operation Allied Force campaign which started on 24 March 1999. The
\(Sorties\) column represents daily
sortie generation or how many aircraft took off each day in support of
the air campaign mission.
To clarify, the output variable units of this dataset is Sorties which represents the number of sorties flown on that particular day (NOT cumulative sorties flown). For instance, on Day 4 the NATO force flew 104 sorties on just that day. The input variable units of this dataset is Days which represents the number of days from the start of the campaign. For example, \(Day = 4\) refers to 27 March 1999.
Before we proceed, load the required packages. Remember that in order to use a package, we need to install AND load the package. The packages necessary for this project are already installed on PositCloud; there is no need to install them there. You will need to load the required packages by executing the commands below. Note: you may have to re-run these packages each time you reload your R session.
library(tidyverse)
The data you will use for this project is not pre-installed in
R, so you need to upload the provided dataset into Posit-Cloud.
To load the dataset into RStudio on PositCloud, follow the steps below:
Step 0: Download the allied_force1.csv and
allied_force2.csv files to your computer. These files can
be found in Block 3 Resources and then Project
3 folders in the Math 141 Fall 2025 Teams channel. Note: Do
NOT change the file types or names - leave as a .csv file!
Step 1: In RStudio on PositCloud, in the Files tab in
the bottom right, click on the file folder called “data”.
Step 2: Click the Upload Files button as depicted below
Step 3 & 4: Click Choose File and choose the ``allied_force1.csv’’ file wherever you saved it. Click OK
Then, repeat the above process to upload the ``allied_force2.csv’’ to Posit Cloud. While both files are now loaded in Posit Cloud, you still need to read the datasets into RStudio to use them. You can import the data by following the command below. If you followed the import directions exactly, you should not have to change the file path.
setwd("/cloud/project/")
allied_force1 = read_csv('./data/allied_force1.csv')
allied_force2 = read_csv('./data/allied_force2.csv')
Another alternative to import these files is to left-click on the
allied_force1.csv file in your RStudio Files pane
and then select “Import Dataset…”. This will open a new dialog box.
Simply click “Import” at the bottom-right to import the dataset (there
is no need to make any changes). Then, repeat this process for
allied_force2.csv.
We will first start with examining the allied_force1
dataset. Always view your data after importing. Not only will this
confirm whether it was imported properly, but it also allows you to get
familiar with the structure of the data. Use either of the commands
below to preview your data.
head(allied_force1)
View(allied_force1)
In Block 2, we learned that we can represent columns of data in a dataset as vectors. Below is code to initialize each of the four data columns in this project into separate vectors. You have the option to use these vectors for calculations later in this project such as for computing residuals. Copy the following commands into your R Script and Run:
Day1 = allied_force1$Day
Sorties1 = allied_force1$Sorties
Day2 = allied_force2$Day
Sorties2 = allied_force2$Sorties
Plot the daily sortie generation count versus day of the campaign, so
that Sorties1 is on the vertical axis and Day1
is on the horizontal axis. Copy the following commands into your
R Script and Run:
plotPoints(Sorties1 ~ Day1)
As you can see from the graph of the plotted points, there may be multiple functions that could reasonably model this data. In Block 2, you learned that the metric Root Mean Square Error (RMSE) can be used to compare the effectiveness of different models. In this section, you will find best-fit models for both a linear model and a sigmoid model. Then, using the residuals from each of these models, you will calculate RMSE of both models to compare how well they fit the data.
Answer Q2 in Gradescope
Using allied_force1 data and fitModel, find
the best-fit linear model of the form: \[Sorties1 = m*Day1+b\]
Calculate the Root Mean Square Error (RMSE) for your best-fit linear model.
Answer Q3 in Gradescope
If you recall from Block 1, ‘by-hand’ parameter estimates are
required as initial values in the fitModel command for
sigmoid functions. Based on the plot of \(Sorties1\) and \(Day1\), approximate the parameters (\(A, m, s, v\)) of the sigmoid model using
the allied_force1 data. Remember: these estimates do not
have to be exact, but should reasonably reflect the data as visualized.
Recall that the below formula models the sigmoid function in this
course: \[
Sorties1(Day1) = A*\text{pnorm}(Day1, m, s) + v
\] To verify your estimated parameters, you can plot the
estimated sigmoid function on top of the data points. If done correctly,
your estimated model should fairly resemble the trend of the data.
Report your ‘by-hand’ estimated values for \(A\), \(m\), \(s\), and \(v\).
Answer Q4 in Gradescope
When you are confident in your parameter estimates, use these values
to find the “best-fit” sigmoid model using fitModel in
R. Report the best-fit values for \(A\), \(m\), \(s\), and \(v\). Lastly, calculate the RMSE of the
best-fit sigmoid model.
Answer Q5 in Gradescope
We now have “best-fit” models for both the sigmoid and linear
functions and calculated RMSEs for each model. Which model best fits the
allied_force1 data?
Answer Q6 in Gradescope
Regardless of your answer to the previous question, let’s continue to
apply only the best-fit sigmoidal function to this
data. The allied_force1 dataset contains sortie generation
data for the first 40 days of the Operation Allied Force air campaign.
Sortie generation was low as the campaign began, but then accelerated.
As \(Day\) increases, the rise in \(Sorties\) was likely due to execution of
the initial deployment phase which introduced limited precision strikes
against important targets such as air defenses, early-warning radar
sites, and command-and-control centers. Although after 30+ days, \(Sorties\) stopped increasing and stayed
level at about 400 sorties occurring each day. This was likely due to
NATO pausing expansion to assess strategic effects and from adverse
weather at the time. The sigmoid function is ideal when, as the input
increases, the output appears to increase or decrease from a level-state
and then level-off again as is apparent here.
With the above explanation in mind, how would you interpret the meaning of the \(m\) parameter of the sigmoid model?
Answer Q7 in Gradescope
The number of sorties generated each day appears to greatly increase within the interval of \(Day = 8\) to \(Day = 28\). Ccalculate the Average Rate of Change (AROC) of the best-fit sigmoid function over the interval \((8,28)\). Report the calculated AROC value in Gradescope.
Answer Q8 in Gradescope
What was the Instantaneous Rate of Change (IROC) at 1-week (7 days) into the campaign? What was the Instantaneous Rate of Change (IROC) at 2-weeks (14 days) into the campaign? Report the calculated IROC values. On which of these two days did the greatest IROC value occur?
Answer Q9 in Gradescope
(allied_force1)
Apply the D() command in R to calculate the
derivation function of your best-fit sigmoid model. Evaluate the
derivative function at 2-weeks (14 days) and at 5-weeks (35 days) into
the air campaign. How do you interpret these results? Report the
calculated derivative values and answer the questions in Gradescope. You
are not required to plot the derivative function of
allied_force1 data, although you are welcome to do so if
you wish.
Note: We recommend that you use an input variable
name of x within D() and plotFun
when computing and plotting the derivative function. Using
Day or Day1 instead may return an error and
not produce the desired plot. For example, the following R code
could be used to plot your derivative function:
plotFun(d_allied1(x)~x, xlim = range(0,40))
assuming that d_allied1() is the name you gave your
derivative function for the best-fit sigmoid model.
Answer Q10 in Gradescope
Up to this point in Project 3, we have only analyzed
allied_force1 which covered the first 40 days of the
Operation Allied Force campaign. The allied_force2 data set
covers the entire 78 days of the campaign. We will use the
allied_force2 data for the reminder of this project.
Plot the daily sortie generation count versus day of the full
campaign, so that Sorties2 is on the vertical axis and
Day2 is on the horizontal axis. Copy the following commands
into your R Script and Run:
plotPoints(Sorties2 ~ Day2)
After visualization of the full campaign, how does the shape of the data compare to before? Did Operation Allied Force have two major waves of sortie generation increases?
Answer Q2 in Gradescope
The typical sigmoid function can be applied to model situations
where, as the input increases, the output increases or decreases from a
leveled state and then levels off again. However, this sigmoid
characteristic appears to occur twice when we examine
the plot of the full campaign. Therefore, we will use an
extended sigmoid function to find the best-fit model on
the full campaign (allied_force2). The extended sigmoid
model will have the following function form:
\[ \text{Sorties2}(\text{Day2}) = A_1\textsf{pnorm}(\text{Day2},m_1,s_1)+v_1 + A_2\textsf{pnorm}(\text{Day2},m_2,s_2). \]
where \(A_1\), \(m_1\), \(s_1\), and \(v_1\) are parameters describing the first
sigmoid “wave”, \(A_2\), \(m_2\), and \(s_2\) are parameters describing the second
sigmoid “wave”. Treat each wave as a separate model when estimating
parameters by-hand for the initial conditions in fitModel.
Note: there is only one vertical shift (\(v_1\)) to account for the first wave, but
none is needed for the second wave since we want the two waves to be
connected (not disjointed).
Once you obtain the best-fit extended sigmoid model for the data of
the full campaign, we recommend to plot this function on top of the
plotted points of allied_force2. Does this best-fit model
appear to fit the data well?
Answer Q3 in Gradescope
The second wave in this dataset makes sense historically, because NATO launched an expanded targeting phase during that time against Serbian military forces in Kosovo, fielded ground units, and infrastructure in Belgrade. Additional U.S. and allied aircraft joined the campaign at this time to include B-1Bs, F-117s, tanker support, and more. Reduced political constraints, improved command coordination, and favorable weather also contributed to an increase in the number of sorties generated each day.
Evaluate yourbest-fit extended sigmoid model at \(Day = 55\). Apply model inference to determine which wave of the campaign lasted longer.
Apply the D() command in R to calculate the
derivative function of your best-fit exteneded sigmoid model.
Use the plotFun command in R to visualize the
derivative of the best-fit extended sigmoid model from
the allied_force2 dataset.
Note: We recommend that you use an input variable
name of x within D() and plotFun
when computing and plotting the derivative function. Using
Day or Day2 instead may return an error and
not produce the desired plot. For example, the following R code
could be used to plot your derivative function:
plotFun(d_allied2(x)~x, xlim = range(0,78))
assuming that d_allied2() is the name you have your
derivative function for the best-fit extended sigmoid model.
Answer Q4 in Gradescope
The second derivative of a model function can also provide significant insights into a modeled dataset. Calculate the derivative of the best-fit extended sigmoid model derivative to find the second derivative function. Then, plot your second derivative function in R. Note: you can use the code and tips above on how to properly graph a derivative function in R.
Answer Q5 in Gradescope
You have now generated three different functions modeled on the
allied_force2 data: 1) a best-fit extended sigmoid
function, 2) the first derivative of the extended sigmoid function, and
3) the second derivative of the extended sigmoid function. One or more
of these functions can be applied to assess sortie generation in
Operation Allied Force depending on a particular question or interest.
Answer several questions in Gradescope regarding which functions are
applicable to certain scenarios.
Answer Q6 in Gradescope
Operation Allied Force (1999) was a 78-day NATO air campaign against Yugoslavia conducted entirely through the use of airpower, without deploying ground combat forces. Its goal was to compel Serbian leader Slobodan Milošević to halt ethnic cleansing in Kosovo and accept NATO terms for withdrawal. The operation’s significance lies in its demonstration of how sustained, precision airstrikes—supported by coalition coordination, logistical resilience, and flexible targeting—could achieve strategic objectives through coercive pressure alone. As shown in the extended sigmoid sortie generation data, the campaign unfolded in two major surges of air activity, reflecting both the logistical buildup and the later strategic intensification that ultimately forced a political resolution.
You will learn later in your Air Force careers about joint operation planning. It is not unusual for air campaigns to have different stages or phases similar to Operation Allied Force. Initial campaign stages of strategic targeting and enabling air superiority are common tactics to enable further military expansion in later stages. Now that you have developed a model on a critical historical campaign, it can be used as a tool to learn from past conflicts and also as a framework to estimate campaign phases for future planning. Hopefully you gained a greater appreciation of airpower through this mathematical excursion.