Macros | Functions | Variables
libirt.h File Reference

The exported functions definition of the libirt library. More...

#include <gsl/gsl_matrix.h>
#include <gsl/gsl_vector.h>

Macros

#define LIBIRT_H   1
 Define a flag if this header file is already included.
#define BLANK   -1
 Define the representation of blank as integer.
#define FALSE   0
 Define the representation of false as integer.
#define TRUE   1
 Define the representation of true as integer.
#define VERY_SMALL_PROB   ((double)1.0e-10)
 Define the smallest probability allowed.
#define VERY_SMALL_FREQ   ((double)1.0e-3)
 Define the smallest frequency allowed.
#define VERY_BIG_LOGIT   ((double)23.0)
 Define the biggest logit allowed in absolute value.
#define MAX_POLYCOR   ((double)0.9999)
 Define the biggest absolute polyserial correlation allowed.

Functions

int read_bin_patterns_delimited (FILE *file, int nbr_item, int nbr_subject, int skip, char delimiter, int offset, int extra, char *true_string, char *false_string, char *blank_string, int trimming, gsl_matrix_int **patterns)
 Read binary patterns from a file in delimited format.
int read_mc_patterns_delimited (FILE *file, int nbr_item, int nbr_subject, int skip, char delimiter, int offset, int extra, int trimming, gsl_matrix_int **patterns, gsl_vector_int **nbr_options)
 Read multiple choice patterns from a file in delimited format.
double logit (double p)
 Compute the logit transformation.
double logistic (double t)
 Compute the logistic transformation.
double prob_3plm (double ability, double slope, double threshold, double asymptote)
 Compute the 3 parameter logistic function.
void quadrature (int nbr_quad, double from, double to, gsl_vector *quad_points, gsl_vector *quad_weights)
 Generate the quadrature classes.
void patterns_counts (gsl_matrix_int *subjects, gsl_vector_int **index, gsl_matrix_int **patterns, gsl_vector **counts)
 Group the identical patterns from subjects into patterns.
void probs_3plm (gsl_vector *slopes, gsl_vector *thresholds, gsl_vector *asymptotes, gsl_vector *quad_points, gsl_matrix *probs)
 Compute the response functions for a 3PLM.
void likelihood (gsl_matrix_int *patterns, gsl_matrix *probs, gsl_matrix *like)
 Compute the likelihood of each patterns.
void likelihood_mc (gsl_matrix_int *patterns, gsl_matrix *probs, gsl_vector_int *nbr_options, gsl_vector_int *items_pos, gsl_matrix *like)
 Compute the likelihood of each multiple choice patterns.
void posteriors (gsl_matrix_int *patterns, gsl_matrix *probs, gsl_vector *quad_weights, gsl_matrix *post)
 Compute the posteriori probabilities.
void posteriors_mc (gsl_matrix_int *patterns, gsl_matrix *probs, gsl_vector_int *nbr_options, gsl_vector_int *items_pos, gsl_vector *quad_weights, gsl_matrix *post)
 Compute the posteriori probabilities for multiple choice patterns.
void frequencies (gsl_matrix_int *patterns, gsl_vector *counts, gsl_matrix *post, gsl_matrix *probs, gsl_vector *quad_sizes, gsl_matrix *quad_freqs)
 Compute the expected numbers of subjects.
int set_ignore (gsl_matrix_int *patterns, gsl_matrix *probs, gsl_vector *thresholds, gsl_vector_int *ignore)
 Check for degenerate items.
void constrain_probs (gsl_matrix *probs, double eps)
 Reset the probabilities to be inside the open interval (0,1).
void patterns_expand (gsl_matrix_int *patterns_mc, gsl_vector_int *items_nbr, gsl_matrix_int *patterns, gsl_vector_int *items_pos)
 Transform a matrix with multiple choice items into a matrix with binary items by creating a new "item"for each option.
int mle_abilities_3plm (int max_iter, double prec, gsl_matrix_int *patterns, gsl_vector *slopes, gsl_vector *thresholds, gsl_vector *asymptotes, gsl_vector *abilities, gsl_vector *abilities_stddev)
 Estimate the abilities by maximum likelihood.
void eap_abilities (gsl_matrix *post, gsl_vector *quad_points, gsl_vector *quad_weights, gsl_vector *abilities, gsl_vector *abilities_stddev)
 Estimate the abilities by Bayes exact a posteriori.
int em_bme_3plm (int nbr_par, int max_em_iter, int max_nr_iter, double prec, gsl_matrix_int *patterns, gsl_vector *counts, gsl_vector *quad_points, gsl_vector *quad_weights, int slope_prior, double slope_mean, double slope_dev, int thresh_prior, double thresh_mean, double thresh_dev, int asymp_prior, double asymp_mean, double asymp_weight, gsl_vector *slopes, gsl_vector *thresholds, gsl_vector *asymptotes, gsl_vector *slopes_stddev, gsl_vector *thresh_stddev, gsl_vector *asymp_stddev, gsl_vector_int *ignore, int *nbr_notconverge, gsl_vector_int *notconverge, int adjust_weights)
 Estimate the parameters of a 2PLM or 3PLM by MMLE or more generally (if a prior is used) by BME.
int em_mple_wave (int max_em_iter, int max_nr_iter, double prec, double smooth_factor, gsl_matrix_int *patterns, gsl_vector *counts, gsl_vector *quad_points, gsl_vector *quad_weights, gsl_matrix *probs, gsl_matrix *probs_stddev, gsl_vector_int *ignore, int *nbr_notconverge, gsl_vector_int *notconverge, int adjust_weights)
 Estimate the response functions by PMMLE (Penalized Maximum Marginal Likelihood).
void nadaraya_watson (double bandwidth, gsl_matrix_int *patterns, gsl_vector *quad_points, gsl_vector *quad_weights, gsl_matrix *probs, gsl_matrix *probs_stddev)
 Estimate the response functions by Nadaraya-Watson kernel smoothing (Testgraf).
void logits_from_probs (gsl_matrix *probs, gsl_matrix *logits)
 Compute the logit from the options characteristic curves.
void probs_from_logits (gsl_matrix *logits, gsl_matrix *probs)
 Compute the options characteristic curves from the logits.
int em_mple_wave_mc (int max_em_iter, int max_nr_iter, double prec, double smooth_factor, gsl_matrix_int *patterns, gsl_vector *counts, gsl_vector *quad_points, gsl_vector *quad_weights, gsl_vector_int *items_pos, gsl_vector_int *items_nbr, gsl_matrix *probs, gsl_matrix *probs_stddev, gsl_vector_int *ignore, int *nbr_notconverge, gsl_vector_int *notconverge, int adjust_weights)
 Estimate the options response functions by PMMLE (Penalized Maximum Marginal Likelihood).
