File: ects_nls.inp

package info (click to toggle)
gretl 2016d-1
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 48,620 kB
  • ctags: 22,779
  • sloc: ansic: 345,830; sh: 4,648; makefile: 2,712; xml: 570; 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