Calculate the Natural Rate of Unemployment
.calculator-widget {
font-family: sans-serif;
border: 1px solid #ddd;
padding: 20px;
border-radius: 8px;
max-width: 600px;
margin: 20px auto;
background-color: #f9f9f9;
}
.calculator-widget h2 {
text-align: center;
margin-bottom: 20px;
color: #333;
}
.calculator-form .form-group {
margin-bottom: 15px;
}
.calculator-form label {
display: block;
margin-bottom: 5px;
font-weight: bold;
color: #555;
}
.calculator-form input[type="text"] {
width: calc(100% – 22px);
padding: 10px;
border: 1px solid #ccc;
border-radius: 4px;
box-sizing: border-box;
}
.calculator-form button {
width: 100%;
padding: 10px 15px;
background-color: #007bff;
color: white;
border: none;
border-radius: 4px;
cursor: pointer;
font-size: 16px;
transition: background-color 0.3s ease;
}
.calculator-form button:hover {
background-color: #0056b3;
}
.calculator-result {
margin-top: 20px;
padding: 15px;
border: 1px solid #eee;
background-color: #fff;
border-radius: 4px;
text-align: center;
font-size: 1.1em;
color: #333;
}
.calculator-explanation {
margin-top: 30px;
padding-top: 20px;
border-top: 1px solid #eee;
font-size: 0.95em;
line-height: 1.6;
color: #444;
}
.calculator-explanation h3,
.calculator-explanation h4 {
color: #333;
margin-bottom: 10px;
}
.calculator-explanation ul {
margin-left: 20px;
margin-bottom: 10px;
}
.calculator-explanation li {
margin-bottom: 5px;
}
.calculator-explanation code {
background-color: #e9e9e9;
padding: 2px 4px;
border-radius: 3px;
font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
}
function calculateNaturalUnemployment() {
var inflationRate = parseFloat(document.getElementById("inflationRate").value);
var outputGap = parseFloat(document.getElementById("outputGap").value);
var phillipsCurveSlope = parseFloat(document.getElementById("phillipsCurveSlope").value);
var resultDiv = document.getElementById("result");
if (isNaN(inflationRate) || isNaN(outputGap) || isNaN(phillipsCurveSlope)) {
resultDiv.innerHTML = "Please enter valid numbers for all fields.";
return;
}
if (phillipsCurveSlope === 0) {
resultDiv.innerHTML = "The Phillips Curve slope cannot be zero.";
return;
}
// This formula estimates the deviation of the *current* unemployment rate
// from the natural rate, given the output gap and Phillips curve slope.
// The natural rate itself is not directly calculated by this simple formula,
// but the output provides insight into economic conditions relative to it.
// A common simplified relationship is that the unemployment gap (Actual UR – Natural UR)
// is related to the output gap by: Unemployment Gap = – (Output Gap / Phillips Curve Slope)
// The inflation rate influences the *movement* towards or away from accelerating inflation,
// but the core relationship for the *level* of unemployment relative to the natural rate
// is often driven by the output gap and slope.
// For this calculator, we will present the 'Unemployment Gap' which shows how far
// unemployment is likely from its natural rate, and a 'Pressure on Inflation' metric.
var unemploymentGap = -(outputGap / phillipsCurveSlope);
// A positive unemployment gap means actual unemployment is HIGHER than the natural rate.
// A negative unemployment gap means actual unemployment is LOWER than the natural rate.
// We can also infer pressure on inflation based on the output gap.
// A positive output gap generally means inflationary pressure.
var inflationPressure = outputGap; // Simple direct relationship for illustration
var resultHTML = "