int set_ignore_mc (gsl_matrix_int *patterns, gsl_vector_int *nbr_options, gsl_vector_int *items_pos, gsl_matrix *probs, gsl_vector *thresholds, gsl_vector_int *ignore)
 Check for degenerate multiple choice items.
void nadaraya_watson_mc (double bandwidth, gsl_matrix_int *patterns, gsl_vector_int *items_pos, gsl_vector_int *nbr_options, gsl_vector *options_weights, gsl_vector *quad_points, gsl_vector *quad_weights, gsl_matrix *probs, gsl_matrix *probs_stddev)
 Estimate the response functions by Nadaraya-Watson kernel smoothing (Testgraf).
void probs_2plm_mc (gsl_vector *slopes, gsl_vector *thresholds, gsl_vector_int *nbr_options, gsl_vector_int *items_pos, gsl_vector *quad_points, gsl_matrix *probs)
 Compute the response functions for a multivariate logistic model.
int mmle_2plm_mc (int max_em_iter, int max_nr_iter, double prec, gsl_matrix_int *patterns, gsl_vector *counts, gsl_vector *quad_points, gsl_vector *quad_weights, gsl_vector_int *items_pos, gsl_vector_int *nbr_options, gsl_vector *thresholds, gsl_vector *thresh_stddev, gsl_vector *slopes, gsl_vector *slopes_stddev, gsl_vector_int *ignore, int *nbr_notconverge, gsl_vector_int *notconverge, int adjust_weights)
 Estimate the options response functions by MMLE (Maximum Marginal Likelihood).
void probs_2plm_grad (gsl_vector *slopes, gsl_vector *thresholds, gsl_vector_int *nbr_options, gsl_vector_int *items_pos, gsl_vector *quad_points, gsl_matrix *probs, gsl_matrix *bounds)
 Compute the response functions for a graded model.
int mmle_2plm_grad (int max_em_iter, int max_nr_iter, double prec, gsl_matrix_int *patterns, gsl_vector *counts, gsl_vector *quad_points, gsl_vector *quad_weights, gsl_vector_int *items_pos, gsl_vector_int *nbr_options, gsl_vector *thresholds, gsl_vector *thresh_stddev, gsl_vector *slopes, gsl_vector *slopes_stddev, gsl_vector_int *ignore, int *nbr_notconverge, gsl_vector_int *notconverge, int adjust_weights)
 Estimate the options response functions by MMLE (Maximum Marginal Likelihood).
void icc_from_probs (gsl_matrix *probs, gsl_matrix *probs_stddev, gsl_vector *options_weights, gsl_vector_int *nbr_options, gsl_vector_int *items_pos, gsl_matrix *iccs, gsl_matrix *iccs_stddev)
 Compute the items' characteristic curves from the options' characteristic curves.
void info_from_probs (gsl_matrix *probs, gsl_vector *quad_points, gsl_matrix *infos, gsl_vector *test_info)
 Compute the items' information curves from the response functions.
void info_from_probs_mc (gsl_matrix *probs, gsl_vector *quad_points, gsl_vector_int *nbr_options, gsl_vector_int *items_pos, gsl_matrix *options_infos, gsl_matrix *infos, gsl_vector *test_info)
 Compute the options' information curves from the response functions for a multivariate model.
void llk_ratio_fit_test (gsl_vector *quad_sizes, gsl_matrix *quad_freqs, gsl_vector *quad_weights, gsl_matrix *probs, int nbr_inter, gsl_vector *chi2, gsl_vector_int *df, gsl_vector *p_value)
 Compute the log likelihood ratio statistics of each items.
void llk_ratio_fit_test_mc (gsl_vector *quad_sizes, gsl_matrix *quad_freqs, gsl_vector *quad_weights, gsl_matrix *probs, gsl_vector_int *nbr_options, gsl_vector_int *items_pos, int nbr_inter, gsl_vector *chi2, gsl_vector_int *df, gsl_vector *p_value)
 Compute the log likelihood ratio statistics of each multiple choice items.
void classical_statistics (gsl_matrix_int *patterns, gsl_vector *items_mean, gsl_vector *items_sd, gsl_vector *items_corr, gsl_vector *items_bis_corr, gsl_vector_int *items_nbr, gsl_vector *subjects_mean, gsl_vector_int *subjects_nbr, int *nbr, double *mean, double *sd, double *alpha, gsl_matrix *pairs_corr)
 Compute the classical test theory statistics.
void classical_statistics_mc (gsl_matrix_int *patterns, gsl_vector *options_weights, gsl_vector_int *items_pos, gsl_vector_int *nbr_options, gsl_vector *items_mean, gsl_vector *items_sd, gsl_vector *items_corr, gsl_vector *items_poly_corr, gsl_vector_int *items_nbr, gsl_vector *subjects_score, gsl_vector_int *subjects_nbr, int *nbr, double *mean, double *sd, double *alpha, gsl_matrix *pairs_corr)
 Compute the classical test theory statistics.
void llk_ratio_ld_test (gsl_matrix_int *patterns, gsl_matrix *probs, gsl_vector *quad_weights, gsl_matrix *chi2, gsl_matrix_int *df, gsl_matrix *p_value)
 Compute the log likelihood ratio statistics of each items pairs for local dependance.
void llk_ratio_ld_test_mc (gsl_matrix_int *patterns, gsl_matrix *probs, gsl_vector *quad_weights, gsl_vector_int *nbr_options, gsl_vector_int *items_pos, gsl_matrix *chi2, gsl_matrix_int *df, gsl_matrix *p_value)
 Compute the log likelihood ratio statistics of each multiple choice items pairs for local dependance.
void adjust_quad_weights (double nbr_subject, gsl_vector *quad_sizes, gsl_vector *quad_points, gsl_vector *quad_weights)
 Recompute the quadrature weights based on the observations.
int wmle_abilities (int max_iter, double prec, gsl_matrix *like, gsl_vector *info, gsl_vector *quad_points, gsl_vector *abilities, gsl_vector *abilities_stddev)
 Compute the WMLE of the abilities.
double polyserial_factor (gsl_vector_int *patterns, int nbr_option, int offset, gsl_vector *options_weights)
 Compute the polyserial correlation factor to be multiplied to the point-biserial (pearson) correlation.

Variables

const char * libirt_version
 The version of the library.
int libirt_verbose
 Control the verbosity level.

Detailed Description

The exported functions definition of the libirt library.

Author
Stephane Germain germs.nosp@m.te@g.nosp@m.mail..nosp@m.com

Macro Definition Documentation

#define LIBIRT_H   1

Define a flag if this header file is already included.

#define BLANK   -1

