Functions to estimate the option response functions by Nadaraya-Watson. (Kernel smoothing, Testgraf).
More...
#include "libirt.h"
#include <stdio.h>
#include <math.h>
#include <gsl/gsl_errno.h>
#include <gsl/gsl_sort_vector_double.h>
#include <gsl/gsl_cdf.h>
#include <gsl/gsl_randist.h>
Functions |
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).
|
Detailed Description
Functions to estimate the option response functions by Nadaraya-Watson. (Kernel smoothing, Testgraf).
- Author
- Stephane Germain germs.nosp@m.te@g.nosp@m.mail..nosp@m.com
Function Documentation
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] | bandwidth | The smoothing parameter, will be multiply by the number of distinct scores to the power of -0.2 to give the bandwidth. |
[in] | patterns | A matrix(patterns x options) of binary response. |
[in] | items_pos | A vector(items) with the position of the first option of each item in patterns (and probs). |
[in] | nbr_options | A vector(items) with the number of option of each item in patterns (and probs). |
[in] | options_weights | A vector(options) of weights to compute the score. |
[in] | quad_points | A vector(classes) with the middle points of each quadrature class. |
[in] | quad_weights | A vector(classes) with the prior weights of each quadrature class. |
[out] | probs | A matrix(options x classes) with the estimated response functions. |
[out] | probs_stddev | matrix(options x classes) with the standard error. |
- Warning
- Do not group the patterns before.
-
The memory for the response functions should be allocated before.