Regression+Loop

Moderators: statman, Analyst Techy, andris, Fierce, GerineL, Smash

Medo
Posts: 2
Joined: Thu Jan 28, 2016 2:51 am

Regression+Loop

Postby Medo » Thu Jan 28, 2016 3:03 am

Hi all,

Can anyone please help me coding the following using non-linear regression and a loop:
The problem is a famous operations management decision rule for ordering behaviors of individuals.

To be exact, below is the actual model:

O(i,t)=Max{0, CO(i,t)+alpha(i) * (S'(i)-S (i,t)-(Beta(i)*SL (i,t)))}

where,
O(i,t)= orders placed by subject i in week t
CO (i,t)= Expected customer orders by subject i in period t
S' = Desired level of total inventory of subject i
S= actual on-hand inventory by subject i in period t
SL= actual on-order inventory by subject i in period t
alpha (i)= parameter showing how the inventory levels are underestimated by subject i
Beta (i) parameter showing how SL is underestimated by subject i

Also we have:
CO (i,t)= Theta (i) * IO (i,t)+(1-Theta (i) * CO (i, t-1)

where,
IO (i,t)= incoming orders received by subject i in period t
Theta (i) = is a smoothing parameter of subject i

The above shows how people decide about the order quantity based on the available data on their inventory and customer orders.

Theta, alpha, Beta and S' are parameters to be estimated.
The data for O(i,t), S, SL and IO (i,t) are available.
And CO(i,t) should also be calculated. CO (i, t=1)=0 (model's assumption)

We made some attempts to formulate this in SPSS with Lag for CO (i,t) but it keeps sending us errors.
If anyone thinks he can help us with this, I could invite them to Skype about the issue and will be very grateful.

Bests,
Medo
Medo
Posts: 2
Joined: Thu Jan 28, 2016 2:51 am

Re: Regression+Loop

Postby Medo » Thu Jan 28, 2016 3:34 am

BTW, here is our code:

* NonLinear Regression.
MODEL PROGRAM alpha=0 Beta=0 SP=0 Theta=0.
COMPUTE PRED_=MAX(0, CO + alpha * (SP - S - (Beta * SL))).
DO IF $casenum EQ 1. /* t = 0.
COMPUTE CO = 0.
ELSE. /* t > 0.
COMPUTE CO = Theta * IO + (1 - Theta) * Lag(CO).
END IF.
NLR O
/OUTFILE='C:\Users\43395309\AppData\Local\Temp\spss8128\SPSSFNLR.TMP'
/PRED PRED_
/CRITERIA SSCONVERGENCE 1E-8 PCON 1E-8.

and here is the error:
Warnings
Undefined variable name.
Execution of this command stops.
No model program has been defined. Refer to your manual for a description of the commands needed to define the model.

Who is online

Users browsing this forum: No registered users and 2 guests

cron