Define the representation of blank as integer.

#define FALSE   0

Define the representation of false as integer.

#define TRUE   1

Define the representation of true as integer.

#define VERY_SMALL_PROB   ((double)1.0e-10)

Define the smallest probability allowed.

#define VERY_SMALL_FREQ   ((double)1.0e-3)

Define the smallest frequency allowed.

#define VERY_BIG_LOGIT   ((double)23.0)

Define the biggest logit allowed in absolute value.

#define MAX_POLYCOR   ((double)0.9999)

Define the biggest absolute polyserial correlation allowed.

Function Documentation

int read_bin_patterns_delimited ( FILE *  file,
int  nbr_item,
int  nbr_subject,
int  skip,
char  delimiter,
int  offset,
int  extra,
char *  true_string,
char *  false_string,
char *  blank_string,
int  trimming,
gsl_matrix_int **  patterns 
)

Read binary patterns from a file in delimited format.

Parameters
[in]fileA open file descriptor with a rewind capability (not stdin).
[in]nbr_itemThe number of item to read or 0 for autodetection.
[in]nbr_subjectThe number of pattern to read or 0 for autodetection.
[in]skipThe number of line to skip at the start of the file.
[in]delimiterThe delimiter to use.
[in]offsetThe number of field to skip at the start of each line.
[in]extraThe number of field between the items.
[in]true_stringThe string representing a success.
[in]false_stringThe string representing a failure. If NULL then anything not a success nor a non response will be assume to be a failure.
[in]blank_stringThe string representing a non response. If NULL then anything not a success nor a failure will be assume to be a non response. A empty field is always assumed to be a non response.
[in]trimmingEnable the trimming of spaces.
[out]patternsA matrix(patterns x items) of binary responses.
Returns
1 for success and 0 for failure.
Warning
This function allocate the memory for patterns.
int read_mc_patterns_delimited ( FILE *  file,
int  nbr_item,
int  nbr_subject,
int  skip,
char  delimiter,
int  offset,
int  extra,
int  trimming,
gsl_matrix_int **  patterns,
gsl_vector_int **  nbr_options 
)

Read multiple choice patterns from a file in delimited format.

The responses are assumed to be positive integer, anything else will be assumed to be a non response.

Parameters
[in]fileA open file descriptor with a rewind capability (not stdin).
[in]nbr_itemThe number of item to read or 0 for autodetection.
[in]nbr_subjectThe number of pattern to read or 0 for autodetection.
[in]skipThe number of line to skip at the start of the file.
[in]delimiterThe delimiter to use.
[in]offsetThe number of field to skip at the start of each line.
[in]extraThe number of field to ignore after each items.
[in]trimmingEnable the trimming of spaces.
[out]patternsA matrix(patterns x items) of mc responses.
[out]nbr_optionsA vector(items) with the number of option of each item in patterns (and probs).
Returns
1 for success and 0 for failure.
Warning
This function allocate the memory for patterns and nbr_options.
double logit ( double  p)

Compute the logit transformation.

Returns
The logit of p.
double logistic ( double  t)

Compute the logistic transformation.

Returns
The logistic of t.
double prob_3plm ( double  ability,
double  slope,
double  threshold,
double  asymptote 
)

Compute the 3 parameter logistic function.

Parameters
[in]ability
[in]slope
[in]threshold
[in]asymptote
Returns
The 3PLM evaluated at ability.
void quadrature ( int  nbr_quad,
double  from,
double  to,
gsl_vector *  quad_points,
gsl_vector *  quad_weights 
)

Generate the quadrature classes.

Parameters
[in]nbr_quadThe number of classes.
[in]fromThe starting value for the middle points of the classes.
[in]toThe ending value for the middle points of the classes.
[out]quad_pointsA vector(classes) with the middle points of each class.
[out]quad_weightsA vector(classes) with the normal weights of each class.
void patterns_counts ( gsl_matrix_int *  subjects,
gsl_vector_int **  index,
gsl_matrix_int **  patterns,
gsl_vector **  counts 
)

Group the identical patterns from subjects into patterns.

Parameters
[in]subjectsA matrix(subjects x items) of binary responses.
[out]patternsA matrix(patterns x items) with the uniques patterns.
[out]countsA vector(patterns) with the count of each pattern.
[out]indexA vector(subjects) with the new position of each subjects in patterns.
Warning
This function allocate the memory for patterns, counts and index
void probs_3plm ( gsl_vector *  slopes,
gsl_vector *  thresholds,
gsl_vector *  asymptotes,
gsl_vector *  quad_points,
gsl_matrix *  probs 
)

Compute the response functions for a 3PLM.

Parameters
[in]slopesA vector(items) with the slope parameters of each item.
[in]thresholdsA vector(items) with the threshold parameters of each item.
[in]asymptotesA vector(items) with the asymptote parameters of each item. Can be NULL for a 2PLM.
[in]quad_pointsA vector(classes) with the middle points of each quadrature class.
[out]probsA matrix(items x classes) with the response functions.
Warning
The memory for probs should be allocated before.
Todo:
Stddev of the probs
void likelihood ( gsl_matrix_int *  patterns,
gsl_matrix *  probs,
gsl_matrix *  like 
)

Compute the likelihood of each patterns.

Parameters
[in]patternsA matrix (patterns x items) of binary responses.
[in]probsA matrix(items x classes) with response functions.
[out]likeA matrix(patterns x classes) with the likelihood of each pattern in each quadrature class.
Warning
The memory for likel should be allocated before.
void likelihood_mc ( gsl_matrix_int *  patterns,
gsl_matrix *  probs,
gsl_vector_int *  nbr_options,
gsl_vector_int *  items_pos,
gsl_matrix *  like 
)

Compute the likelihood of each multiple choice patterns.

Parameters
[in]patternsA matrix (patterns x options) of binary responses.
[in]probsA matrix(options x classes) with response functions.
[in]nbr_optionsA vector(items) with the number of option of each items.
[in]items_posA vector(items) with the position of the first option of each item in patterns.
[out]likeA matrix(patterns x classes) with the likelihood of each pattern in each quadrature class.
Warning
The memory for likel should be allocated before.
void posteriors ( gsl_matrix_int *  patterns,
gsl_matrix *  probs,
gsl_vector *  quad_weights,
gsl_matrix *  post 
)

Compute the posteriori probabilities.

Parameters
[in]patternsA matrix (patterns x items) of binary responses.
[in]probsA matrix(items x classes) with response functions.
[in]quad_weightsA vector(classes) with the prior weights of each quadrature class.
[out]postA matrix(patterns x classes) with the probability that a pattern is in a quadrature class.
Warning
The memory for post should be allocated before.
void posteriors_mc ( gsl_matrix_int *  patterns,
gsl_matrix *  probs,
gsl_vector_int *  nbr_options,
gsl_vector_int *  items_pos,
gsl_vector *  quad_weights,
gsl_matrix *  post 
)

