# vim:ft=plumed

# Chi-squared distribution
# see https://en.wikipedia.org/wiki/Chi-squared_distribution

arg1: READ FILE=arg.in VALUES=arg IGNORE_TIME

TD_CHISQUARED  ...
 MINIMUM=+0.0
 SIGMA=1.0
 KAPPA=2
 LABEL=t1
... TD_CHISQUARED 
#
VES_OUTPUT_TARGET_DISTRIBUTION ...
 GRID_MIN=0.0
 GRID_MAX=+15.0
 GRID_BINS=200
 TARGET_DISTRIBUTION=t1
 TARGETDIST_FILE=targetdist-1.data
 FMT_GRIDS=%11.6f
... VES_OUTPUT_TARGET_DISTRIBUTION


TD_CHISQUARED  ...
 MINIMUM=-10.0
 SIGMA=1.0
 KAPPA=2
 LABEL=t2
... TD_CHISQUARED 
#
VES_OUTPUT_TARGET_DISTRIBUTION ...
 GRID_MIN=-10.0
 GRID_MAX=5.0
 GRID_BINS=200
 TARGET_DISTRIBUTION=t2
 TARGETDIST_FILE=targetdist-2.data
 FMT_GRIDS=%11.6f
... VES_OUTPUT_TARGET_DISTRIBUTION


TD_CHISQUARED  ...
 MINIMUM=10.0
 SIGMA=2.0
 KAPPA=2
 LABEL=t3
... TD_CHISQUARED 
#
VES_OUTPUT_TARGET_DISTRIBUTION ...
 GRID_MIN=10.0
 GRID_MAX=50.0
 GRID_BINS=200
 TARGET_DISTRIBUTION=t3
 TARGETDIST_FILE=targetdist-3.data
 FMT_GRIDS=%11.6f
... VES_OUTPUT_TARGET_DISTRIBUTION


TD_CHISQUARED  ...
 MINIMUM=10.0
 SIGMA=2.0
 KAPPA=3
 LABEL=t4
... TD_CHISQUARED 
#
VES_OUTPUT_TARGET_DISTRIBUTION ...
 GRID_MIN=10.0
 GRID_MAX=50.0
 GRID_BINS=200
 TARGET_DISTRIBUTION=t4
 TARGETDIST_FILE=targetdist-4.data
 FMT_GRIDS=%11.6f
... VES_OUTPUT_TARGET_DISTRIBUTION


TD_CHISQUARED  ...
 MINIMUM=10.0
 SIGMA=2.0
 KAPPA=4
 LABEL=t5
... TD_CHISQUARED 
#
VES_OUTPUT_TARGET_DISTRIBUTION ...
 GRID_MIN=10.0
 GRID_MAX=50.0
 GRID_BINS=200
 TARGET_DISTRIBUTION=t5
 TARGETDIST_FILE=targetdist-5.data
 FMT_GRIDS=%11.6f
... VES_OUTPUT_TARGET_DISTRIBUTION


TD_CHISQUARED  ...
 MINIMUM=10.0
 SIGMA=2.0
 KAPPA=6
 LABEL=t6
... TD_CHISQUARED 
#
VES_OUTPUT_TARGET_DISTRIBUTION ...
 GRID_MIN=10.0
 GRID_MAX=50.0
 GRID_BINS=200
 TARGET_DISTRIBUTION=t6
 TARGETDIST_FILE=targetdist-6.data
 FMT_GRIDS=%11.6f
... VES_OUTPUT_TARGET_DISTRIBUTION


#TD_CHISQUARED  ...
# MINIMUM=10.0,20.0
# SIGMA=2.0,1.5
# KAPPA=4,2
# LABEL=t7
#... TD_CHISQUARED 
#
TD_CHISQUARED  ...
 MINIMUM=10.0
 SIGMA=2.0
 KAPPA=4
 LABEL=t7a
... TD_CHISQUARED
TD_CHISQUARED  ...
 MINIMUM=20.0
 SIGMA=1.5
 KAPPA=2
 LABEL=t7b
... TD_CHISQUARED
t7: TD_PRODUCT_DISTRIBUTION DISTRIBUTIONS=t7a,t7b
#
VES_OUTPUT_TARGET_DISTRIBUTION ...
 GRID_MIN=10.0,20.0
 GRID_MAX=50.0,60
 GRID_BINS=100,100
 TARGET_DISTRIBUTION=t7
 TARGETDIST_FILE=targetdist-7.data
 FMT_GRIDS=%11.6f
... VES_OUTPUT_TARGET_DISTRIBUTION


TD_CHISQUARED  ...
 MINIMUM=10.0
 SIGMA=2.0
 KAPPA=4
 LABEL=t8a
... TD_CHISQUARED
t8b: TD_UNIFORM
t8: TD_PRODUCT_DISTRIBUTION DISTRIBUTIONS=t8a,t8b
#
VES_OUTPUT_TARGET_DISTRIBUTION ...
 GRID_MIN=10.0,20.0
 GRID_MAX=50.0,60
 GRID_BINS=100,100
 TARGET_DISTRIBUTION=t8 
 TARGETDIST_FILE=targetdist-8.data
 FMT_GRIDS=%11.6f
... VES_OUTPUT_TARGET_DISTRIBUTION
