NAG C Library Function Document nag_robust_m_regsn_param_var (g02hfc)

Size: px
Start display at page:

Download "NAG C Library Function Document nag_robust_m_regsn_param_var (g02hfc)"

Transcription

1 g02 Correlaton and Regresson Analyss g02hfc 1 Purpose NAG C Lbrary Functon Document nag_robust_m_regsn_param_var (g02hfc) nag_robust_m_regsn_param_var (g02hfc) calculates an estmate of the asymptotc varance-covarance matrx for the bounded nfluence regresson estmates (M-estmates). It s ntended for use wth nag_robust_m_regsn_user_fn (g02hdc). 2 Specfcaton vod nag_robust_m_regsn_param_var (Nag_OrderType order, double (*ps)(double t, Nag_Comm *comm), double (*psp)(double t, Nag_Comm *comm), Nag_RegType regtype, Nag_CovMatrxEst covmat_est, double sgma, Integer n, Integer m, const double x[], Integer pdx, const double rs[], const double wgt[], double cov[], Integer pdc, double comm_arr[], Nag_Comm *comm, NagError *fal) 3 Descrpton For a descrpton of bounded nfluence regresson see nag_robust_m_regsn_user_fn (g02hdc). Let be the regresson parameters and let C be the asymptotc varance-covarance matrx of ^. Then for Huber type regresson where 2 ¼ 1 þ m n C ¼ f H ðx T XÞ 1 ^ 2 ; f H ¼ 1 n m P n 2 ¼1 ðr =^Þ P 1 n 0 r ^ 2 2 P 1 n 0 n ¼1 ðr =^Þ 1 P n 0 2 n ¼1 ðr =^Þ ; 2 1 n P n ¼1 0 r ^ see Huber (1981) and Marazz (1987b). For Mallows and Schweppe type regressons, C s of the form where S 1 ¼ 1 n XT DX and S 2 ¼ 1 n XT PX. 2 ^ S 1 1 S n 2 S 1 1 ; D s a dagonal matrx such that the th element approxmates Eð 0 ðr =ðw ÞÞÞ n the Schweppe case and Eð 0 ðr =Þw Þ n the Mallows case. P s a dagonal matrx such that the th element approxmates Eð 2 ðr =ðw ÞÞw 2 Þ n the Schweppe case and Eð 2 ðr =Þw 2 Þ n the Mallows case. Two approxmatons are avalable n nag_robust_m_regsn_param_var (g02hfc): g02hfc.1

2 g02hfc NAG C Lbrary Manual 1. Average over the r Schweppe Mallows D ¼ 1 P n 0 r j n j¼1 ^w w D ¼ 1 P n 0 r n j¼1 j^ P ¼ 1 P n 2 r j n j¼1 ^w w 2 P ¼ 1 P n 2 r n j¼1 j^ 2. Replace expected value by observed Schweppe Mallows D ¼ 0 r w ^w D ¼ 0 r w ^ P ¼ 2 r w 2 P ^w ¼ 2 r w 2 ^ See Hampel et al. (1986) and Marazz (1987b). In all cases ^ s a robust estmate of. nag_robust_m_regsn_param_var (g02hfc) s based on routnes n ROBETH; see Marazz (1987b). 4 References Hampel F R, Ronchett E M, Rousseeuw P J and Stahel W A (1986) Robust Statstcs. The Approach Based on Influence Functons Wley Huber P J (1981) Robust Statstcs Wley Marazz A (1987b) Subroutnes for robust and bounded nfluence regresson n ROBETH Cah. Rech. Doc. IUMSP, No. 3 ROB 2 Insttut Unverstare de Médecne Socale et Préventve, Lausanne 5 Parameters 1: order Nag_OrderType Input On entry: the order parameter specfes the two-dmensonal storage scheme beng used,.e., rowmajor orderng or column-major orderng. C language defned storage s specfed by order ¼ Nag RowMajor. See Secton of the Essental Introducton for a more detaled explanaton of the use of ths parameter. Constrant: order ¼ Nag RowMajor or Nag ColMajor. 2: ps Functon ps must return the value of the functon for a gven value of ts argument. Its specfcaton s: w w 2 double ps (double t, Nag_Comm *comm) 1: t double Input On entry: the argument for whch ps must be evaluated. 2: comm NAG_Comm * Input/Output The NAG communcaton parameter (see the Essental Introducton). 3: psp Functon psp must return the value of 0 ðtþ ¼ d dt Its specfcaton s: ðtþ for a gven value of ts argument. g02hfc.2

3 g02 Correlaton and Regresson Analyss g02hfc double psp (double t, Nag_Comm *comm) 1: t double Input On entry: the argument for whch psp must be evaluated. 2: comm NAG_Comm * Input/Output The NAG communcaton parameter (see the Essental Introducton). 4: regtype Nag_RegType Input On entry: the type of regresson for whch the asymptotc varance-covarance matrx s to be calculated. If regtype ¼ Nag HuberReg, Huber type regresson. If regtype ¼ Nag MallowsReg, Mallows type regresson. If regtype ¼ Nag SchweppeReg, Schweppe type regresson. 5: covmat_est Nag_CovMatrxEst Input On entry: fregtype 6¼ Nag HuberReg, covmat_est must specfy the approxmaton to be used. If covmat est ¼ Nag CovMatAve, averagng over resduals. If covmat est ¼ Nag CovMatObs, replacng expected by observed. If regtype ¼ Nag HuberReg, covmat_est s not referenced. 6: sgma double Input On entry: the value of ^, as gven by nag_robust_m_regsn_user_fn (g02hdc). Constrant: sgma > 0. 7: n Integer Input On entry: the number, n, of observatons. Constrant: n > 1. 8: m Integer Input On entry: the number, m, of ndependent varables. Constrant: 1 m < n. 9: x½dmš const double Input Note: the dmenson, dm, of the array x must be at least maxð1; pdx mþ when order ¼ Nag ColMajor and at least maxð1; pdx nþ when order ¼ Nag RowMajor. Where Xð; jþ appears n ths document, t refers to the array element f order ¼ Nag ColMajor, x½ðj 1Þpdx þ 1Š; f order ¼ Nag RowMajor, x½ð 1Þpdx þ j 1Š. On entry: the values of the X matrx,.e., the ndependent varables. Xð; jþ must contan the jth element of X, for ¼ 1; 2;...;n, j ¼ 1; 2;...;m. 10: pdx Integer Input On entry: the strde separatng matrx row or column elements (dependng on the value of order) n the array x. g02hfc.3