Compute the posteriori probabilities for multiple choice patterns.

Parameters
[in]patternsA matrix (patterns x options) of binary responses.
[in]probsA matrix(options x classes) with response functions.
[in]nbr_optionsA vector(items) with the number of option of each items.
[in]items_posA vector(items) with the position of the first option of each item in patterns.
[in]quad_weightsA vector(classes) with the prior weights of each quadrature class.
[out]postA matrix(patterns x classes) with the probability that a pattern is in a quadrature class.
Warning
The memory for post should be allocated before.
void frequencies ( gsl_matrix_int *  patterns,
gsl_vector *  counts,
gsl_matrix *  post,
gsl_matrix *  probs,
gsl_vector *  quad_sizes,
gsl_matrix *  quad_freqs 
)

Compute the expected numbers of subjects.

Parameters
[in]patternsA matrix (patterns x items) of binary responses.
[in]countsA vector(patterns) with the count of each pattern.
[in]postA matrix(patterns x classes) with the probability that a pattern is in a quadrature class.
[in]probsA matrix(items x classes) with response functions. Used to replace the missing data.
[out]quad_sizesA vector(classes) with the expected number of subjects in the class.
[out]quad_freqsA matrix(items x classes) with the expected number of subjects in the class having a success at the item.
Warning
The memory for quad_sizes and quad_freqs should be allocated before.
Todo:
Recomputing the quad_size for each item is unecessary.
int set_ignore ( gsl_matrix_int *  patterns,
gsl_matrix *  probs,
gsl_vector *  thresholds,
gsl_vector_int *  ignore 
)

Check for degenerate items.

For each items, check if it's almost either all success or all failures, and if so enable the ignore flag and set the prob accordingly.

Parameters
[in]patternsA matrix (patterns x items) of binary responses.
[out]probsA matrix (items x classes) of response functions.
[out]thresholdsA vector(items) with the threshold parameters of each item.
[out]ignoreA vector (items) of flag.
Returns
The number of items to ignore.
Warning
The memory for the outputs must be allocated before.
void constrain_probs ( gsl_matrix *  probs,
double  eps 
)

Reset the probabilities to be inside the open interval (0,1).

Parameters
[in,out]probsA matrix (items x classes) of response functions.
[in]epsThe minimal distance allowed from 0 or 1.
void patterns_expand ( gsl_matrix_int *  patterns_mc,
gsl_vector_int *  items_nbr,
gsl_matrix_int *  patterns,
gsl_vector_int *  items_pos 
)

Transform a matrix with multiple choice items into a matrix with binary items by creating a new "item"for each option.

Parameters
[in]patterns_mcA matrix(patterns x items) of multiple choice responses.
[in]nbr_optionsA vector(items) with the number of option of each items.
[out]patternsA matrix(patterns x options) of binary responses.
[out]items_posA vector(items) with the position of the first option of each item in patterns.
Warning
The memory for the outputs must be allocated before.
int mle_abilities_3plm ( int  max_iter,
double  prec,
gsl_matrix_int *  patterns,
gsl_vector *  slopes,
gsl_vector *  thresholds,
gsl_vector *  asymptotes,
gsl_vector *  abilities,
gsl_vector *  abilities_stddev 
)

Estimate the abilities by maximum likelihood.

Parameters
[in]max_iterThe maximum number of Newton iterations performed for each pattern.
[in]precThe desired precision of each parameter estimate.
[in]patternsA matrix(patterns x items) of binary responses.
[in]slopesA vector(items) with the slope parameters of each item.
[in]thresholdsA vector(items) with the threshold parameters of each item.
[in]asymptotesA vector(items) with the asymptote parameters of each item. Can be NULL for the 2PLM.
[in,out]abilitiesA vector(patterns) with the estimated abilities. They should be initialize first.
[out]abilities_stddevA vector(items) with the standard errors of the estimated abilities.
Returns
The number of pattern that did not converged.

detect the degenerates patterns.

void eap_abilities ( gsl_matrix *  post,
gsl_vector *  quad_points,
gsl_vector *  quad_weights,
gsl_vector *  abilities,
gsl_vector *  abilities_stddev 
)

Estimate the abilities by Bayes exact a posteriori.

Work also for expanded multiple choices patterns.

Parameters
[in]postA matrix(patterns x classes) with the probability that a pattern is in a quadrature class.
[in]quad_pointsA vector(classes) with the middle points of each quadrature class.
[in]quad_weightsA vector(classes) with the prior weights of each quadrature class.
[out]abilitiesA vector(patterns) with the estimated abilities.
[out]abilities_stddevA vector(items) with the standard errors of the estimated abilities.
Warning
The memory for abilities and abilities_stddev should be allocated before.
int em_bme_3plm ( int  nbr_par,
int  max_em_iter,
int  max_nr_iter,
double  prec,
gsl_matrix_int *  patterns,
gsl_vector *  counts,
gsl_vector *  quad_points,
gsl_vector *  quad_weights,
int  slope_prior,
double  slope_mean,
double  slope_dev,
int  thresh_prior,
double  thresh_mean,
double  thresh_dev,
int  asymp_prior,
double  asymp_mean,
double  asymp_weight,
gsl_vector *  slopes,
gsl_vector *  thresholds,
gsl_vector *  asymptotes,
gsl_vector *  slopes_stddev,
gsl_vector *  thresh_stddev,
gsl_vector *  asymp_stddev,
gsl_vector_int *  ignore,
int *  nbr_notconverge,
gsl_vector_int *  notconverge,
int  adjust_weights 
)

Estimate the parameters of a 2PLM or 3PLM by MMLE or more generally (if a prior is used) by BME.

