`nls` fails to estimate parameters of my model
问题 I am trying to estimate the constants for Heaps law. I have the following dataset novels_colection : Number of novels DistinctWords WordOccurrences 1 1 13575 117795 2 1 34224 947652 3 1 40353 1146953 4 1 55392 1661664 5 1 60656 1968274 Then I build the next function: # Function for Heaps law heaps <- function(K, n, B){ K*n^B } heaps(2,117795,.7) #Just to test it works So n = Word Occurrences , and K and B are values that should be constants in order to find my prediction of Distinct Words. I