4 g02hfc NAG C Lbrary Manual Constrants: f order ¼ Nag ColMajor, pdx n; f order ¼ Nag RowMajor, pdx m. 11: rs½nš const double Input On entry: the resduals from the bounded nfluence regresson. These are gven by nag_robust_m_regsn_user_fn (g02hdc). 12: wgt½nš const double Input On entry: f regtype 6¼ Nag HuberReg, wgt must contan the vector of weghts used by the bounded nfluence regresson. These should be used wth nag_robust_m_regsn_user_fn (g02hdc). If regtype ¼ Nag HuberReg, wgt s not referenced. Constrant: fregtype 6¼ Nag HuberReg, wgt½š 0:0 for ¼ 0; 1;... 13: cov½dmš double Output Note: the dmenson, dm, of the array c must be at least pdc m. If order ¼ Nag ColMajor, the ð; jþth element of the matrx C s stored n cov½ðj 1Þpdc þ 1Š and f order ¼ Nag RowMajor, the ð; jþth element of the matrx C s stored n cov½ð 1Þpdc þ j 1Š. On ext: the estmate of the varance-covarance matrx. 14: pdc Integer Input On entry: the strde separatng matrx row or column elements (dependng on the value of order) n the array cov. Constrant: pdc m. 15: comm_arr½dmš double Output Note: the dmenson, dm, of the array comm_arr must be at least m ðnþmþ1þþ2n. On ext: f regtype 6¼ Nag HuberReg, comm arr½ 1Š, for ¼ 1; 2;...;n, wll contan the dagonal elements of the matrx D and comm arr½ 1Š, for ¼ n þ 1;nþ 2;...; 2n, wll contan the dagonal elements of matrx P. 16: comm NAG_Comm * Input/Output The NAG communcaton parameter (see the Essental Introducton). 17: fal NagError * Input/Output The NAG error parameter (see the Essental Introducton). 6 Error Indcators and Warnngs NE_INT On entry, n = hvalue. Constrant: n > 1. On entry, pdx ¼hvalue. Constrant: pdx > 0. On entry, pdc ¼hvalue. Constrant: pdc > 0. On entry, m ¼hvalue. Constrant: m 1. g02hfc.4

5 g02 Correlaton and Regresson Analyss g02hfc NE_INT_2 On entry, m = hvalue, n = hvalue. Constrant: 1 m < n. On entry, pdx ¼hvalue, n ¼hvalue. Constrant: pdx n. On entry, pdx ¼hvalue, m ¼hvalue. Constrant: pdx m. On entry, pdc ¼hvalue, m ¼hvalue. Constrant: pdc m. On entry, m ¼hvalue, pdc ¼hvalue. Constrant: pdc m. On entry, n m: n ¼hvalue, m ¼hvalue. NE_ENUM_INT On entry, regtype ¼hvalue, wgt ¼hvalue. Constrant: f regtype 6¼ Nag HuberReg, wgt½š 0:0 for ¼ 0;...;. NE_CORRECTION_FACTOR Correcton factor = 0 (Huber type regresson). NE_POS_DEF X T X matrx not postve defnte. NE_REAL On entry, sgma ¼hvalue. Constrant: sgma 0. NE_REAL_ARRAY_ELEM_CONS On entry, an element of wgt < 0. NE_SINGULAR S1 matrx s sngular or almost sngular. NE_ALLOC_FAIL Memory allocaton faled. NE_BAD_PARAM On entry, parameter hvalue had an llegal value. NE_INTERNAL_ERROR An nternal error has occurred n ths functon. Check the functon call and any array szes. If the call s correct then please consult NAG for assstance. 7 Accuracy In general, the accuracy of the varance-covarance matrx wll depend prmarly on the accuracy of the results from nag_robust_m_regsn_user_fn (g02hdc). g02hfc.5

6 g02hfc NAG C Lbrary Manual 8 Further Comments Ths routne s only for stuatons n whch X has full column rank. Care has to be taken n the choce of the functon snce f 0 ðtþ ¼0 for too wde a range then ether the value of f H wll not exst or too many values of D wll be zero and t wll not be possble to calculate C. 9 Example The asymptotc varance-covarance matrx s calculated for a Schweppe type regresson. The values of X, ^ and the resduals and weghts are read n. The averagng over resduals approxmaton s used. 9.1 Program Text /* nag_robust_m_regsn_param_var (g02hfc) Example Program. * * Copyrght 2002 Numercal Algorthms Group. * * Mark 7, */ #nclude <math.h> #nclude <stdo.h> #nclude <nag.h> #nclude <nag_stdlb.h> #nclude <nagg02.h> statc double ps(double t, Nag_Comm *comm); statc double psp(double t, Nag_Comm *comm); nt man(vod) /* Scalars */ double sgma; Integer ext_status,, c, x, j, k, m, n; Integer pdc, pdx; NagError fal; Nag_OrderType order; Nag_Comm comm; /* Arrays */ double *cov=0, *rs=0, *wgt=0, *comm_arr=0, *x=0; #fdef NAG_COLUMN_MAJOR #defne COV(I,J) cov[(j-1)*pdc + I - 1] #defne X(I,J) x[(j-1)*pdx + I - 1] order = Nag_ColMajor; #else #defne COV(I,J) cov[(i-1)*pdc + J - 1] #defne X(I,J) x[(i-1)*pdx + J - 1] order = Nag_RowMajor; #endf ext_status = 0; INIT_FAIL(fal); Vprntf("g02hfc Example Program Results\n"); /* Skp headng n data fle */ Vscanf("%*[^\n] "); /* Read n the dmensons of X */ Vscanf("%ld%ld%*[^\n] ", &n, &m); /* Allocate memory */ f (!(cov = NAG_ALLOC(m * m, double))!(rs = NAG_ALLOC(n, double))!(wgt = NAG_ALLOC(n, double))!(comm_arr = NAG_ALLOC(m*(n+m+1)+2*n, double)) g02hfc.6