Parameters
[in]nbr_parThe number of parameter (1, 2 or 3).
[in]max_em_iterThe maximum number of EM iterations. At least 20 iteration are made.
[in]max_nr_iterThe maximum number of Newton iterations performed for each item at each EM iteration.
[in]precThe relative change in the likelihood to stop the EM algorithm. This value divided by 10 is also the desired precision of each parameter estimate.
[in]patternsA matrix(patterns x items) of binary responses.
[in]countsA vector(patterns) with the count of each pattern. If NULL the counts are assumed to be all 1.
[in]quad_pointsA vector(classes) with the middle points of each quadrature class.
[in]quad_weightsA vector(classes) with the prior weights of each quadrature class.
[in]slope_priorControls whether to use a lognormal(slope_mean, slope_dev) prior on the slope.
[in]slope_meanThe mean of the lognormal prior on the slope.
[in]slope_devThe standard deviation of the lognormal prior on the slope.
[in]thresh_priorControls whether to use a normal(thresh_mean, thresh_dev) prior on the threshold
[in]thresh_meanThe mean of the normal prior on the threshold.
[in]thresh_devThe standard deviation of the normal prior on the threshold.
[in]asymp_priorControls whether to use a beta(asymp_mean, asymp_weight) prior on the asymptote
[in]asymp_meanThe mean of the beta prior on the asymptote. The alpha and beta parameter are alpha = mean * weight + 1 and beta = (1 - mean) * weight + 1).
[in]asymp_weightThe weight of the beta prior on the asymptote. The alpha and beta parameter are alpha = mean * weight + 1 and beta = (1 - mean) * weight + 1).
[in,out]slopesA vector(items) with the estimated slope parameters. They should be initialize first.
[out]slopes_stddevA vector(items) with the standard errors of the estimated slopes.
[in,out]thresholdsA vector(items) with the estimated threshold parameters. They should be initialize first.
[out]thresh_stddevA vector(items) with the standard errors of the estimated thresholds.
[in,out]asymptotesA vector(items) with the estimated asymptote parameters. They should be initialize first.
[out]asymp_stddevA vector(items) with the standard errors of the estimated asymptotes.
[in]ignoreA vector(items) of ignore flag.
[out]nbr_notconvergeThe number of items that didn't converged.
[out]notconvergeA vector(items) of flag set for the items that didn't converged.
[in]adjust_weightsControls whether adjust the quadrature weights after each iteration.
Returns
1 if the relative change in the maximum log likelihood was less than prec else 0.
Warning
The memory for the output parameters should be allocated before.
Todo:
Check for the biggest change in the EM iterations and add a stop criterion.
int em_mple_wave ( int  max_em_iter,
int  max_nr_iter,
double  prec,
double  smooth_factor,
gsl_matrix_int *  patterns,
gsl_vector *  counts,
gsl_vector *  quad_points,
gsl_vector *  quad_weights,
gsl_matrix *  probs,
gsl_matrix *  probs_stddev,
gsl_vector_int *  ignore,
int *  nbr_notconverge,
gsl_vector_int *  notconverge,
int  adjust_weights 
)

Estimate the response functions by PMMLE (Penalized Maximum Marginal Likelihood).

Parameters
[in]max_em_iterThe maximum number of EM iterations. At least 20 iteration are made.
[in]max_nr_iterThe maximum number of Newton iterations performed for each item at each EM iteration.
[in]precThe relative change in the likelihood to stop the EM algorithm. This value divided by 10 is also the desired precision of each parameter estimate.
[in]smooth_factorThe factor to the penality term.
[in]patternsA matrix(patterns x items) of binary responses.
[in]countsA vector(patterns) with the count of each pattern. If NULL the counts are assumed to be all 1.
[in]quad_pointsA vector(classes) with the middle points of each quadrature class.
[in]quad_weightsA vector(classes) with the prior weights of each quadrature class.
[in,out]probsA matrix(items x classes) with the estimated response functions. They should be initialize first.
[out]probs_stddevmatrix(items x classes) with the standard error of the logit response functions.
[in]ignoreA vector(items) of ignore flag.
[out]nbr_notconvergeThe number of items that didn't converged.
[out]notconvergeA vector(items) of flag set for the items that didn't converged.
[in]adjust_weightsControls whether adjust the quadrature weights after each iteration.
Returns
The number of item that did not converged at the last EM iteration.
Warning
The memory for the response functions should be allocated before.
Todo:
Compute more accurates wavelets derivatives
void nadaraya_watson ( double  bandwidth,
gsl_matrix_int *  patterns,
gsl_vector *  quad_points,
gsl_vector *  quad_weights,
gsl_matrix *  probs,
gsl_matrix *  probs_stddev 
)

Estimate the response functions by Nadaraya-Watson kernel smoothing (Testgraf).

Parameters
[in]bandwidthThe smoothing parameter, will be multiply by the number of distinct scores to the power of -0.2 to give the bandwidth.
[in]patternsA matrix(patterns x items).
[in]quad_pointsA vector(classes) with the middle points of each quadrature class.
[in]quad_weightsA vector(classes) with the prior weights of each quadrature class.
[out]probsA matrix(items x classes) with the estimated response functions. They should be initialize first.
[out]probs_stddevmatrix(items x classes) with the standard error of the logit response functions.
Warning
Do not group the patterns before.
The memory for the response functions should be allocated before.
void logits_from_probs ( gsl_matrix *  probs,
gsl_matrix *  logits 
)

Compute the logit from the options characteristic curves.

Parameters
[in]probsA matrix(options x classes).
[out]logitsA matrix(logits x classes).
void probs_from_logits ( gsl_matrix *  logits,
gsl_matrix *  probs 
)

Compute the options characteristic curves from the logits.

Parameters
[in]logitsA matrix(logits x classes).
[out]probsA matrix(options x classes).
int em_mple_wave_mc ( int  max_em_iter,
int  max_nr_iter,
double  prec,
double  smooth_factor,
gsl_matrix_int *  patterns,
gsl_vector *  counts,
gsl_vector *  quad_points,
gsl_vector *  quad_weights,
gsl_vector_int *  items_pos,
gsl_vector_int *  nbr_options,
gsl_matrix *  probs,
gsl_matrix *  probs_stddev,
gsl_vector_int *  ignore,
int *  nbr_notconverge,
gsl_vector_int *  notconverge,
int  adjust_weights 
)

Estimate the options response functions by PMMLE (Penalized Maximum Marginal Likelihood).

Parameters
[in]max_em_iterThe maximum number of EM iterations. At least 20 iteration are made.
[in]max_nr_iterThe maximum number of Newton iterations performed for each item at each EM iteration.
[in]precThe relative change in the likelihood to stop the EM algorithm. This value divided by 10 is also the desired precision of each parameter estimate.
[in]smooth_factorThe factor to the penality term.
[in]patternsA matrix(patterns x options) of binary responses.
[in]countsA vector(patterns) with the count of each pattern. If NULL the counts are assumed to be all 1.
[in]quad_pointsA vector(classes) with the middle points of each quadrature class.
[in]quad_weightsA vector(classes) with the prior weights of each quadrature class.
[in]items_posA vector(items) with the position of the first option of each item in patterns (and probs).
[in]nbr_optionsA vector(items) with the number of option of each item in patterns (and probs).
[in,out]probsA matrix(options x classes) with the estimated response functions. They should be initialize first.
[out]probs_stddevmatrix(items x classes) with the standard error of the logit response functions.
[in]ignoreA vector(items) of ignore flag.
[out]nbr_notconvergeThe number of items that didn't converged.
[out]notconvergeA vector(items) of flag set for the items that didn't converged.
[in]adjust_weightsControls whether adjust the quadrature weights after each iteration.
Returns
1 if the relative change in the maximum log likelihood was less than prec else 0.
Warning
The memory for the outputs should be allocated before.
Todo:
Compute more accurates wavelets derivatives
int set_ignore_mc ( gsl_matrix_int *  patterns,
gsl_vector_int *  nbr_options,
gsl_vector_int *  items_pos,
gsl_matrix *  probs,
gsl_vector *  thresholds,
gsl_vector_int *  ignore 
)

