File: ects_nls.inp

package info (click to toggle)
gretl 2022c-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 59,552 kB
  • sloc: ansic: 409,074; sh: 4,449; makefile: 3,222; cpp: 2,777; xml: 599; perl: 364
file content (24 lines) | stat: -rw-r--r-- 552 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# Replicate illustrative NLS model from Russell Davidson
# This example is associated with his econometrics program 
# ECTS; see http://russell.vcharite.univ-mrs.fr/ects4/

open ects_nls.gdt
ols y 0 x1 x2 --vcv
scalar alpha = $coeff[1]
scalar beta = $coeff[2]
scalar a0 = alpha
scalar b0 = beta

# with analytical derivatives
nls y = alpha + beta*x1 + (1/beta)*x2
 deriv alpha = 1
 deriv beta = x1 - x2/(beta*beta)
end nls --vcv

# with numerical derivatives
alpha = a0
beta = b0
nls y = alpha + beta*x1 + (1/beta)*x2
 params alpha beta
end nls --vcv