hsg: ~~function to do ... ~~

Description Usage Arguments Details Value Note Author(s) References See Also Examples

Description

~~ A concise (1-5 lines) description of what the function does. ~~

Usage

1
hsg(par, cons = NULL, x = NULL, y = NULL)

Arguments

par

~~Describe par here~~

cons

~~Describe cons here~~

x

~~Describe x here~~

y

~~Describe y here~~

Details

~~ If necessary, more details than the description above ~~

Value

~Describe the value returned If it is a LIST, use

comp1

Description of 'comp1'

comp2

Description of 'comp2'

...

Note

~~further notes~~

~Make other sections like Warning with Warning .... ~

Author(s)

~~who you are~~

References

~put references to the literature/web site here ~

See Also

~~objects to See Also as help, ~~~

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
##---- Should be DIRECTLY executable !! ----
##-- ==>  Define data, use random,
##--	or do  help(data=index)  for the standard data sets.

## The function is currently defined as
function(par,cons=NULL,x=NULL,y=NULL){
	if(is.null(cons)) cons<-rm.temp$cons;
	if(is.null(x)) { x<-rm.temp$x; y<-rm.temp$y; }
	par2<-par[1:2]; par2[cons>0]<-par[3:length(par)];
	env1<-list(a=par[1],b=par[2],x=rm.temp$x);
	env2<-list(a=par2[1],b=par2[2],x=rm.temp$y);
	out1a<-c(sum(eval(D(D(exg,'a'),'a'),envir=env1)),
		sum(eval(D(D(exg,'b'),'a'),envir=env1)));
	out1b<-c(sum(eval(D(D(exg,'a'),'b'),envir=env1)),
		sum(eval(D(D(exg,'b'),'b'),envir=env1)));
	out1<-rbind(out1a,out1b); 
	out1<-rbind(cbind(out1,out1),cbind(out1,out1));
	out2a<-c(sum(eval(D(D(exg,'a'),'a'),envir=env2)),
		sum(eval(D(D(exg,'b'),'a'),envir=env2)));
	out2b<-c(sum(eval(D(D(exg,'a'),'b'),envir=env2)),
		sum(eval(D(D(exg,'b'),'b'),envir=env2)));
	out2<-rbind(out2a,out2b); 
	out2<-rbind(cbind(out2,out2),cbind(out2,out2));
	id1<-c(1,1,1-cons); id2<-c(1-cons,1,1);
	id1<-id1%o%id1; id2<-id2%o%id2;
	out<-out1*id1+out2*id2;
	if(rm.temp$debug){print("hessian:");print(out);}
	out[c(1:2,3:4*cons),c(1:2,3:4*cons)];
  }

Survomatic documentation built on May 2, 2019, 4:09 p.m.

Related to hsg in Survomatic...