7 g02 Correlaton and Regresson Analyss g02hfc!(x = NAG_ALLOC(n * m, double)) ) Vprntf("Allocaton falure\n"); ext_status = -1; goto END; #fdef NAG_COLUMN_MAJOR pdc = m; pdx = n; #else pdc = m; pdx = m; #endf Vprntf("\n"); /* Read n the X matrx */ for ( = 1; <= n; ++) for (j = 1; j <= m; ++j) Vscanf("%lf", &X(,j)); Vscanf("%*[^\n] "); /* Read n sgma */ Vscanf("%lf%*[^\n] ", &sgma); /* Read n weghts and resduals */ for ( = 1; <= n; ++) Vscanf("%lf%lf%*[^\n] ", &wgt[ - 1], &rs[ - 1]); /* Set other parameter values */ x = 5; c = 3; /* Set parameters for Schweppe type regresson */ g02hfc(order, ps, psp, Nag_SchweppeReg, Nag_CovMatAve, sgma, n, m, x, pdx, rs, wgt, cov, pdc, comm_arr, &comm, &fal); f (fal.code!= NE_NOERROR) Vprntf("Error from g02hfc.\n%s\n", fal.message); ext_status = 1; goto END; Vprntf("Covarance matrx\n"); for (j = 1; j <= m; ++j) for (k = 1; k <= m; ++k) Vprntf("%10.4f%s", COV(j,k), k%6 == 0 k == m?"\n":" "); END: f (cov) NAG_FREE(cov); f (rs) NAG_FREE(rs); f (wgt) NAG_FREE(wgt); f (comm_arr) NAG_FREE(comm_arr); f (x) NAG_FREE(x); return ext_status; statc double ps(double t, Nag_Comm *comm) g02hfc.7

8 g02hfc NAG C Lbrary Manual double ret_val; f (t <= -1.5) ret_val = -1.5; else f (fabs(t) < 1.5) ret_val = t; else ret_val = 1.5; return ret_val; statc double psp(double t, Nag_Comm *comm) double ret_val; ret_val = 0.0; f (fabs(t) < 1.5) ret_val = 1.0; return ret_val; 9.2 Program Data g02hfc Example Program Data 5 3 : N M : X1 X2 X : End of X1 X2 and X3 values : SIGMA : Weghts and resduals, WGT and RS : End of weghts and resduals 9.3 Program Results g02hfc Example Program Results Covarance matrx g02hfc.8 (last)

NAG Library Function Document nag_robust_m_regsn_param_var (g02hfc)

NAG Library Function Document nag_robust_m_regsn_param_var (g02hfc) g02 Correlato ad Regresso Aalyss 1 Purpose NAG Lbrary Fucto Documet ag_robust_m_regs_param_var () ag_robust_m_regs_param_var () calculates a estmate of the asymptotc varace-covarace matrx for the bouded

More information

NAG Library Function Document nag_kalman_sqrt_filt_info_var (g13ecc)

NAG Library Function Document nag_kalman_sqrt_filt_info_var (g13ecc) g13 Tme Seres Analyss g13ecc NAG Lbrary Functon Document nag_kalman_sqrt_flt_nfo_var (g13ecc) 1 Purpose nag_kalman_sqrt_flt_nfo_var (g13ecc) performs a combned measurement and tme update of one teraton

More information

NAG C Library Function Document nag_binary_factor_service (g11sbc)

NAG C Library Function Document nag_binary_factor_service (g11sbc) 1 Purpose NAG C Library Function Document nag_binary_factor_service () nag_binary_factor_service () is a service routine which may be used prior to calling nag_binary_factor (g11sac) to calculate the frequency

More information

NAG Library Function Document nag_robust_m_corr_user_fn_no_derr (g02hmc)

NAG Library Function Document nag_robust_m_corr_user_fn_no_derr (g02hmc) NAG Library Function Document nag_robust_m_corr_user_fn_no_derr () 1 Purpose nag_robust_m_corr_user_fn_no_derr () computes a robust estimate of the covariance matrix for user-supplied weight functions.

More information

NAG Library Function Document nag_robust_m_corr_user_fn (g02hlc)

NAG Library Function Document nag_robust_m_corr_user_fn (g02hlc) NAG Library Function Document nag_robust_m_corr_user_fn () Purpose nag_robust_m_corr_user_fn () calculates a robust estimate of the covariance matrix for usersupplied weight functions and their derivatives.

More information

NAG C Library Function Document nag_surviv_risk_sets (g12zac)

NAG C Library Function Document nag_surviv_risk_sets (g12zac) g12 Survival Analysis g12zac 1 Purpose NAG C Library Function Document nag_surviv_risk_sets (g12zac) nag_surviv_risk_sets (g12zac) creates the risk sets associated with the Cox proportional hazards model

More information

NAG Library Function Document nag_rgsn_matrix_multi_normal (g05lyc)

NAG Library Function Document nag_rgsn_matrix_multi_normal (g05lyc) 1 Purpose NAG Library Function Document nag_rgsn_matrix_multi_normal () nag_rgsn_matrix_multi_normal () sets up a reference vector and generates an array of pseudorandom numbers from a multivariate Normal

More information

NAG Library Function Document nag_rngs_copula_students_t (g05rbc)

NAG Library Function Document nag_rngs_copula_students_t (g05rbc) g05 Random Number Generators g05rbc 1 Purpose NAG Library Function Document nag_rngs_copula_students_t (g05rbc) nag_rngs_copula_students_t (g05rbc) sets up a reference vector and generates an array of

More information

NAG C Library Function Document nag_dgemv (f16pac)

NAG C Library Function Document nag_dgemv (f16pac) f16 NAG Interface to BLAS f16pac 1 Purpose NAG C Library Function Document nag_dgemv (f16pac) nag_dgemv (f16pac) performs matrix-vector multiplication for a real general matrix. 2 Specification #include

More information

NAG C Library Function Document nag_linf_fit (e02gcc)

NAG C Library Function Document nag_linf_fit (e02gcc) e02 Curve and Surface Fitting e02gcc 1 Purpose NAG C Library Function Document nag_linf_fit (e02gcc) nag_linf_fit (e02gcc) calculates an l 1 solution to an over-determined system of linear equations. 2

More information

NAG C Library Function Document nag_rank_regsn (g08rac)

NAG C Library Function Document nag_rank_regsn (g08rac) 1 Purpose NAG C Library Function Document nag_rank_regsn () nag_rank_regsn () calculates the parameter estimates, score statistics and their variance-covariance matrices for the linear model using a likelihood

