NcmBootstrap

NcmBootstrap — Generic index bootstrap.

Functions

Properties

guint bootstrap-size Read / Write / Construct
guint full-size Read / Write / Construct
gboolean init Read
GVariant * realization Read / Write

Types and Values

Object Hierarchy

    GObject
    ╰── NcmBootstrap

Description

This object generate random samples of indexes. These samples are used to calculate statistics using different combinations of the same data set.

Functions

ncm_bootstrap_new ()

NcmBootstrap *
ncm_bootstrap_new (void);

Creates a new zero sized NcmBootstrap object.

Returns

a NcmBootstrap.

[transfer full]


ncm_bootstrap_sized_new ()

NcmBootstrap *
ncm_bootstrap_sized_new (guint fsize);

Creates a new NcmBootstrap object for a sample of size fsize . This object will sample with replacement all indexes fsize times.

Parameters

fsize

sample size.

 

Returns

a NcmBootstrap.

[transfer full]


ncm_bootstrap_full_new ()

NcmBootstrap *
ncm_bootstrap_full_new (guint fsize,
                        guint bsize);

Creates a new NcmBootstrap object for a sample of size fsize . This object will sample with replacement all indexes bsize times.

Parameters

fsize

sample size.

 

bsize

bootstrap size.

 

Returns

a NcmBootstrap.

[transfer full]


ncm_bootstrap_ref ()

NcmBootstrap *
ncm_bootstrap_ref (NcmBootstrap *bstrap);

Incresases the reference count of bstrap by one.

Parameters

bstrap

a NcmBootstrap.

 

Returns

a NcmBootstrap.

[transfer full]


ncm_bootstrap_free ()

void
ncm_bootstrap_free (NcmBootstrap *bstrap);

Decreases the reference count of bstrap by one.

Parameters

bstrap

a NcmBootstrap.

 

ncm_bootstrap_clear ()

void
ncm_bootstrap_clear (NcmBootstrap **bstrap);

Decreases the reference count of *bstrap by one and sets *bstrap tp NULL.

Parameters

bstrap

a NcmBootstrap.

 

ncm_bootstrap_set_fsize ()

void
ncm_bootstrap_set_fsize (NcmBootstrap *bstrap,
                         guint fsize);

Sets the full sample size, it also sets the bsize to the same value fsize .

Parameters

bstrap

a NcmBootstrap.

 

fsize

full sample size.

 

ncm_bootstrap_get_fsize ()

guint
ncm_bootstrap_get_fsize (NcmBootstrap *bstrap);

Gets the full sample size.

Parameters

bstrap

a NcmBootstrap.

 

Returns

the full sample size.


ncm_bootstrap_set_bsize ()

void
ncm_bootstrap_set_bsize (NcmBootstrap *bstrap,
                         guint bsize);

Sets the bootstrap size.

Parameters

bstrap

a NcmBootstrap.

 

bsize

bootstrap size.

 

ncm_bootstrap_get_bsize ()

guint
ncm_bootstrap_get_bsize (NcmBootstrap *bstrap);

Gets the bootstrap size.

Parameters

bstrap

a NcmBootstrap.

 

Returns

the bootstrap size.


ncm_bootstrap_resample ()

void
ncm_bootstrap_resample (NcmBootstrap *bstrap,
                        NcmRNG *rng);

Sample with replacement “bootstrap-size” from the “full-size” indexes.

Parameters

bstrap

a NcmBootstrap.

 

rng

a NcmRNG.

 

ncm_bootstrap_remix ()

void
ncm_bootstrap_remix (NcmBootstrap *bstrap,
                     NcmRNG *rng);

Sample without replacement “bootstrap-size” from the “full-size” indexes. Note that in this case “bootstrap-size” must be equal or smaller than “full-size”.

Parameters

bstrap

a NcmBootstrap.

 

rng

a NcmRNG.

 

ncm_bootstrap_get ()

guint
ncm_bootstrap_get (NcmBootstrap *bstrap,
                   guint i);

Gets the index associated with the i -th resampled index.

Parameters

bstrap

a NcmBootstrap.

 

i

index in [0, “bootstrap-size” - 1].

 

Returns

the i -th resampled index.


ncm_bootstrap_get_sortncomp ()

GArray *
ncm_bootstrap_get_sortncomp (NcmBootstrap *bstrap);

Fills an array with the sorted indexes followed by the number of times they appear.

Parameters

bstrap

a NcmBootstrap.

 

Returns

the sorted array of indexes and frequences.

[array][element-type guint][transfer full]


ncm_bootstrap_is_init ()

gboolean
ncm_bootstrap_is_init (NcmBootstrap *bstrap);

Checks if the bootstrap object was initialized (remix or resample).

Parameters

bstrap

a NcmBootstrap.

 

Returns

whether bstrap is initialized.

Types and Values

NCM_TYPE_BOOTSTRAP

#define NCM_TYPE_BOOTSTRAP (ncm_bootstrap_get_type ())

NCM_BOOTSTRAP_RNG_NAME

#define NCM_BOOTSTRAP_RNG_NAME "bootstrap"

NcmBootstrap

typedef struct _NcmBootstrap NcmBootstrap;

Property Details

The “bootstrap-size” property

  “bootstrap-size”           guint

Bootstrap size.

Owner: NcmBootstrap

Flags: Read / Write / Construct

Default value: 0


The “full-size” property

  “full-size”                guint

Data sample size.

Owner: NcmBootstrap

Flags: Read / Write / Construct

Default value: 0


The “init” property

  “init”                     gboolean

Bootstrap initialization status.

Owner: NcmBootstrap

Flags: Read

Default value: FALSE


The “realization” property

  “realization”              GVariant *

Bootstrap current realization.

Owner: NcmBootstrap

Flags: Read / Write

Allowed values: GVariant<au>

Default value: NULL