libtpcmodel
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines
Defines | Functions | Variables
bootstrap.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <time.h>
#include "petc99.h"
#include "include/powell.h"
#include "include/bootstrap.h"
Include dependency graph for bootstrap.c:

Go to the source code of this file.

Defines

#define RAND_MAX   32767
#define ITER_NR   200

Functions

int bootstrapQSort (const void *par1, const void *par2)
int bootstrap (double *cLim1, double *cLim2, double *SD, double *parameter, double *lowlim, double *uplim, int frameNr, double *tac, double *fitTac, int parNr, double *weight, double(*objf)(int, double *, void *))

Variables

int bs_parNr
int bs_frameNr
double * bs_parameter
double * bs_uplim
double * bs_lowlim
double * bs_weight
double(* bs_func )(int, double *, void *)

Define Documentation

#define ITER_NR   200

Definition at line 62 of file bootstrap.c.

Referenced by bootstrap().

#define RAND_MAX   32767

Definition at line 58 of file bootstrap.c.

Referenced by bootstrap(), and random_shuffle().


Function Documentation

int bootstrap ( double *  cLim1,
double *  cLim2,
double *  SD,
double *  parameter,
double *  lowlim,
double *  uplim,
int  frameNr,
double *  tac,
double *  fitTac,
int  parNr,
double *  weight,
double(*)(int, double *, void *)  objf 
)

Bootstrap method.

Original weights are assumed to be inversely proportional to variance. Square root is used, because bootstrap assumes them to be proportinal to standard deviation. If only standard deviation is wanted then cLim1 and cLim2 can be set to be NULL, and if only the confidence limits are wanted then SD can be set to be NULL.

Returns:
Return values: 0, if ok. 1 - 3 if some of the given parameters is not qualified. 4, if Powell fails, and 5, if out of memory.
Parameters:
cLim1vector to put the lower confidence limits to
cLim2vector to put the upper confidence limits to
SDvector to put the standard deviations to
parameterParameter estimates
lowlimLower limits for the parameters
uplimUpper limits for the parameters
frameNrNr of time points in tissue data
tacmeasured tissue TAC values (will be changed)
fitTacfitted tissue TAC values (preserved)
parNrNr of parameters
weightweights
objfThe object function

Definition at line 92 of file bootstrap.c.

References bootstrapQSort(), bs_frameNr, bs_func, bs_lowlim, bs_parameter, bs_parNr, BS_TEST, bs_uplim, bs_weight, bserrmsg, ITER_NR, powell(), and RAND_MAX.

Here is the call graph for this function:

int bootstrapQSort ( const void *  par1,
const void *  par2 
)

local function definitions

Definition at line 309 of file bootstrap.c.

Referenced by bootstrap().


Variable Documentation

Definition at line 68 of file bootstrap.c.

Referenced by bootstrap().

double(* bs_func)(int, double *, void *)

Definition at line 73 of file bootstrap.c.

Referenced by bootstrap().

double* bs_lowlim

Definition at line 71 of file bootstrap.c.

Referenced by bootstrap().

double* bs_parameter

Definition at line 69 of file bootstrap.c.

Referenced by bootstrap().

int bs_parNr

Definition at line 68 of file bootstrap.c.

Referenced by bootstrap().

double* bs_uplim

Definition at line 70 of file bootstrap.c.

Referenced by bootstrap().

double* bs_weight

Definition at line 72 of file bootstrap.c.

Referenced by bootstrap().