More information

NAG C Library Function Document nag_rngs_varma_time_series (g05pcc)

NAG C Library Function Document nag_rngs_varma_time_series (g05pcc) g05 Random Number Generators g05pcc 1 Purpose NAG C Library Function Document nag_rngs_varma_time_series (g05pcc) nag_rngs_varma_time_series (g05pcc) generates a realisation of a multivariate time series

More information

NAG Library Function Document nag_all_regsn (g02eac)

NAG Library Function Document nag_all_regsn (g02eac) g02 Correlation and Regression Analysis g02eac 1 Purpose NAG Library Function Document nag_all_regsn (g02eac) nag_all_regsn (g02eac) calculates the residual sums of squares for all possible linear regressions

More information

NAG C Library Function Document nag_zgemv (f16sac)

NAG C Library Function Document nag_zgemv (f16sac) f16 NAG Interface to BLAS f16sac 1 Purpose NAG C Library Function Document nag_zgemv (f16sac) nag_zgemv (f16sac) performs matrix-vector multiplication for a complex general matrix. 2 Specification #include

More information

NAG C Library Function Document nag_cp_stat (g02ecc)

NAG C Library Function Document nag_cp_stat (g02ecc) g02 Correlation and Regression Analysis NAG C Library Function Document nag_cp_stat () 1 Purpose nag_cp_stat () calculates R 2 and C p -values from the residual sums of squares for a series of linear regression

More information

NAG Library Function Document nag_dgglse (f08zac)

NAG Library Function Document nag_dgglse (f08zac) 1 Purpose NAG Library Function Document nag_dgglse () nag_dgglse () solves a real linear equality-constrained least-squares problem. 2 Specification #include #include void nag_dgglse

More information

NAG C Library Function Document nag_zger (f16smc)

NAG C Library Function Document nag_zger (f16smc) f16 NAG Interface to BLAS f16smc 1 Purpose NAG C Library Function Document nag_zger (f16smc) nag_zger (f16smc) performs a rank-1 update on a complex general matrix. 2 Specification #include #include

More information

NAG Library Function Document nag_dger (f16pmc)

NAG Library Function Document nag_dger (f16pmc) f16 NAG Interface to BLAS f16pmc NAG Library Function Document nag_dger (f16pmc) 1 Purpose nag_dger (f16pmc) performs a rank-1 update on a real general matrix. 2 Specification #include #include

More information

NAG Library Function Document nag_bsm_price (s30aac)

NAG Library Function Document nag_bsm_price (s30aac) s Approximations of Special Functions s30aac NAG Library Function Document nag_bsm_price (s30aac) 1 Purpose nag_bsm_price (s30aac) computes the European option price given by the Black Scholes Merton formula.

More information

NAG Library Function Document nag_rand_copula_normal (g05rdc)

NAG Library Function Document nag_rand_copula_normal (g05rdc) NAG Library Function Document nag_rand_copula_normal () 1 Purpose nag_rand_copula_normal () sets up a reference vector and generates an array of pseudorandom numbers from a Normal (Gaussian) copula with

More information

NAG Library Function Document nag_rngs_varma_time_series (g05pcc)

NAG Library Function Document nag_rngs_varma_time_series (g05pcc) g05 Random Number Generators g05pcc 1 Purpose NAG Library Function Document nag_rngs_varma_time_series (g05pcc) nag_rngs_varma_time_series (g05pcc) generates a realization of a multivariate time series

More information

NAG Library Function Document nag_asian_geom_price (s30sac)

NAG Library Function Document nag_asian_geom_price (s30sac) s Approximations of Special Functions s30sac 1 Purpose NAG Library Function Document nag_asian_geom_price (s30sac) nag_asian_geom_price (s30sac) computes the Asian geometric continuous average-rate option

More information

NAG C Library Function Document nag_zhemv (f16scc)

NAG C Library Function Document nag_zhemv (f16scc) f16 NAG Interface to BLAS f16scc 1 Purpose NAG C Library Function Document nag_zhemv (f16scc) nag_zhemv (f16scc) performs matrix-vector multiplication for a complex Hermitian matrix. 2 Specification #include

More information

NAG Library Function Document nag_dgetrf (f07adc)

NAG Library Function Document nag_dgetrf (f07adc) f07 Linear Equations (LAPACK) f07adc NAG Library Function Document nag_dgetrf (f07adc) 1 Purpose nag_dgetrf (f07adc) computes the LU factorization of a real m by n matrix. 2 Specification #include

More information

NAG Library Function Document nag_rand_copula_clayton (g05rhc)

NAG Library Function Document nag_rand_copula_clayton (g05rhc) 1 Purpose NAG Library Function Document nag_rand_copula_clayton () nag_rand_copula_clayton () generates pseudorandom uniform variates with joint distribution of a Clayton/Cook Johnson Archimedean copula.

More information

NAG Library Function Document nag_dgetri (f07ajc)

NAG Library Function Document nag_dgetri (f07ajc) 1 Purpose NAG Library Function Document nag_dgetri () nag_dgetri () computes the inverse of a real matrix A, where A has been factorized by nag_dgetrf (f07adc). 2 Specification #include #include

More information

NAG Library Function Document nag_zgelsy (f08bnc)

NAG Library Function Document nag_zgelsy (f08bnc) NAG Library Function Document nag_zgelsy () 1 Purpose nag_zgelsy () computes the minimum norm solution to a complex linear least squares problem minkb Axk 2 x using a complete orthogonal factorization

More information

NAG C Library Function Document nag_dgbmv (f16pbc)

NAG C Library Function Document nag_dgbmv (f16pbc) f16 NAG Interface to BLAS f16pbc 1 Purpose NAG C Library Function Document nag_dgbmv (f16pbc) nag_dgbmv (f16pbc) performs matrix-vector multiplication for a real band matrix. 2 Specification #include

More information

NAG C Library Function Document nag_dsbmv (f16pdc)

NAG C Library Function Document nag_dsbmv (f16pdc) f16 NAG Interface to BLAS f16pdc 1 Purpose NAG C Library Function Document nag_dsbmv (f16pdc) nag_dsbmv (f16pdc) performs matrix-vector multiplication for a real symmetric band matrix. 2 Specification

More information

NAG C Library Function Document nag_dgbtrs (f07bec)

