fixpar: ~~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
fixpar(par, np, keep)

Arguments

par

~~Describe par here~~

np

~~Describe np here~~

keep

~~Describe keep 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
30
##---- 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,np,keep){
	lp<-length(par);cons<-rm.temp$cons;
	if(is.null(rm.temp$y)){
		if(lp>np){
			warning("You gave more parameters than necessary
for a single-model fit. Only the first ",np," parameters were used.");
			return(par[1:np]);
		}
		if(lp==np){return(par);}
		if(lp==1){return(rep(par,np));}
	}
	if(lp==1){return(rep(par,2*np)[c(rep.int(T,np),cons)]);}
	if(lp==np+sum(cons)){return(par);}
	if(lp==np){return(c(par,par)[c(rep.int(T,np),cons)]);}
	if(lp==2*np){return(par[c(rep.int(T,np),cons)]);}
	if(lp==4){return(fixpar(c(par,par)[keep],np,keep));}
	if(lp==8){return(fixpar(c(par)[keep],np,keep));}
	stop("If starting parameters (par) are specified,
they should be a numerical vector equal in length either
to 4, or 8, or the number of parameters in your model, or
twice the number of parameters in your model, or the
total number of *unique* parameters in your model (i.e.
two starting values for each unconstrained parameter and
one starting value for each constrained one).");
  }

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