Check for degenerate multiple choice items.

For each items, check if a option is all success, and if so enable the ignore flag and set the prob accordingly.

Parameters
[in]patternsA matrix (patterns x options) of binary responses.
[in]nbr_optionsA vector(items) with the number of option of each items.
[in]items_posA vector(items) with the position of the first option of each item in patterns.
[out]probsA matrix (options x classes) of option response functions.
[out]thresholdsA vector(options) with the threshold parameters of each logit.
[out]ignoreA vector (items) of flag.
Returns
The number of items to ignore.
Warning
The memory for the outputs must be allocated before.
void nadaraya_watson_mc ( double  bandwidth,
gsl_matrix_int *  patterns,
gsl_vector_int *  items_pos,
gsl_vector_int *  nbr_options,
gsl_vector *  options_weights,
gsl_vector *  quad_points,
gsl_vector *  quad_weights,
gsl_matrix *  probs,
gsl_matrix *  probs_stddev 
)

Estimate the response functions by Nadaraya-Watson kernel smoothing (Testgraf).

Parameters
[in]bandwidthThe smoothing parameter, will be multiply by the number of distinct scores to the power of -0.2 to give the bandwidth.
[in]patternsA matrix(patterns x options) of binary response.
[in]items_posA vector(items) with the position of the first option of each item in patterns (and probs).
[in]nbr_optionsA vector(items) with the number of option of each item in patterns (and probs).
[in]options_weightsA vector(options) of weights to compute the score.
[in]quad_pointsA vector(classes) with the middle points of each quadrature class.
[in]quad_weightsA vector(classes) with the prior weights of each quadrature class.
[out]probsA matrix(options x classes) with the estimated response functions.
[out]probs_stddevmatrix(options x classes) with the standard error.
Warning
Do not group the patterns before.
The memory for the response functions should be allocated before.
void probs_2plm_mc ( gsl_vector *  slopes,
gsl_vector *  thresholds,
gsl_vector_int *  nbr_options,
gsl_vector_int *  items_pos,
gsl_vector *  quad_points,
gsl_matrix *  probs 
)

Compute the response functions for a multivariate logistic model.

Parameters
[in]slopesA vector(options) with the slope parameters of each option.
[in]thresholdsA vector(options) with the threshold parameters of each option.
[in]nbr_optionsA vector(items) with the number of option of each items.
[in]items_posA vector(items) with the position of the first option of each item in patterns.
[in]quad_pointsA vector(classes) with the middle points of each quadrature class.
[out]probsA matrix(options x classes) with the response functions.
Todo:
Stddev of the probs
Warning
The memory for probs should be allocated before.
int mmle_2plm_mc ( int  max_em_iter,
int  max_nr_iter,
double  prec,
gsl_matrix_int *  patterns,
gsl_vector *  counts,
gsl_vector *  quad_points,
gsl_vector *  quad_weights,
gsl_vector_int *  items_pos,
gsl_vector_int *  nbr_options,
gsl_vector *  thresholds,
gsl_vector *  thresh_stddev,
gsl_vector *  slopes,
gsl_vector *  slopes_stddev,
gsl_vector_int *  ignore,
int *  nbr_notconverge,
gsl_vector_int *  notconverge,
int  adjust_weights 
)

Estimate the options response functions by MMLE (Maximum Marginal Likelihood).

Parameters
[in]max_em_iterThe maximum number of EM iterations. At least 20 iteration are made.
[in]max_nr_iterThe maximum number of Newton iterations performed for each item at each EM iteration.
[in]precThe relative change in the likelihood to stop the EM algorithm. This value divided by 10 is also the desired precision of each parameter estimate.
[in]patternsA matrix(patterns x options) of binary responses.
[in]countsA vector(patterns) with the count of each pattern. If NULL the counts are assumed to be all 1.
[in]quad_pointsA vector(classes) with the middle points of each quadrature class.
[in]quad_weightsA vector(classes) with the prior weights of each quadrature class.
[in]items_posA vector(items) with the position of the first option of each item in patterns (and probs).
[in]nbr_optionsA vector(items) with the number of option of each item in patterns (and probs).
[in,out]thresholdsA vector(options) with the estimated thresholds. They should be initialize first.
[out]thresh_stddevA vector(options) with the estimated thresholds standard deviation.
[in,out]slopesA vector(options) with the estimated slopes. They should be initialize first.
[out]slopes_stddevA vector(options) with the estimated slopes standard deviation.
[in]ignoreA vector(items) of ignore flag.
[out]nbr_notconvergeThe number of items that didn't converged.
[out]notconvergeA vector(items) of flag set for the items that didn't converged.
[in]adjust_weightsControls whether adjust the quadrature weights after each iteration.
Returns
1 if the relative change in the maximum log likelihood was less than prec else 0.
Warning
The memory for the outputs should be allocated before.
void probs_2plm_grad ( gsl_vector *  slopes,
gsl_vector *  thresholds,
gsl_vector_int *  nbr_options,
gsl_vector_int *  items_pos,
gsl_vector *  quad_points,
gsl_matrix *  probs,
gsl_matrix *  bounds 
)

Compute the response functions for a graded model.

Parameters
[in]slopesA vector(items) with the slope parameters of each item.
[in]thresholdsA vector(options) with the "modal" threshold parameters of each option.
[in]nbr_optionsA vector(items) with the number of option of each items. Optional, assumed there is only one item.
[in]items_posA vector(items) with the position of the first option of each item in patterns. Optional, assumed threre is only one item.
[in]quad_pointsA vector(classes) with the middle points of each quadrature class.
[out]probsA matrix(options x classes) with the response functions.
[out]boundsA matrix((options+items) x classes) with the boundary functions including the 0-th and last. Optional.
Todo:
Stddev of the probs
Warning
The memory for probs and bounds should be allocated before.
int mmle_2plm_grad ( int  max_em_iter,
int  max_nr_iter,
double  prec,
gsl_matrix_int *  patterns,
gsl_vector *  counts,
gsl_vector *  quad_points,
gsl_vector *  quad_weights,
gsl_vector_int *  items_pos,
gsl_vector_int *  nbr_options,
gsl_vector *  thresholds,
gsl_vector *  thresh_stddev,
gsl_vector *  slopes,
gsl_vector *  slopes_stddev,
gsl_vector_int *  ignore,
int *  nbr_notconverge,
gsl_vector_int *  notconverge,
int  adjust_weights 
)