NAG C Library Function Document nag_dgbtrs (f07bec) f07 Linear Equations (LAPACK) f07bec 1 Purpose NAG C Library Function Document nag_dgbtrs (f07bec) nag_dgbtrs (f07bec) solves a real band system of linear equations with multiple right-hand sides, AX ¼

More information

NAG Library Function Document nag_real_gen_matrix_exp (f01ecc)

NAG Library Function Document nag_real_gen_matrix_exp (f01ecc) NAG Library Function Document nag_real_gen_matrix_exp () 1 Purpose nag_real_gen_matrix_exp () computes the matrix exponential, e A,ofarealn by n matrix A. 2 Specification #include #include

More information

NAG Library Function Document nag_dtrsyl (f08qhc)

NAG Library Function Document nag_dtrsyl (f08qhc) 1 Purpose NAG Library Function Document nag_dtrsyl () nag_dtrsyl () solves the real quasi-triangular Sylvester matrix equation. 2 Specification #include #include void nag_dtrsyl (Nag_OrderType

More information

NAG Library Function Document nag_dspr (f16pqc)

NAG Library Function Document nag_dspr (f16pqc) f16 NAG Interface to BLAS NAG Library Function Document nag_dspr () 1 Purpose nag_dspr () performs a rank-1 update on a real symmetric matrix stored in packed form. 2 Specification #include #include

More information

NAG Library Function Document nag_dgelsd (f08kcc)

NAG Library Function Document nag_dgelsd (f08kcc) NAG Library Function Document nag_dgelsd () 1 Purpose nag_dgelsd () computes the minimum norm solution to a real linear least squares problem 2 Specification minkb Axk 2 : x #include #include

More information

NAG Library Function Document nag_zsymv (f16tac)

NAG Library Function Document nag_zsymv (f16tac) NAG Library Function Document nag_zsymv () 1 Purpose nag_zsymv () performs matrix-vector multiplication for a complex symmetric matrix. 2 Specification #include #include void nag_zsymv

More information

NAG C Library Function Document nag_zsytri (f07nwc)

NAG C Library Function Document nag_zsytri (f07nwc) 1 Purpose NAG C Library Function Document nag_zsytri () nag_zsytri () computes the inverse of a complex symmetric matrix A, where A has been factorized by nag_zsytrf (f07nrc). 2 Specification void nag_zsytri

More information

NAG Library Function Document nag_dtrmv (f16pfc)

NAG Library Function Document nag_dtrmv (f16pfc) f16 NAG Interface to BLAS 1 Purpose NAG Library Function Document nag_dtrmv () nag_dtrmv () performs matrix-vector multiplication for a real triangular matrix. 2 Specification #include #include

More information

NAG Library Function Document nag_dtpttr (f01vcc)

NAG Library Function Document nag_dtpttr (f01vcc) NAG Library Function Document nag_dtpttr () 1 Purpose nag_dtpttr () unpacks a real triangular matrix, stored in a standard packed format array, to a full format array. 2 Specification #include

More information

NAG Library Function Document nag_zhfrk (f16zqc)

NAG Library Function Document nag_zhfrk (f16zqc) NAG Library Function Document nag_zhfrk () 1 Purpose nag_zhfrk () performs one of the Hermitian rank-k update operations C AA H þ C or C A H A þ C; where A is a complex matrix, C is an n by n complex Hermitian

More information

NAG Library Function Document nag_dgttrs (f07cec)

NAG Library Function Document nag_dgttrs (f07cec) NAG Library Function Document nag_dgttrs () Purpose nag_dgttrs () computes the solution to a real system of linear equations AX ¼ B or A T X ¼ B, where A is an n by n tridiagonal matrix and X and B are

More information

NAG C Library Function Document nag_zhpmv (f16sec)

NAG C Library Function Document nag_zhpmv (f16sec) f16 NAG Interface to BLAS f16sec 1 Purpose NAG C Library Function Document nag_zhpmv (f16sec) nag_zhpmv (f16sec) performs matrix-vector multiplication for a complex Hermitian matrix stored in packed form.

More information

NAG Library Function Document nag_zgelss (f08knc)

NAG Library Function Document nag_zgelss (f08knc) NAG Library Function Document nag_zgelss () 1 Purpose nag_zgelss () computes the minimum norm solution to a complex linear least squares problem minkb Axk 2 : 2 Specification x #include #include

More information

NAG Library Function Document nag_dtpsv (f16plc)

NAG Library Function Document nag_dtpsv (f16plc) NAG Library Function Document nag_dtpsv () 1 Purpose nag_dtpsv () solves a system of equations given as a real triangular matrix stored in packed form. 2 Specification #include #include

More information

NAG C Library Function Document nag_zhbmv (f16sdc)

NAG C Library Function Document nag_zhbmv (f16sdc) f16 NAG Interface to BLAS f16sdc 1 Purpose NAG C Library Function Document nag_zhbmv (f16sdc) nag_zhbmv (f16sdc) performs matrix-vector multiplication for a complex Hermitian band matrix. 2 Specification

More information

NAG C Library Function Document nag_tsa_multi_auto_corr_part (g13dbc)

NAG C Library Function Document nag_tsa_multi_auto_corr_part (g13dbc) g13 Time Series Analysis g13dbc 1 Purpose NAG C Library Function Document nag_tsa_multi_auto_corr_part (g13dbc) nag_tsa_multi_auto_corr_part (g13dbc) calculates the multivariate partial autocorrelation

More information

NAG Library Function Document nag_dtrttf (f01vec)

NAG Library Function Document nag_dtrttf (f01vec) f01 Matrix Factorizations f01vec NAG Library Function Document nag_dtrttf (f01vec) 1 Purpose nag_dtrttf (f01vec) copies a real triangular matrix, stored in a full format array, to a Rectangular Full Packed

More information

NAG Library Function Document nag_zhpev (f08gnc)

NAG Library Function Document nag_zhpev (f08gnc) f08 Least-squares and Eigenvalue Problems (LAPACK) NAG Library Function Document nag_zhpev () 1 Purpose nag_zhpev () computes all the eigenvalues and, optionally, all the eigenvectors of a complex n by

More information

NAG Library Function Document nag_durbin_watson_stat (g02fcc)

NAG Library Function Document nag_durbin_watson_stat (g02fcc) NAG Library Function Document nag_durbin_watson_stat () 1 Purpose nag_durbin_watson_stat () calculates the Durbin Watson statistic, for a set of residuals, and the upper and lower bounds for its significance.

