weighted

How to plot a 3D weight function in python with matplotlib

给你一囗甜甜゛ 提交于 2021-02-11 14:47:51
问题 Is there any Python library/function in order to print in 3D the function "weight" weight(x,y,z) = x**(y*z) + y**(x*z) + z**(x*y) with Python and Matplotlib ? Here is already an interesting link How to plot a 3D density map in python with matplotlib but it shows a density instead of a weight for distributed coordinates X Y Z, for example from -5 to +5 with regular steps 0.1 (where solutions for the weight exists in real numbers). I am just playing around with some math functions and wanted to

Weibull distribution with weighted data

半世苍凉 提交于 2021-02-11 13:31:08
问题 I have some time to event data that I need to generate around 200 shape/scale parameters for subgroups for a simulation model. I have analysed the data, and it best follows a weibull distribution. Normally, I would use the fitdistrplus package and fitdist(x, "weibull") to do so, however this data has been matched using kernel matching and I have a variable of weighting values called km and so needs to incorporate a weight, which isn't something fitdist can do as far as I can tell. With my

Weibull distribution with weighted data

前提是你 提交于 2021-02-11 13:31:04
问题 I have some time to event data that I need to generate around 200 shape/scale parameters for subgroups for a simulation model. I have analysed the data, and it best follows a weibull distribution. Normally, I would use the fitdistrplus package and fitdist(x, "weibull") to do so, however this data has been matched using kernel matching and I have a variable of weighting values called km and so needs to incorporate a weight, which isn't something fitdist can do as far as I can tell. With my

Ocaml: Longest path using bfs

荒凉一梦 提交于 2021-01-29 01:49:14
问题 The problem is as follow: Given an oriented weighted graph, a start node, an end node and a number k, verify if exist a path from the start node to the end node with at least length k. This is the code i wrote and it's correct but only in specific graph. For example g1 with weights1 is as follows: let weights1 = [(2,1,1);(2,1,3);(2,1,4);(1,1,5);(5,1,2);(5,1,6);(3,1,6);(6,1,7);(4,1,3)];; let f1 = function 1 -> [5] | 2 -> [1;3;4] | 3 -> [6] | 4 -> [3] | 5 -> [2;6] | 6 -> [7] | _ -> [];; type 'a

Ocaml: Longest path using bfs

陌路散爱 提交于 2021-01-29 01:44:21
问题 The problem is as follow: Given an oriented weighted graph, a start node, an end node and a number k, verify if exist a path from the start node to the end node with at least length k. This is the code i wrote and it's correct but only in specific graph. For example g1 with weights1 is as follows: let weights1 = [(2,1,1);(2,1,3);(2,1,4);(1,1,5);(5,1,2);(5,1,6);(3,1,6);(6,1,7);(4,1,3)];; let f1 = function 1 -> [5] | 2 -> [1;3;4] | 3 -> [6] | 4 -> [3] | 5 -> [2;6] | 6 -> [7] | _ -> [];; type 'a

Correcting dfs when using sample weights with lm

不想你离开。 提交于 2021-01-05 07:21:46
问题 I was trying to figure out how weighting in lm actually worked and I saw this 7,5 year old question which gives some insight in how weights work. The data from this question is partly copied and expanded on below. I posted this related question, on Cross Validated. library(plyr) set.seed(100) df <- data.frame(uid=1:200, bp=sample(x=c(100:200),size=200,replace=TRUE), age=sample(x=c(30:65),size=200,replace=TRUE), weight=sample(c(1:10),size=200,replace=TRUE), stringsAsFactors=FALSE) set.seed(100

weighted numpy bincount for 2D IDs array and 1D weights

泄露秘密 提交于 2020-07-09 08:39:50
问题 I am using numpy_indexed for applying a vectorized numpy bincount, as follows: import numpy as np import numpy_indexed as npi rowidx, colidx = np.indices(index_tri.shape) (cols, rows), B = npi.count((index_tri.flatten(), rowidx.flatten())) where index_tri is the following matrix: index_tri = np.array([[ 0, 0, 0, 7, 1, 3], [ 1, 2, 2, 9, 8, 9], [ 3, 1, 1, 4, 9, 1], [ 5, 6, 6, 10, 10, 10], [ 7, 8, 9, 4, 3, 3], [ 3, 8, 6, 3, 8, 6], [ 4, 3, 3, 7, 8, 9], [10, 10, 10, 5, 6, 6], [ 4, 9, 1, 3, 1, 1],