File: ects_nls.inp

package info (click to toggle)
gretl 2019a-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 53,708 kB
  • sloc: ansic: 367,137; sh: 4,416; makefile: 2,636; cpp: 2,499; xml: 580; perl: 364
file content (24 lines) | stat: -rw-r--r-- 552 bytes parent folder | download | duplicates (6)
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