More information

NAG Library Function Document nag_dstev (f08jac)

NAG Library Function Document nag_dstev (f08jac) f08 Least-squares and Eigenvalue Problems (LAPACK) f08jac NAG Library Function Document nag_dstev (f08jac) 1 Purpose nag_dstev (f08jac) computes all the eigenvalues and, optionally, all the eigenvectors

More information

NAG Library Function Document nag_full_step_regsn (g02efc)

NAG Library Function Document nag_full_step_regsn (g02efc) NAG Library Function Document nag_full_step_regsn () 1 Purpose nag_full_step_regsn () calculates a full stepwise selection from p variables by using Clarke's sweep algorithm on the correlation matrix of

More information

NAG Library Function Document nag_zero_nonlin_eqns_rcomm (c05qdc)

NAG Library Function Document nag_zero_nonlin_eqns_rcomm (c05qdc) c05 Roots of One or More Transcendental Equations c05qdc NAG Library Function Document nag_zero_nonlin_eqns_rcomm (c05qdc) 1 Purpose nag_zero_nonlin_eqns_rcomm (c05qdc) is a comprehensive reverse communication

More information

NAG Library Function Document nag_rand_bivariate_copula_frank (g05rfc)

NAG Library Function Document nag_rand_bivariate_copula_frank (g05rfc) 1 Purpose NAG Library Function Document nag_rand_bivariate_copula_frank () nag_rand_bivariate_copula_frank () generates pseudorandom uniform bivariates with joint distribution of a Frank Archimedean copula.

More information

NAG Library Function Document nag_4d_shep_eval (e01tlc)

NAG Library Function Document nag_4d_shep_eval (e01tlc) NAG Library Function Document nag_4d_shep_eval () 1 Purpose nag_4d_shep_eval () evaluates the four-dimensional interpolating function generated by nag_4d_shep_interp (e01tkc) and its first partial derivatives.

More information

NAG Library Function Document nag_dtr_load (f16qgc)

NAG Library Function Document nag_dtr_load (f16qgc) 1 Purpose NAG Library Function Document nag_dtr_load () nag_dtr_load () initializes a real triangular matrix. 2 Specification #include #include void nag_dtr_load (Nag_OrderType order,

More information

NAG Library Function Document nag_dspsv (f07pac)

NAG Library Function Document nag_dspsv (f07pac) NAG Library Function Document nag_dspsv () 1 Purpose nag_dspsv () computes the solution to a real system of linear equations AX ¼ B; where A is an n by n symmetric matrix stored in packed format and X

More information

NAG Library Function Document nag_1d_cheb_fit_constr (e02agc)

NAG Library Function Document nag_1d_cheb_fit_constr (e02agc) 1 Purpose NAG Library Function Document nag_1d_cheb_fit_constr () nag_1d_cheb_fit_constr () computes constrained weighted least-squares polynomial approximations in Chebyshev series form to an arbitrary

More information

NAG Library Function Document nag_real_sym_posdef_tridiag_lin_solve (f04bgc)

NAG Library Function Document nag_real_sym_posdef_tridiag_lin_solve (f04bgc) Purpose NAG Library Function Document nag_real_sym_posdef_tridiag_lin_solve () nag_real_sym_posdef_tridiag_lin_solve () computes the solution to a real system of linear equations AX ¼ B, where A is an

More information

NAG Library Function Document nag_opt_simplex_easy (e04cbc)

NAG Library Function Document nag_opt_simplex_easy (e04cbc) e04 Minimizing or Maximizing a Function NAG Library Function Document nag_opt_simplex_easy () 1 Purpose nag_opt_simplex_easy () minimizes a general function FðÞ x of n independent variables x ¼ ðx 1 ;x

More information

NAG Library Function Document nag_5d_shep_eval (e01tnc)

NAG Library Function Document nag_5d_shep_eval (e01tnc) NAG Library Function Document nag_5d_shep_eval () 1 Purpose nag_5d_shep_eval () evaluates the five-dimensional interpolating function generated by nag_5d_shep_interp (e01tmc) and its first partial derivatives.

More information

NAG Library Function Document nag_asian_geom_greeks (s30sbc)

NAG Library Function Document nag_asian_geom_greeks (s30sbc) 1 Purpose NAG Library Function Document nag_asian_geom_greeks () nag_asian_geom_greeks () computes the Asian geometric continuous average-rate option price together with its sensitivities (Greeks). 2 Specification

More information

NAG Library Function Document nag_ztzrzf (f08bvc)

NAG Library Function Document nag_ztzrzf (f08bvc) f08 Least-squares and Eigenvalue Problems (LAPACK) f08bvc NAG Library Function Document nag_ztzrzf (f08bvc) 1 Purpose nag_ztzrzf (f08bvc) reduces the m by n (m n) complex upper trapezoidal matrix A to

More information

NAG Library Function Document nag_dsymv (f16pcc)

NAG Library Function Document nag_dsymv (f16pcc) f16 NAG Interface to BLAS f16pcc 1 Purpose NAG Library Function Document nag_dsymv (f16pcc) nag_dsymv (f16pcc) performs matrix-vector multiplication for a real symmetric matrix. 2 Specification #include

More information

NAG Library Function Document nag_bsm_greeks (s30abc)

NAG Library Function Document nag_bsm_greeks (s30abc) s Approximations of Special Functions s30abc 1 Purpose NAG Library Function Document nag_bsm_greeks (s30abc) nag_bsm_greeks (s30abc) computes the European option price given by the Black Scholes Merton

More information

NAG C Library Function Document nag_zhsein (f08pxc)

NAG C Library Function Document nag_zhsein (f08pxc) 1 Purpose NAG C Library Function Document nag_zhsein () nag_zhsein () computes selected left and/or right eigenvectors of a complex upper Hessenberg matrix corresponding to specified eigenvalues, by inverse

More information

NAG Library Function Document nag_complex_tridiag_lin_solve (f04ccc)

NAG Library Function Document nag_complex_tridiag_lin_solve (f04ccc) f04 Simultaneous Linear Equations f04ccc Purpose NAG Library Function Document nag_complex_tridiag_lin_solve (f04ccc) nag_complex_tridiag_lin_solve (f04ccc) computes the solution to a complex system of

