CosmoStatGW / gwfast

A Fisher information matrix python package for GW detector networks.
GNU General Public License v3.0
40 stars 13 forks source link

Query regarding fiducial values in fixParams function #2

Closed lalit-pathak closed 1 year ago

lalit-pathak commented 1 year ago
def fixParams(MatrIn, ParNums_inp, ParMarg):
    """
    Fix one or multiple parameters to their fiducial values in the Fisher matrix.

    :param array MatrIn: Array containing the Fisher matrix(ces), of shape :math:`(N_{\\rm parameters}`, :math:`N_{\\rm parameters}`, :math:`N_{\\rm events})`.
    :param dict(int) ParNums_inp: Dictionary specifying the position of each parameter in the input Fisher matrix, as :py:class:`gwfast.waveforms.WaveFormModel.ParNums`.
    :param list(str) ParMarg: List of the names of parameters to fix.

    :return: Fisher matrix with parameters fixed, of shape :math:`(\\tilde{N}_{\\rm parameters}`, :math:`\\tilde{N}_{\\rm parameters}`, :math:`N_{\\rm events})`, and dictionary specifying the position of each parameter in the new Fisher matrix. :math:`\\tilde{N}_{\\rm parameters}` is the original :math:`N_{\\rm parameters}` minus the number of parameters that have been fixed.
    :rtype: tuple(array, dict(int))

    """
    import copy
    ParNums = copy.deepcopy(ParNums_inp)

    IdxMarg = onp.sort(onp.array([ParNums[par] for par in ParMarg]))
    newdim = MatrIn.shape[0]-len(IdxMarg)

    NewMatr = onp.full( (newdim, newdim, MatrIn.shape[-1]), onp.NaN )

    for k in range(MatrIn.shape[-1]):

        Matr = onp.delete(MatrIn[:, :, k], IdxMarg, 0)
        Matr = onp.delete(Matr[:, :], IdxMarg, 1)
        NewMatr[:, :, k] = Matr

In the above function, we fix the parameter to project a higher-dimensional fisher matrix onto a lower-dimensional fisher matrix. In the first line of this function, it says, "Fix one or multiple parameters to their fiducial values in the Fisher matrix". What are these fiducial values? Are these values the same as the ones we provide while defining the "myLVNet.FisherMatr" object?

Thanks

FrancescoIacovelli commented 1 year ago

Hi! In the context of FIM, fixing a parameter means removing its row/column from the matrix. The fiducial value is just the injected value of the parameter for each event (which you insert in the events dictionary and then pass to the FisherMatr method, that is correct).

lalit-pathak commented 1 year ago

Thanks, @FrancescoIacovelli.