Description Usage Arguments Examples
This function estimates of the minimal deviations from rational expectations with unconstrained information set. Both vectors should have the same length. If not, one can randomly select a subset of the longer vector with length equal to that of the shorter one. The function returns a function via the approxfun of the package stats. This function can then be evaluated directly on a desired grid.
1 | estimDev(psi, y)
|
psi |
vector of subjective expectations |
y |
vector of realisations of an individual outcome. |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | n_p=200
n_y=200
sig=0.1
u=1
b=0.10
a=2
rho= 0.4
psi <- rnorm(n_p,0,u)
pp_y <- runif(n_y,0,1)
zeta <- rnorm(n_y,a,sig)
zeta1 <- rnorm(n_y,-a,sig)
pp1_y <- 1*(pp_y <b)
pp2_y <- 1*(pp_y >1-b)
pp3_y <- 1*(pp_y <=(1-b) & pp_y >=b)
psi_y <-rnorm(n_p,0,u)
y = rho*psi_y+ pp1_y*zeta + pp2_y*zeta1
g_star <- estimDev(psi,y)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.