توضیح 1
The live starter code is self-contained and uses only runner-compatible functions.
Loading
درس 18 از 22
Advanced Topic – Optional. Study threshold regimes, neural forecasts, event durations, and ordered category probabilities.
Advanced Topic – Optional
This chapter extends the core pathway. Complete Chapters 1–14 first, then use this material when your question and data justify the added model complexity.
Motivation
Economic behaviour may change by regime or arrive as durations and ordered categories rather than continuous outcomes.
Why this matters
Study threshold regimes, neural forecasts, event durations, and ordered category probabilities.
Packages and data
Base-R simulations; tsDyn, nnet, ordinal, and duration packages are optional.
توضیح 1
The live starter code is self-contained and uses only runner-compatible functions.
توضیح 2
Book-only outputs are labelled when the separate source dataset or advanced package was not supplied.
توضیح 3
R code, paths, function names, and formulas remain left-to-right in every locale.
اصطلاحات
Abrupt regime-specific dynamics separated by a threshold.
Different slopes below/above zero
Positive duration with a conditional mean recursion.
Time between transactions
Latent continuous index separated by cutpoints.
Calculate category probabilities
نمادگذاری و فرمولها
P(low)=Phi(k1-x beta); P(middle)=Phi(k2-x beta)-Phi(k1-x beta); P(high)=1-Phi(k2-x beta)
Ordered category effects vary with predictor value and category; a coefficient is not a constant probability change.
مثال حلشده
سناریو
How does probability move among low, middle, and high categories as a predictor rises?
بررسی با R
x <- c(-1,0,1); beta <- 1.2; k <- c(-.5,.7)
low <- pnorm(k[1]-beta*x)
middle <- pnorm(k[2]-beta*x)-low
high <- 1-pnorm(k[2]-beta*x)
p <- cbind(low,middle,high)
print(p)
print(rowSums(p))The coefficient shifts a latent index, so probability effects are nonlinear and category-specific. Limitation: Latent normal errors and fixed cutpoints are assumptions; time-ordered validation remains necessary.
Visual
Probability mass shifts across ordered categories as x increases.
ارتباط با R
Run the self-contained starter code in the protected STATLAB R runner. The code prints an auditable result and avoids network or unrestricted file access.
Live R Lab
Run a self-contained example, verify its output, and explain one limitation for nonlinear dynamics and discrete outcomes.
Ready to run
Common mistake
Do not randomly split lagged or transaction data; neighbouring observations leak information.
STATLAB Tip
Plot response surfaces, regime rules, or category probabilities to make nonlinear implications reviewable.
تمرین هدایتشده
سناریو
Change a TAR threshold from zero to the sample median and compare regime counts and holdout error.
Compare your result with the definition, units, and model assumptions—not only with a target number.
Exercises
Complete these without looking at the selected solutions. More than one defensible program may exist.
توضیح 1
Simulate a logistic smooth transition.
توضیح 2
Write a positive ACD recursion.
توضیح 3
Calculate probabilities at -1, 0, 1.
Selected solutions
These are compact solution routes. Confirm dimensions, units, and any changed modelling choices.
توضیح 1
w <- 1/(1+exp(-gamma*(q-c)))
توضیح 2
Use positive omega/coefficients and positive innovations.
توضیح 3
Evaluate pnorm differences and verify every row sums to one.
Chapter summary
Study threshold regimes, neural forecasts, event durations, and ordered category probabilities.
توضیح 1
TAR switches abruptly.
توضیح 2
Neural models require regularization and time-aware validation.
توضیح 3
ACD models positive durations.
توضیح 4
Ordered models should be explained through probabilities.
اصطلاحات
threshold rule
Use in Nonlinear Dynamics and Discrete Outcomes.
TAR
Use in Nonlinear Dynamics and Discrete Outcomes.
neural network
Use in Nonlinear Dynamics and Discrete Outcomes.
category probabilities
Use in Nonlinear Dynamics and Discrete Outcomes.
References and provenance
Safavi (2026), Chapter 18. Student notes: Mohammad Safavi, Ph.D., STATLAB Academy, Version 1.0.
منبع
The authoritative 125-page English PDF accompanies this native lesson.
دریافتبازاندیشی
Name the assumption, evidence you would seek, and how the recommendation might change.
ارزیابی پایانی