Examples of FunctionV1


Examples of fork.lib.math.algebra.elementary.function.v1.FunctionV1

* @param sigma   standard deviation
* @return  
*/
public FunctionV1 kernelDensityEstimation(double sigma){
    try{
        FunctionV1 fn= new ConstantFunction(0);
        Iterator<Double> it= cs.keySet().iterator();
        while(it.hasNext()){
            Double v= it.next();
            Integer f= cs.get(v);
            double coeff= (double) f.intValue()/size();
            fn= fn.add( (new NormalDistribution( v.doubleValue(), sigma)).
                    multiply(new ConstantFunction(coeff)) );
        }
        return fn;
    }catch(FunctionException e){
        e.printStackTrace();
View Full Code Here

Examples of fork.lib.math.algebra.elementary.function.v1.FunctionV1

* @param coeffs
* @return
* @throws FunctionException
*/
public static double logLikelihood(Distribution data, ArrayList<DistributionFunction> distrs, ArrayList<Double> coeffs) throws FunctionException{
    FunctionV1 fn= new ConstantFunction(0);
    for( int i=0; i<distrs.size(); i++ ){
        fn = fn.add( distrs.get(i).multiply(new ConstantFunction(coeffs.get(i))) );
    }
    return data.logLikelihood(fn);
}
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.