https://github.com/cran/aster
Raw File
Tip revision: aa47935123bfca8a22cbc8345d658d0c1713a289 authored by Charles J. Geyer on 14 December 2023, 15:20:02 UTC
version 1.1-3
Tip revision: aa47935
asttrans5.c

#include "aster.h"

void aster_theta2ctau(int *nindin, int *nnodein, int *pred, int *fam,
    double *theta, double *ctau)
{
    int nind = nindin[0];
    int nnode = nnodein[0];

    int i, j, jfam, jbase;

    aster_check_model(nindin, nnodein, pred, fam);

    /* j is 1-origin indexing */
    for (j = nnode; j > 0; --j) {
        jfam = fam[j - 1];
        jbase = nind * (j - 1);
        for (i = 0; i < nind; ++i) {
            int one = 1;
            double foo;
            aster_family(&jfam, &one, &theta[jbase + i], &foo);
            ctau[jbase + i] = foo;
        }
    }
}

back to top