Estimate the options response functions by MMLE (Maximum Marginal Likelihood).

Parameters
[in]max_em_iterThe maximum number of EM iterations. At least 20 iteration are made.
[in]max_nr_iterThe maximum number of Newton iterations performed for each item at each EM iteration.
[in]precThe relative change in the likelihood to stop the EM algorithm. This value divided by 10 is also the desired precision of each parameter estimate.
[in]patternsA matrix(patterns x options) of binary responses.
[in]countsA vector(patterns) with the count of each pattern. If NULL the counts are assumed to be all 1.
[in]quad_pointsA vector(classes) with the middle points of each quadrature class.
[in]quad_weightsA vector(classes) with the prior weights of each quadrature class.
[in]items_posA vector(items) with the position of the first option of each item in patterns (and probs).
[in]nbr_optionsA vector(items) with the number of option of each item in patterns (and probs).
[in,out]thresholdsA vector(options) with the estimated "modal" thresholds. They should be initialize first.
[out]thresh_stddevA vector(options) with the estimated thresholds standard deviation.
[in,out]slopesA vector(items) with the estimated slopes. They should be initialize first.
[out]slopes_stddevA vector(items) with the estimated slopes standard deviation.
[in]ignoreA vector(items) of ignore flag.
[out]nbr_notconvergeThe number of items that didn't converged.
[out]notconvergeA vector(items) of flag set for the items that didn't converged.
[in]adjust_weightsControls whether adjust the quadrature weights after each iteration.
Returns
1 if the relative change in the maximum log likelihood was less than prec else 0.
Warning
The memory for the outputs should be allocated before.
void icc_from_probs ( gsl_matrix *  probs,
gsl_matrix *  probs_stddev,
gsl_vector *  options_weights,
gsl_vector_int *  nbr_options,
gsl_vector_int *  items_pos,
gsl_matrix *  iccs,
gsl_matrix *  iccs_stddev 
)

Compute the items' characteristic curves from the options' characteristic curves.

Parameters
[in]probsA matrix (options x classes) of options' characteristic curves.
[in]probs_stddevA matrix (options x classes) of occ standard error.
[in]options_weightsA vector (options) of options' weights.
[in]nbr_optionsA vector(items) with the number of option of each items.
[in]items_posA vector(items) with the position of the first option of each item.
[out]iccsA matrix (items+1 x classes) of items' characteristic curves and the test characteristic curve.
[out]iccs_stddevA matrix (items+1 x classes) of icc standard error.
Warning
The memory for the outputs must be allocated before.
void info_from_probs ( gsl_matrix *  probs,
gsl_vector *  quad_points,
gsl_matrix *  infos,
gsl_vector *  test_info 
)

Compute the items' information curves from the response functions.

Parameters
[in]probsA matrix (items x classes) of response functions.
[in]quad_pointsA vector(classes) with the middle points of each class.
[out]infosA matrix (items x classes) of items' information curves.
[out]test_infoA vector (classes) with test information curve.
Warning
The memory for the outputs must be allocated before.
void info_from_probs_mc ( gsl_matrix *  probs,
gsl_vector *  quad_points,
gsl_vector_int *  nbr_options,
gsl_vector_int *  items_pos,
gsl_matrix *  options_infos,
gsl_matrix *  infos,
gsl_vector *  test_info 
)

Compute the options' information curves from the response functions for a multivariate model.

Parameters
[in]probsA matrix (options x classes) of response functions.
[in]quad_pointsA vector(classes) with the middle points of each class.
[in]nbr_optionsA vector(items) with the number of option of each items.
[in]items_posA vector(items) with the position of the first option of each item.
[out]options_infosA matrix (options x classes) of options' information curves.
[out]infosA matrix (items x classes) of items' information curves.
[out]test_infoA vector (classes) with test information curve.
Warning
The memory for the outputs must be allocated before.
void llk_ratio_fit_test ( gsl_vector *  quad_sizes,
gsl_matrix *  quad_freqs,
gsl_vector *  quad_weights,
gsl_matrix *  probs,
int  nbr_inter,
gsl_vector *  chi2,
gsl_vector_int *  df,
gsl_vector *  p_value 
)

Compute the log likelihood ratio statistics of each items.

Parameters
[in]quad_sizesA vector(classes) with the expected number of subjects in each class.
[in]quad_freqsA matrix(items x classes) with the expected number of subjects in the class having a success at the item.
[in]quad_weightsA vector(classes) with the normal weights of each class.
[in]probsA matrix(items x classes) with response functions.
[in]nbr_interThe number of intervals to use.
[out]chi2A vector(items+1) with the statistics of each items and for the overall fit.
[out]dfA vector(items+1) with the degrees of freedom.
[out]p_valueA vector(items+1) with the p-values.
Warning
The memory for the outputs should be allocated before.
void llk_ratio_fit_test_mc ( gsl_vector *  quad_sizes,
gsl_matrix *  quad_freqs,
gsl_vector *  quad_weights,
gsl_matrix *  probs,
gsl_vector_int *  nbr_options,
gsl_vector_int *  items_pos,
int  nbr_inter,
gsl_vector *  chi2,
gsl_vector_int *  df,
gsl_vector *  p_value 
)

Compute the log likelihood ratio statistics of each multiple choice items.

Parameters
[in]quad_sizesA vector(classes) with the expected number of subjects in each class.
[in]quad_freqsA matrix(options x classes) with the expected number of subjects in the class having a success at the option.
[in]quad_weightsA vector(classes) with the normal weights of each class.
[in]probsA matrix(options x classes) with response functions.
[in]nbr_optionsA vector(items) with the number of option of each items.
[in]items_posA vector(items) with the position of the first option of each item.
[in]nbr_interThe number of intervals to use.
[out]chi2A vector(items+1) with the statistics of each items and for the overall fit.
[out]dfA vector(items+1) with the degrees of freedom.
[out]p_valueA vector(items+1) with the p-values.
Warning
The memory for the outputs should be allocated before.
void classical_statistics ( gsl_matrix_int *  patterns,
gsl_vector *  items_mean,
gsl_vector *  items_sd,
gsl_vector *  items_corr,
gsl_vector *  items_bis_corr,
gsl_vector_int *  items_nbr,
gsl_vector *  subjects_score,
gsl_vector_int *  subjects_nbr,
int *  nbr,
double *  mean,
double *  sd,
double *  alpha,
gsl_matrix *  pairs_corr 
)