More information

NAG Library Function Document nag_dgb_norm (f16rbc)

NAG Library Function Document nag_dgb_norm (f16rbc) f16 NAG Interface to BLAS f16rbc NAG Library Function Document nag_dgb_norm (f16rbc) 1 Purpose nag_dgb_norm (f16rbc) calculates the value of the 1-norm, the 1-norm, the Frobenius norm or the maximum absolute

More information

NAG Library Function Document nag_ztrttf (f01vfc)

NAG Library Function Document nag_ztrttf (f01vfc) f01 Matrix Factorizations f01vfc NAG Library Function Document nag_ztrttf (f01vfc) 1 Purpose nag_ztrttf (f01vfc) copies a complex triangular matrix, stored in a full format array, to a Rectangular Full

More information

NAG Library Function Document nag_dgbmv (f16pbc)

NAG Library Function Document nag_dgbmv (f16pbc) NAG Library Function Document nag_dgbmv () 1 Purpose nag_dgbmv () performs matrix-vector multiplication for a real band matrix. 2 Specification #include #include void nag_dgbmv (Nag_OrderType

More information

NAG Library Function Document nag_complex_gen_lin_solve (f04cac)

NAG Library Function Document nag_complex_gen_lin_solve (f04cac) f04 Simultaneous Linear Equations f04cac Purpose NAG Library Function Document nag_complex_gen_lin_solve (f04cac) nag_complex_gen_lin_solve (f04cac) computes the solution to a complex system of linear

More information

NAG Library Function Document nag_herm_posdef_tridiag_lin_solve (f04cgc)

NAG Library Function Document nag_herm_posdef_tridiag_lin_solve (f04cgc) Purpose NAG Library Function Document nag_herm_posdef_tridiag_lin_solve () nag_herm_posdef_tridiag_lin_solve () computes the solution to a complex system of linear equations AX ¼ B, where A is an n by

More information

NAG Library Function Document nag_ztgsen (f08yuc)

NAG Library Function Document nag_ztgsen (f08yuc) NAG Library Function Document nag_ztgsen () 1 Purpose nag_ztgsen () reorders the generalized Schur factorization of a complex matrix pair in generalized Schur form, so that a selected cluster of eigenvalues

More information

NAG Library Function Document nag_smooth_spline_fit (g10abc)

NAG Library Function Document nag_smooth_spline_fit (g10abc) g10 Smoothing in Statistics g10abc NAG Library Function Document nag_smooth_spline_fit (g10abc) 1 Purpose nag_smooth_spline_fit (g10abc) fits a cubic smoothing spline for a given smoothing parameter. 2

More information

NAG Library Function Document nag_zhpr2 (f16ssc)

NAG Library Function Document nag_zhpr2 (f16ssc) NAG Library Function Document nag_zhpr2 () 1 Purpose nag_zhpr2 () performs a Hermitian rank-2 update on a complex Hermitian matrix stored in packed form. 2 Specification #include #include

More information

NAG Library Function Document nag_zpbequ (f07htc)

NAG Library Function Document nag_zpbequ (f07htc) NAG Library Function Document nag_zpbequ () 1 Purpose nag_zpbequ () computes a diagonal scaling matrix S intended to equilibrate a complex n by n Hermitian positive definite band matrix A, with bandwidth

More information

NAG Library Function Document nag_dsbev (f08hac)

NAG Library Function Document nag_dsbev (f08hac) f08 Least-squares and Eigenvalue Problems (LAPACK) f08hac NAG Library Function Document nag_dsbev (f08hac) 1 Purpose nag_dsbev (f08hac) computes all the eigenvalues and, optionally, all the eigenvectors

More information

NAG Library Function Document nag_dtfttp (f01vlc)

NAG Library Function Document nag_dtfttp (f01vlc) f01 Matrix Factorizations f01vlc NAG Library Function Document nag_dtfttp (f01vlc) 1 Purpose nag_dtfttp (f01vlc) copies a real triangular matrix, stored in a Rectangular Full Packed (RFP) format array,

More information

NAG Library Function Document nag_mv_promax (g03bdc)

NAG Library Function Document nag_mv_promax (g03bdc) g03 Multivariate Methods g03bdc NAG Library Function Document nag_mv_promax (g03bdc) 1 Purpose nag_mv_promax (g03bdc) calculates a ProMax rotation, given information following an orthogonal rotation. 2

More information

NAG C Library Function Document nag_tsa_multi_cross_corr (g13dmc)

NAG C Library Function Document nag_tsa_multi_cross_corr (g13dmc) g13 Time Series Analysis g13dmc 1 Purpose NAG C Library Function Document nag_tsa_multi_cross_corr (g13dmc) nag_tsa_multi_cross_corr (g13dmc) calculates the sample cross-correlation (or cross-covariance)

More information

NAG Library Function Document nag_dsytrf (f07mdc)

NAG Library Function Document nag_dsytrf (f07mdc) f07 Linear Equations (LAPACK) f07mdc 1 Purpose NAG Library Function Document nag_dsytrf (f07mdc) nag_dsytrf (f07mdc) computes the Bunch Kaufman factorization of a real symmetric indefinite matrix. 2 Specification

More information

NAG Library Function Document nag_prob_durbin_watson (g01epc)

NAG Library Function Document nag_prob_durbin_watson (g01epc) NAG Library Function Document nag_prob_durbin_watson () 1 Purpose nag_prob_durbin_watson () calculates upper and lower bounds for the significance of a Durbin Watson statistic. 2 Specification #include

More information

NAG Library Function Document nag_zheevx (f08fpc)

NAG Library Function Document nag_zheevx (f08fpc) f08 Least-squares and Eigenvalue Problems (LAPACK) NAG Library Function Document nag_zheevx () 1 Purpose nag_zheevx () computes selected eigenvalues and, optionally, eigenvectors of a complex n by n Hermitian

More information

NAG Library Function Document nag_dummy_vars (g04eac)

NAG Library Function Document nag_dummy_vars (g04eac) 1 Purpose NAG Library Function Document nag_dummy_vars () nag_dummy_vars () computes orthogonal polynomial or dummy variables for a factor or classification variable. 2 Specification #include #include

More information

NAG Library Function Document nag_corr_cov (g02bxc)

