Ejemplo n.º 1
0
void confidence_factor(double p, double *v, uint_t nv , double *Cf){
    
    for (uint_t ii=0; ii<nv; ii++){
        Cf[ii]=confidence_factor(LOWER,p,v[ii]);
        Cf[ii+nv]=confidence_factor(UPPER,p,v[ii]);
    }
    
}
Ejemplo n.º 2
0
// computes the confidence factors
void confidence_factor(double p, double *wk, uint_t nwk, uint_t K, double *Cf){
    
    double v;   // approximate degrees of freedom
    for (uint_t ii=0; ii<nwk; ii++){
        v=degrees_of_freedom(ii,wk,nwk,K);        
        Cf[ii]=confidence_factor(LOWER,p,v);
        Cf[ii+nwk]=confidence_factor(UPPER,p,v);
        
    }
    
}
Ejemplo n.º 3
0
void confidence_interval( double p, double *S, uint_t N, double *wk, uint_t nwk, uint_t K, double *Sc){
    
    uint_t pp_start=N-nwk;       //temporarily stores quantile information in Sc (ensuring not to be overwritten)
    
    double v;   // approximate degrees of freedom
    for (uint_t ii=0; ii<nwk; ii++){
        v=degrees_of_freedom(ii,wk,nwk,K);        
        Sc[pp_start+ii]=confidence_factor(LOWER,p,v);
        Sc[pp_start+N+ii]=confidence_factor(UPPER,p,v);
        
    }
    
    uint_t ipp;                 //used to calculate index of quantile
    for (uint_t ii=0; ii<N; ii++){
        ipp=ii%nwk;
        Sc[ii]   = Sc[ipp+pp_start]*S[ii];          //lower bound
        Sc[ii+N] = Sc[ipp+pp_start+N]*S[ii];        //upper bound
    }
}
 double get_new_prediction(TruncatedSeq* seq) {
   return MAX2(seq->davg() + sigma() * seq->dsd(),
               seq->davg() * confidence_factor(seq->num()));
 }
Ejemplo n.º 5
0
double mtcpsd<T>::conf_factor(uint_t ii, CONF_BOUND side, double p){
    
    return confidence_factor(side,p,this->dof(ii));
    
}