Compute the classical test theory statistics.

Parameters
[in]patternsA matrix(subjects x items) with the binary patterns.
[out]items_meanA vector(items) with the means of each items.
[out]items_sdA vector(items) with the sd of each items.
[out]items_corrA vector(items) with the correlations between each items and the score of each subject without the item.
[out]items_bis_corrA vector(items) with the biserial correlations between each items and the score of each subject without the item.
[out]items_nbrA vector(items) with the number of non missing response for each items.
[out]subjects_scoreA vector(subjects) with the scores of each subjects.
[out]subjects_nbrA vector(subjects) with the number of non missing response of each subjects.
[out]nbrThe total number of non missing response.
[out]meanThe mean score.
[out]sdThe score sd.
[out]alphaThe fiability coefficient alpha.
[out]pairs_corrA matrix(items x items) of correlation for each pair of items
Warning
The memory for the outputs should be allocated before.
void classical_statistics_mc ( gsl_matrix_int *  patterns,
gsl_vector *  options_weights,
gsl_vector_int *  items_pos,
gsl_vector_int *  nbr_options,
gsl_vector *  items_mean,
gsl_vector *  items_sd,
gsl_vector *  items_corr,
gsl_vector *  items_poly_corr,
gsl_vector_int *  items_nbr,
gsl_vector *  subjects_score,
gsl_vector_int *  subjects_nbr,
int *  nbr,
double *  mean,
double *  sd,
double *  alpha,
gsl_matrix *  pairs_corr 
)

Compute the classical test theory statistics.

Parameters
[in]patternsA matrix(subjects x items) with the multiple choice patterns.
[in]options_weightsA vector(options) of weights to compute the score.
[in]items_posA vector(items) with the position of the first option of each item in patterns (and probs).
[in]nbr_optionsA vector(items) with the number of option of each item in patterns (and probs).
[out]items_meanA vector(items) with the means of each items.
[out]items_sdA vector(items) with the sd of each items.
[out]items_corrA vector(items) with the correlations between each items and the score of each subject without the item.
[out]items_poly_corrA vector(items) with the polyserial correlations between each items and the score of each subject without the item.
[out]items_nbrA vector(items) with the number of non missing response for each items.
[out]subjects_scoreA vector(subjects) with the scores of each subjects.
[out]subjects_nbrA vector(subjects) with the number of non missing response of each subjects.
[out]nbrThe total number of non missing response.
[out]meanThe mean score.
[out]sdThe score sd.
[out]alphaThe fiability coefficient alpha.
[out]pairs_corrA matrix(items x items) of correlation for each pair of items
Warning
The memory for the outputs should be allocated before.
void llk_ratio_ld_test ( gsl_matrix_int *  patterns,
gsl_matrix *  probs,
gsl_vector *  quad_weights,
gsl_matrix *  chi2,
gsl_matrix_int *  df,
gsl_matrix *  p_value 
)

Compute the log likelihood ratio statistics of each items pairs for local dependance.

Parameters
[in]patternsA matrix(subjects x items) with binary response.
[in]probsA matrix(items x classes) with response functions.
[in]quad_weightsA vector(classes) with the normal weights of each class.
[out]chi2A matrix(items x items) with the statistics of each items pairs.
[out]dfA vector(items x items) with the degrees of freedom.
[out]p_valueA matrix(items x items) with the p-values of each items pairs.
Warning
The memory for the outputs should be allocated before.
void llk_ratio_ld_test_mc ( gsl_matrix_int *  patterns,
gsl_matrix *  probs,
gsl_vector *  quad_weights,
gsl_vector_int *  nbr_options,
gsl_vector_int *  items_pos,
gsl_matrix *  chi2,
gsl_matrix_int *  df,
gsl_matrix *  p_value 
)

Compute the log likelihood ratio statistics of each multiple choice items pairs for local dependance.

Parameters
[in]patternsA matrix(subjects x items) with the responses.
[in]probsA matrix(options x classes) with response functions.
[in]nbr_optionsA vector(items) with the number of option of each items.
[in]items_posA vector(items) with the position of the first option of each item.
[in]quad_weightsA vector(classes) with the normal weights of each class.
[out]chi2A matrix(items x items) with the statistics of each items pairs.
[out]dfA vector(items x items) with the degrees of freedom.
[out]p_valueA matrix(items x items) with the p-values of each items pairs.
Warning
The memory for the outputs should be allocated before.
void adjust_quad_weights ( double  nbr_subject,
gsl_vector *  quad_sizes,
gsl_vector *  quad_points,
gsl_vector *  quad_weights 
)

Recompute the quadrature weights based on the observations.

Parameters
[in]nbr_subjectthe number of subjects.
[in]quad_sizesA vector(classes) with the expected number of subjects in the class.
[in,out]quad_pointsA vector(classes) with the middle points of each class.
[out]quad_weightsA vector(classes) with the prior weights of each quadrature class.
Warning
The memory for quad_weights should be allocated before.
int wmle_abilities ( int  max_iter,
double  prec,
gsl_matrix *  like,
gsl_vector *  info,
gsl_vector *  quad_points,
gsl_vector *  abilities,
gsl_vector *  abilities_stddev 
)

Compute the WMLE of the abilities.

Parameters
[in]max_iterThe maximum number of Newton iterations performed for each pattern.
[in]precThe desired precision of each parameter estimate.
[in]likeA matrix (patterns x classes) of likelihood functions.
[in]infoA vecor (classes) with the test information function.
[in]quad_pointsA vector(classes) with the middle points of each class.
[out]abilitiesA vector(patterns) with the estimated abilities.
[out]abilities_stddevA vector(items) with the standard errors of the estimated abilities.
Warning
The memory for abilities and abilities_stddev should be allocated before.
double polyserial_factor ( gsl_vector_int *  patterns,
int  nbr_option,
int  offset,
gsl_vector *  options_weights 
)

Compute the polyserial correlation factor to be multiplied to the point-biserial (pearson) correlation.

Parameters
[in]patternsA vector(subjects) with the responses.
[in]nbr_optionThe number of option..
[in]offsetThe value of the forst option.
[in]options_weightsThe weights of each option.

If there is no weights or the weights are not strictly increasing or there is only two options, then the biserial correlation factor is calculated (i.e. the response are corrected with the option having the biggest weight.

Returns
The polyserial correlation factor.

Variable Documentation

const char* libirt_version

The version of the library.

int libirt_verbose

Control the verbosity level.

By default it is 0 (silent).


SourceForge.net Logo Generated on Sun Jan 26 2014 15:27:27 for libirt by Doxygen. Valid HTML 4.01 Transitional