NAG Library Function Document nag_corr_cov (g02bxc) 1 Purpose NAG Library Function Document nag_corr_cov () nag_corr_cov () calculates the Pearson product-moment correlation coefficients and the variancecovariance matrix for a set of data. Weights may be

More information

NAG Library Function Document nag_sum_sqs_update (g02btc)

NAG Library Function Document nag_sum_sqs_update (g02btc) g02 Correlation and Regression Analysis NAG Library Function Document nag_sum_sqs_update () 1 Purpose nag_sum_sqs_update () updates the sample means and sums of squares and cross-products, or sums of squares

More information

NAG Library Function Document nag_legendre_p (s22aac)

NAG Library Function Document nag_legendre_p (s22aac) NAG Library Function Document nag_legendre_p () 1 Purpose nag_legendre_p () returns a sequence of values for either the unnormalized or normalized Legendre functions of the first kind Pn m or P n m ð x

More information

NAG Library Function Document nag_matop_complex_gen_matrix_fun_num (f01flc)

NAG Library Function Document nag_matop_complex_gen_matrix_fun_num (f01flc) NAG Library Function Document nag_matop_complex_gen_matrix_fun_num () 1 Purpose nag_matop_complex_gen_matrix_fun_num () computes the matrix function, fa ð Þ, of a complex n by n matrix A. Numerical differentiation

More information

NAG Library Function Document nag_ztfttp (f01vmc)

NAG Library Function Document nag_ztfttp (f01vmc) f01 Matrix Factorizations f01vmc NAG Library Function Document nag_ztfttp (f01vmc) 1 Purpose nag_ztfttp (f01vmc) copies a complex triangular matrix, stored in a Rectangular Full Packed (RFP) format array,

More information

NAG Library Function Document nag_corr_cov (g02bxc)

NAG Library Function Document nag_corr_cov (g02bxc) NAG Library Function Document nag_corr_cov () 1 Purpose nag_corr_cov () calculates the Pearson product-moment correlation coefficients and the variancecovariance matrix for a set of data. Weights may be

More information

NAG C Library Function Document nag_tsa_multi_part_lag_corr (g13dnc)

NAG C Library Function Document nag_tsa_multi_part_lag_corr (g13dnc) 1 Purpose NAG C Library Function Document nag_tsa_multi_part_lag_corr () nag_tsa_multi_part_lag_corr () calculates the sample partial lag correlation matrices of a multivariate time series. A set of 2

More information

NAG Library Function Document nag_dsf_norm (f16rkc)

NAG Library Function Document nag_dsf_norm (f16rkc) f16 NAG Interface to BLAS f16rkc NAG Library Function Document nag_dsf_norm (f16rkc) 1 Purpose nag_dsf_norm (f16rkc) returns the value of the 1-norm, the 1-norm, the Frobenius norm, or the maximum absolute

More information

NAG C Library Function Document nag_dspcon (f07pgc)

NAG C Library Function Document nag_dspcon (f07pgc) 1 Purpose NAG C Library Function Document nag_dspcon () nag_dspcon () estimates the condition number of a real symmetric indefinite matrix A, where A has been factorized by nag_dsptrf (f07pdc), using packed

More information

NAG C Library Function Document nag_zspcon (f07quc)

NAG C Library Function Document nag_zspcon (f07quc) 1 Purpose NAG C Library Function Document nag_zspcon () nag_zspcon () estimates the condition number of a complex symmetric matrix A, where A has been factorized by nag_zsptrf (f07qrc), using packed storage.

More information

NAG Library Function Document nag_2d_panel_sort (e02zac)

NAG Library Function Document nag_2d_panel_sort (e02zac) NAG Library Function Document nag_2d_panel_sort () 1 Purpose nag_2d_panel_sort () sorts two-dimensional data into rectangular panels. 2 Specification #include #include void nag_2d_panel_sort

More information

NAG Library Function Document nag_rand_arma (g05phc)

NAG Library Function Document nag_rand_arma (g05phc) g05 Random Number Generators g05phc 1 Purpose NAG Library Function Document nag_rand_arma (g05phc) nag_rand_arma (g05phc) generates a realization of a univariate time series from an autoregressive moving

More information

NAG Library Function Document nag_nd_shep_eval (e01znc)

NAG Library Function Document nag_nd_shep_eval (e01znc) NAG Library Function Document nag_nd_shep_eval () 1 Purpose nag_nd_shep_eval () evaluates the multi-dimensional interpolating function generated by nag_nd_shep_interp (e01zmc) and its first partial derivatives.

More information

NAG Library Function Document nag_tsa_cp_pelt_user (g13nbc)

NAG Library Function Document nag_tsa_cp_pelt_user (g13nbc) g13 Time Series Analysis g13nbc NAG Library Function Document nag_tsa_cp_pelt_user (g13nbc) 1 Purpose nag_tsa_cp_pelt_user (g13nbc) detects change points in a univariate time series, that is, the time

More information

NAG Library Function Document nag_outlier_peirce (g07gac)

NAG Library Function Document nag_outlier_peirce (g07gac) g07 Univariate Estimation g07gac NAG Library Function Document nag_outlier_peirce (g07gac) 1 Purpose nag_outlier_peirce (g07gac) identifies outlying values using Peirce s criterion. 2 Specification #include

More information

NAG Library Function Document. nag_matop_real_gen_matrix_cond_num

NAG Library Function Document. nag_matop_real_gen_matrix_cond_num NAG Library Function Document nag_matop_real_gen_matrix_cond_num () 1 Purpose nag_matop_real_gen_matrix_cond_num () computes an estimate of the absolute condition number of a matrix function f at a real

More information

NAG Library Function Document. nag_matop_complex_gen_matrix_cond_num

NAG Library Function Document. nag_matop_complex_gen_matrix_cond_num NAG Library Function Document nag_matop_complex_gen_matrix_cond_num () 1 Purpose nag_matop_complex_gen_matrix_cond_num () computes an estimate of the absolute condition number of a matrix function f of

More information

NAG Library Function Document nag_matop_real_gen_matrix_fun_num (f01elc)

NAG Library Function Document nag_matop_real_gen_matrix_fun_num (f01elc) NAG Library Function Document nag_matop_real_gen_matrix_fun_num () 1 Purpose nag_matop_real_gen_matrix_fun_num () computes the matrix function, fa ð Þ,ofarealnby n matrix A. Numerical differentiation is

More information