pmf method Null safety

double pmf(
  1. T value

Probability mass function (PMF) tells probability of specific event.


In this example, we use Frequencies.

import 'package:calc/calc.dart';

void main() {
  // Two cats and two other animals
  final frequencies = Frequencies<String>.from([

  final catPmf = frequencies.pmf('cat'); // --> 0.5
  print('Likelihood of cats based on the seen data: $catPmf');


double pmf(T value);